@@ -68,24 +68,20 @@ async def get_weather(
68
68
# fnc_ctx=fnc_ctx,
69
69
# )
70
70
71
- # create a chat context with chat history
71
+ # create a chat context with chat history, these will be synchronized with the server
72
+ # upon session establishment
72
73
chat_ctx = llm .ChatContext ()
73
- chat_ctx .append (text = "I'm planning a trip to Paris next month." , role = "user" )
74
- chat_ctx .append (
75
- text = "How exciting! Paris is a beautiful city. I'd be happy to suggest some must-visit places and help you plan your trip." ,
76
- role = "assistant" ,
77
- )
78
- chat_ctx .append (text = "What are the must-visit places in Paris?" , role = "user" )
79
- chat_ctx .append (
80
- text = "The must-visit places in Paris are the Eiffel Tower, Louvre Museum, Notre-Dame Cathedral, and Montmartre." ,
81
- role = "assistant" ,
82
- )
74
+ # chat_ctx.append(text="I'm planning a trip to Paris next month.", role="user")
75
+ # chat_ctx.append(
76
+ # text="How exciting! Paris is a beautiful city. I'd be happy to suggest some must-visit places and help you plan your trip.",
77
+ # role="assistant",
78
+ # )
83
79
84
80
agent = multimodal .MultimodalAgent (
85
81
model = openai .realtime .RealtimeModel (
86
82
voice = "alloy" ,
87
83
temperature = 0.8 ,
88
- instructions = "You are a helpful assistant" ,
84
+ instructions = "You are a helpful assistant, greet the user and help them with their trip planning " ,
89
85
turn_detection = openai .realtime .ServerVadOptions (
90
86
threshold = 0.6 , prefix_padding_ms = 200 , silence_duration_ms = 500
91
87
),
@@ -94,6 +90,7 @@ async def get_weather(
94
90
chat_ctx = chat_ctx ,
95
91
)
96
92
agent .start (ctx .room , participant )
93
+ agent .generate_reply ()
97
94
98
95
@agent .on ("agent_speech_committed" )
99
96
@agent .on ("agent_speech_interrupted" )
0 commit comments