set_user_prompt
set_user_prompt
Inject a user message when entering this context. Useful for triggering the AI to speak first after a context switch.
Parameters
user_prompt
User message to inject.
Returns
Context — Self for method chaining.
set_user_prompt
Inject a user message when entering this context. Useful for triggering the AI to speak first after a context switch.
User message to inject.
Context — Self for method chaining.
1 from signalwire import AgentBase 2 3 agent = AgentBase(name="my-agent", route="/agent") 4 5 contexts = agent.define_contexts() 6 sales = contexts.add_context("default") 7 sales.set_user_prompt("I'd like to learn about your products.") 8 sales.add_step("pitch").set_text("Present our product lineup to the caller.") 9 10 agent.serve()