From 5806a3f0fa5215a04b3a1e509d0e1efc24576904 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Fri, 20 Mar 2026 17:46:47 -0400 Subject: [PATCH] Use "developer" role for remaining developer-intent messages in examples --- examples/foundational/07m-interruptible-aws-strands.py | 2 +- examples/foundational/07n-interruptible-gemini.py | 2 +- examples/foundational/14d-function-calling-anthropic-video.py | 2 +- examples/foundational/14d-function-calling-aws-video.py | 2 +- .../foundational/14d-function-calling-gemini-flash-video.py | 2 +- examples/foundational/14d-function-calling-moondream-video.py | 2 +- .../14d-function-calling-openai-responses-video.py | 2 +- examples/foundational/14d-function-calling-openai-video.py | 2 +- examples/foundational/14e-function-calling-google.py | 2 +- .../foundational/14o-function-calling-gemini-openai-format.py | 2 +- .../foundational/14p-function-calling-gemini-vertex-ai.py | 2 +- examples/foundational/15-switch-voices.py | 2 +- examples/foundational/15a-switch-languages.py | 2 +- examples/foundational/17-detect-user-idle.py | 4 ++-- examples/foundational/19a-azure-realtime-beta.py | 4 ++-- examples/foundational/19a-azure-realtime.py | 4 ++-- examples/foundational/20c-persistent-context-anthropic.py | 2 +- examples/foundational/20d-persistent-context-gemini.py | 2 +- .../foundational/20e-persistent-context-aws-nova-sonic.py | 2 +- examples/foundational/21-tavus-transport.py | 2 +- examples/foundational/22-filter-incomplete-turns.py | 2 +- examples/foundational/24-user-mute-strategy.py | 2 +- examples/foundational/25-google-audio-in.py | 4 ++-- examples/foundational/26c-gemini-live-video.py | 2 +- examples/foundational/26d-gemini-live-text.py | 2 +- examples/foundational/26e-gemini-live-google-search.py | 2 +- examples/foundational/26f-gemini-live-files-api.py | 4 ++-- examples/foundational/32-gemini-grounding-metadata.py | 2 +- examples/foundational/43-heygen-transport.py | 2 +- examples/foundational/43a-heygen-video-service.py | 2 +- examples/foundational/46-video-processing.py | 2 +- .../foundational/53-concurrent-llm-rtvi-ignored-sources.py | 2 +- examples/foundational/55zzg-update-settings-perplexity-llm.py | 2 +- examples/foundational/56-lemonslice-transport.py | 2 +- 34 files changed, 39 insertions(+), 39 deletions(-) diff --git a/examples/foundational/07m-interruptible-aws-strands.py b/examples/foundational/07m-interruptible-aws-strands.py index 5d7b5fc8e..ee5d77aad 100644 --- a/examples/foundational/07m-interruptible-aws-strands.py +++ b/examples/foundational/07m-interruptible-aws-strands.py @@ -151,7 +151,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): LLMMessagesAppendFrame( messages=[ { - "role": "user", + "role": "developer", "content": f"Greet the user and introduce yourself. Don't use emojis.", } ], diff --git a/examples/foundational/07n-interruptible-gemini.py b/examples/foundational/07n-interruptible-gemini.py index 00290bd3a..7b995a564 100644 --- a/examples/foundational/07n-interruptible-gemini.py +++ b/examples/foundational/07n-interruptible-gemini.py @@ -128,7 +128,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation context.add_message( { - "role": "user", + "role": "developer", "content": "You are an AI assistant. You can help with a variety of tasks. Introduce yourself and ask the user what they would like to know.", } ) diff --git a/examples/foundational/14d-function-calling-anthropic-video.py b/examples/foundational/14d-function-calling-anthropic-video.py index f2653101e..c3a292f31 100644 --- a/examples/foundational/14d-function-calling-anthropic-video.py +++ b/examples/foundational/14d-function-calling-anthropic-video.py @@ -164,7 +164,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14d-function-calling-aws-video.py b/examples/foundational/14d-function-calling-aws-video.py index 9fccdecdf..8db25671b 100644 --- a/examples/foundational/14d-function-calling-aws-video.py +++ b/examples/foundational/14d-function-calling-aws-video.py @@ -169,7 +169,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user briefly; don't mention the camera. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14d-function-calling-gemini-flash-video.py b/examples/foundational/14d-function-calling-gemini-flash-video.py index ba76de44b..59816fdd5 100644 --- a/examples/foundational/14d-function-calling-gemini-flash-video.py +++ b/examples/foundational/14d-function-calling-gemini-flash-video.py @@ -164,7 +164,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14d-function-calling-moondream-video.py b/examples/foundational/14d-function-calling-moondream-video.py index 2bbfbd426..b8076e7ce 100644 --- a/examples/foundational/14d-function-calling-moondream-video.py +++ b/examples/foundational/14d-function-calling-moondream-video.py @@ -202,7 +202,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14d-function-calling-openai-responses-video.py b/examples/foundational/14d-function-calling-openai-responses-video.py index 440c51cc1..9a77af400 100644 --- a/examples/foundational/14d-function-calling-openai-responses-video.py +++ b/examples/foundational/14d-function-calling-openai-responses-video.py @@ -163,7 +163,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14d-function-calling-openai-video.py b/examples/foundational/14d-function-calling-openai-video.py index 59bef64b6..3c4fcd2f6 100644 --- a/examples/foundational/14d-function-calling-openai-video.py +++ b/examples/foundational/14d-function-calling-openai-video.py @@ -163,7 +163,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14e-function-calling-google.py b/examples/foundational/14e-function-calling-google.py index e5a2cfb40..421a02a1e 100644 --- a/examples/foundational/14e-function-calling-google.py +++ b/examples/foundational/14e-function-calling-google.py @@ -220,7 +220,7 @@ indicate you should use the get_image tool are: # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/14o-function-calling-gemini-openai-format.py b/examples/foundational/14o-function-calling-gemini-openai-format.py index 70e8af3d3..e3b06c0d6 100644 --- a/examples/foundational/14o-function-calling-gemini-openai-format.py +++ b/examples/foundational/14o-function-calling-gemini-openai-format.py @@ -102,7 +102,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): tools = ToolsSchema(standard_tools=[weather_function]) messages = [ { - "role": "user", + "role": "developer", "content": "Start a conversation with 'Hey there' to get the current weather.", }, ] diff --git a/examples/foundational/14p-function-calling-gemini-vertex-ai.py b/examples/foundational/14p-function-calling-gemini-vertex-ai.py index fb3910ed3..3bee2f1bb 100644 --- a/examples/foundational/14p-function-calling-gemini-vertex-ai.py +++ b/examples/foundational/14p-function-calling-gemini-vertex-ai.py @@ -105,7 +105,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): messages = [ { - "role": "user", + "role": "developer", "content": "Start a conversation with 'Hey there' to get the current weather.", }, ] diff --git a/examples/foundational/15-switch-voices.py b/examples/foundational/15-switch-voices.py index daf77ecde..0c47d69ae 100644 --- a/examples/foundational/15-switch-voices.py +++ b/examples/foundational/15-switch-voices.py @@ -172,7 +172,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user and let them know the voices you can do. Your initial responses should be as if you were a {tts.current_voice}.", } ) diff --git a/examples/foundational/15a-switch-languages.py b/examples/foundational/15a-switch-languages.py index 0ff13df1a..c47d66847 100644 --- a/examples/foundational/15a-switch-languages.py +++ b/examples/foundational/15a-switch-languages.py @@ -162,7 +162,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user and let them know the languages you speak. Your initial responses should be in {tts.current_language}.", } ) diff --git a/examples/foundational/17-detect-user-idle.py b/examples/foundational/17-detect-user-idle.py index a427ae47e..a159f0c4e 100644 --- a/examples/foundational/17-detect-user-idle.py +++ b/examples/foundational/17-detect-user-idle.py @@ -60,14 +60,14 @@ class IdleHandler: if self._retry_count == 1: # First attempt: Add a gentle prompt to the conversation message = { - "role": "user", + "role": "developer", "content": "The user has been quiet. Politely and briefly ask if they're still there.", } await aggregator.push_frame(LLMMessagesAppendFrame([message], run_llm=True)) elif self._retry_count == 2: # Second attempt: More direct prompt message = { - "role": "user", + "role": "developer", "content": "The user is still inactive. Ask if they'd like to continue our conversation.", } await aggregator.push_frame(LLMMessagesAppendFrame([message], run_llm=True)) diff --git a/examples/foundational/19a-azure-realtime-beta.py b/examples/foundational/19a-azure-realtime-beta.py index a7f1463db..4e9b7bcb1 100644 --- a/examples/foundational/19a-azure-realtime-beta.py +++ b/examples/foundational/19a-azure-realtime-beta.py @@ -152,10 +152,10 @@ Remember, your responses should be short. Just one or two sentences, usually. Re # openai WebSocket API can understand. context = OpenAILLMContext( [{"role": "developer", "content": "Say hello!"}], - # [{"role": "user", "content": [{"type": "text", "text": "Say hello!"}]}], + # [{"role": "developer", "content": [{"type": "text", "text": "Say hello!"}]}], # [ # { - # "role": "user", + # "role": "developer", # "content": [ # {"type": "text", "text": "Say"}, # {"type": "text", "text": "yo what's up!"}, diff --git a/examples/foundational/19a-azure-realtime.py b/examples/foundational/19a-azure-realtime.py index 1a401155b..c57602f6f 100644 --- a/examples/foundational/19a-azure-realtime.py +++ b/examples/foundational/19a-azure-realtime.py @@ -159,10 +159,10 @@ Remember, your responses should be short. Just one or two sentences, usually. Re # openai WebSocket API can understand. context = LLMContext( [{"role": "developer", "content": "Say hello!"}], - # [{"role": "user", "content": [{"type": "text", "text": "Say hello!"}]}], + # [{"role": "developer", "content": [{"type": "text", "text": "Say hello!"}]}], # [ # { - # "role": "user", + # "role": "developer", # "content": [ # {"type": "text", "text": "Say"}, # {"type": "text", "text": "yo what's up!"}, diff --git a/examples/foundational/20c-persistent-context-anthropic.py b/examples/foundational/20c-persistent-context-anthropic.py index 1b74c87e1..c401becb2 100644 --- a/examples/foundational/20c-persistent-context-anthropic.py +++ b/examples/foundational/20c-persistent-context-anthropic.py @@ -226,7 +226,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": "Start the call by saying the word 'hello'. Say only that word.", } ) diff --git a/examples/foundational/20d-persistent-context-gemini.py b/examples/foundational/20d-persistent-context-gemini.py index ae37e19ce..d236a15b1 100644 --- a/examples/foundational/20d-persistent-context-gemini.py +++ b/examples/foundational/20d-persistent-context-gemini.py @@ -303,7 +303,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": f"Please introduce yourself to the user. Use '{client_id}' as the user ID during function calls.", } ) diff --git a/examples/foundational/20e-persistent-context-aws-nova-sonic.py b/examples/foundational/20e-persistent-context-aws-nova-sonic.py index 15cabb456..e4dc635bf 100644 --- a/examples/foundational/20e-persistent-context-aws-nova-sonic.py +++ b/examples/foundational/20e-persistent-context-aws-nova-sonic.py @@ -112,7 +112,7 @@ async def load_conversation(params: FunctionCallParams): # commented out below, is part of this. # messages.append( # { - # "role": "user", + # "role": "developer", # "content": f"{AWSNovaSonicLLMService.AWAIT_TRIGGER_ASSISTANT_RESPONSE_INSTRUCTION}", # } # ) diff --git a/examples/foundational/21-tavus-transport.py b/examples/foundational/21-tavus-transport.py index f09902fcd..f4a4aab01 100644 --- a/examples/foundational/21-tavus-transport.py +++ b/examples/foundational/21-tavus-transport.py @@ -97,7 +97,7 @@ async def main(): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": "Start by greeting the user and ask how you can help.", } ) diff --git a/examples/foundational/22-filter-incomplete-turns.py b/examples/foundational/22-filter-incomplete-turns.py index 8a3001366..fca89f66c 100644 --- a/examples/foundational/22-filter-incomplete-turns.py +++ b/examples/foundational/22-filter-incomplete-turns.py @@ -130,7 +130,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": "Please introduce yourself to the user, asking them a question that will require a complete response. To start, say 'Let me start with a fun one. If you could travel anywhere in the world right now, where would you go and why?'", } ) diff --git a/examples/foundational/24-user-mute-strategy.py b/examples/foundational/24-user-mute-strategy.py index f7e29c171..6e826f81d 100644 --- a/examples/foundational/24-user-mute-strategy.py +++ b/examples/foundational/24-user-mute-strategy.py @@ -143,7 +143,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation with a weather-related prompt context.add_message( { - "role": "user", + "role": "developer", "content": "Ask the user what city they'd like to know the weather for.", } ) diff --git a/examples/foundational/25-google-audio-in.py b/examples/foundational/25-google-audio-in.py index 7a6c910e7..c22ed85a1 100644 --- a/examples/foundational/25-google-audio-in.py +++ b/examples/foundational/25-google-audio-in.py @@ -179,7 +179,7 @@ class InputTranscriptionContextFilter(FrameProcessor): } ) new_message_content.append(last_part) - msg = {"role": "user", "content": new_message_content} + msg = {"role": "developer", "content": new_message_content} ctx = LLMContext([{"role": "system", "content": transcriber_system_message}, msg]) await self.push_frame(LLMContextFrame(context=ctx)) @@ -318,7 +318,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): messages = [ { - "role": "user", + "role": "developer", "content": "Start by saying hello.", }, ] diff --git a/examples/foundational/26c-gemini-live-video.py b/examples/foundational/26c-gemini-live-video.py index dc5044617..38626cb6d 100644 --- a/examples/foundational/26c-gemini-live-video.py +++ b/examples/foundational/26c-gemini-live-video.py @@ -63,7 +63,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): context = LLMContext( [ { - "role": "user", + "role": "developer", "content": "Say hello.", }, ], diff --git a/examples/foundational/26d-gemini-live-text.py b/examples/foundational/26d-gemini-live-text.py index 29a4fd112..645b53b56 100644 --- a/examples/foundational/26d-gemini-live-text.py +++ b/examples/foundational/26d-gemini-live-text.py @@ -88,7 +88,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): messages = [ { - "role": "user", + "role": "developer", "content": 'Start by saying "Hello, I\'m Gemini".', }, ] diff --git a/examples/foundational/26e-gemini-live-google-search.py b/examples/foundational/26e-gemini-live-google-search.py index 28ab77c2a..0d124fa8d 100644 --- a/examples/foundational/26e-gemini-live-google-search.py +++ b/examples/foundational/26e-gemini-live-google-search.py @@ -83,7 +83,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): context = LLMContext( [ { - "role": "user", + "role": "developer", "content": "Start by greeting the user warmly, introducing yourself, and mentioning the current day. Be friendly and engaging to set a positive tone for the interaction.", } ], diff --git a/examples/foundational/26f-gemini-live-files-api.py b/examples/foundational/26f-gemini-live-files-api.py index 5abb50788..fd019fc2a 100644 --- a/examples/foundational/26f-gemini-live-files-api.py +++ b/examples/foundational/26f-gemini-live-files-api.py @@ -133,7 +133,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): context = LLMContext( [ { - "role": "user", + "role": "developer", "content": [ { "type": "text", @@ -156,7 +156,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): context = LLMContext( [ { - "role": "user", + "role": "developer", "content": "Greet the user and explain that there was an issue with file upload, but you're ready to help with other tasks.", } ] diff --git a/examples/foundational/32-gemini-grounding-metadata.py b/examples/foundational/32-gemini-grounding-metadata.py index 89afacfc3..5b706d6c9 100644 --- a/examples/foundational/32-gemini-grounding-metadata.py +++ b/examples/foundational/32-gemini-grounding-metadata.py @@ -116,7 +116,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): context = LLMContext( [ { - "role": "user", + "role": "developer", "content": "Start by greeting the user warmly, introducing yourself, and mentioning the current day. Be friendly and engaging to set a positive tone for the interaction.", } ], diff --git a/examples/foundational/43-heygen-transport.py b/examples/foundational/43-heygen-transport.py index 07190da16..47ec01abd 100644 --- a/examples/foundational/43-heygen-transport.py +++ b/examples/foundational/43-heygen-transport.py @@ -100,7 +100,7 @@ async def main(): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": "Start by saying 'Hello' and then a short greeting.", } ) diff --git a/examples/foundational/43a-heygen-video-service.py b/examples/foundational/43a-heygen-video-service.py index 580aa52fc..35d2e3221 100644 --- a/examples/foundational/43a-heygen-video-service.py +++ b/examples/foundational/43a-heygen-video-service.py @@ -133,7 +133,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": "Start by saying 'Hello' and then a short greeting.", } ) diff --git a/examples/foundational/46-video-processing.py b/examples/foundational/46-video-processing.py index 0551728a8..531c7c940 100644 --- a/examples/foundational/46-video-processing.py +++ b/examples/foundational/46-video-processing.py @@ -104,7 +104,7 @@ async def run_bot(pipecat_transport): messages = [ { - "role": "user", + "role": "developer", "content": "Start by greeting the user warmly and introducing yourself.", } ] diff --git a/examples/foundational/53-concurrent-llm-rtvi-ignored-sources.py b/examples/foundational/53-concurrent-llm-rtvi-ignored-sources.py index c7519dd7a..678c56a0b 100644 --- a/examples/foundational/53-concurrent-llm-rtvi-ignored-sources.py +++ b/examples/foundational/53-concurrent-llm-rtvi-ignored-sources.py @@ -158,7 +158,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): {"role": "developer", "content": "Please introduce yourself to the user."} ) evaluator_context.add_message( - {"role": "user", "content": "Ready to evaluate user messages."} + {"role": "developer", "content": "Ready to evaluate user messages."} ) await task.queue_frames([LLMRunFrame()]) diff --git a/examples/foundational/55zzg-update-settings-perplexity-llm.py b/examples/foundational/55zzg-update-settings-perplexity-llm.py index c495830dd..99a40c614 100644 --- a/examples/foundational/55zzg-update-settings-perplexity-llm.py +++ b/examples/foundational/55zzg-update-settings-perplexity-llm.py @@ -63,7 +63,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): messages = [ { - "role": "user", + "role": "developer", "content": "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. Start by introducing yourself.", }, ] diff --git a/examples/foundational/56-lemonslice-transport.py b/examples/foundational/56-lemonslice-transport.py index 667b317f8..3707ccab5 100644 --- a/examples/foundational/56-lemonslice-transport.py +++ b/examples/foundational/56-lemonslice-transport.py @@ -103,7 +103,7 @@ async def main(): # Kick off the conversation. context.add_message( { - "role": "user", + "role": "developer", "content": "Start by greeting the user and ask how you can help.", } )