748 B
748 B
-
Wired up
system_instructioninBaseOpenAILLMService,AnthropicLLMService, andAWSBedrockLLMServiceso it works as a default system prompt, matching the behavior of the Google services. This enables sharing a singleLLMContextacross multiple LLM services, where each service provides its own system instruction independently.llm = OpenAILLMService( api_key=os.getenv("OPENAI_API_KEY"), system_instruction="You are a helpful assistant.", ) context = LLMContext() @transport.event_handler("on_client_connected") async def on_client_connected(transport, client): context.add_message({"role": "user", "content": "Please introduce yourself."}) await task.queue_frames([LLMRunFrame()])