diff --git a/examples/function-calling/function-calling-azure.py b/examples/function-calling/function-calling-azure.py index 37d67b29b..35ff4e91e 100644 --- a/examples/function-calling/function-calling-azure.py +++ b/examples/function-calling/function-calling-azure.py @@ -133,6 +133,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-cerebras.py b/examples/function-calling/function-calling-cerebras.py index 82d98d40e..aca7c7673 100644 --- a/examples/function-calling/function-calling-cerebras.py +++ b/examples/function-calling/function-calling-cerebras.py @@ -142,6 +142,9 @@ Start by asking me for my location. Then, use 'get_weather_current' to give me a async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-deepseek.py b/examples/function-calling/function-calling-deepseek.py index fc354ccf5..d5b54f258 100644 --- a/examples/function-calling/function-calling-deepseek.py +++ b/examples/function-calling/function-calling-deepseek.py @@ -143,6 +143,9 @@ Start by asking me for my location. Then, use 'get_weather_current' to give me a async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-direct.py b/examples/function-calling/function-calling-direct.py index c885d6606..0f5c9080b 100644 --- a/examples/function-calling/function-calling-direct.py +++ b/examples/function-calling/function-calling-direct.py @@ -134,6 +134,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-groq.py b/examples/function-calling/function-calling-groq.py index d4c69349e..bcc64b339 100644 --- a/examples/function-calling/function-calling-groq.py +++ b/examples/function-calling/function-calling-groq.py @@ -131,6 +131,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-mistral.py b/examples/function-calling/function-calling-mistral.py index e44adf8ba..c2784b4cb 100644 --- a/examples/function-calling/function-calling-mistral.py +++ b/examples/function-calling/function-calling-mistral.py @@ -144,6 +144,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-novita.py b/examples/function-calling/function-calling-novita.py index d9838e37f..1d5e5f0c6 100644 --- a/examples/function-calling/function-calling-novita.py +++ b/examples/function-calling/function-calling-novita.py @@ -149,6 +149,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-nvidia.py b/examples/function-calling/function-calling-nvidia.py index 2b4818ceb..3dddb295e 100644 --- a/examples/function-calling/function-calling-nvidia.py +++ b/examples/function-calling/function-calling-nvidia.py @@ -135,6 +135,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-ollama.py b/examples/function-calling/function-calling-ollama.py index ec6c3948a..5fbee4394 100644 --- a/examples/function-calling/function-calling-ollama.py +++ b/examples/function-calling/function-calling-ollama.py @@ -149,6 +149,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-openai-responses-async-stream.py b/examples/function-calling/function-calling-openai-responses-async-stream.py index 4007c21eb..27307232c 100644 --- a/examples/function-calling/function-calling-openai-responses-async-stream.py +++ b/examples/function-calling/function-calling-openai-responses-async-stream.py @@ -187,6 +187,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-openai.py b/examples/function-calling/function-calling-openai.py index 20777eaca..45378a4cf 100644 --- a/examples/function-calling/function-calling-openai.py +++ b/examples/function-calling/function-calling-openai.py @@ -148,6 +148,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-openrouter.py b/examples/function-calling/function-calling-openrouter.py index 299846133..58c98c2a3 100644 --- a/examples/function-calling/function-calling-openrouter.py +++ b/examples/function-calling/function-calling-openrouter.py @@ -76,7 +76,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): llm = OpenRouterLLMService( api_key=os.environ["OPENROUTER_API_KEY"], settings=OpenRouterLLMService.Settings( - model="openai/gpt-4o-2024-11-20", system_instruction="You are a helpful assistant in a voice conversation. Your responses will be spoken aloud, so avoid emojis, bullet points, or other formatting that can't be spoken. Respond to what the user said in a creative, helpful, and brief way.", ), ) @@ -136,6 +135,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-qwen.py b/examples/function-calling/function-calling-qwen.py index 78aa48adf..366f35ec8 100644 --- a/examples/function-calling/function-calling-qwen.py +++ b/examples/function-calling/function-calling-qwen.py @@ -134,6 +134,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected") diff --git a/examples/function-calling/function-calling-sambanova.py b/examples/function-calling/function-calling-sambanova.py index 528c4fc47..091bbe449 100644 --- a/examples/function-calling/function-calling-sambanova.py +++ b/examples/function-calling/function-calling-sambanova.py @@ -133,6 +133,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): async def on_client_connected(transport, client): logger.info(f"Client connected") # Kick off the conversation. + context.add_message( + {"role": "developer", "content": "Please introduce yourself to the user."} + ) await task.queue_frames([LLMRunFrame()]) @transport.event_handler("on_client_disconnected")