Enabling the option to cancel the tools for all the async examples.
This commit is contained in:
@@ -77,6 +77,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
|
|
||||||
llm = AnthropicLLMService(
|
llm = AnthropicLLMService(
|
||||||
api_key=os.getenv("ANTHROPIC_API_KEY"),
|
api_key=os.getenv("ANTHROPIC_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=AnthropicLLMService.Settings(
|
settings=AnthropicLLMService.Settings(
|
||||||
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.",
|
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.",
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
|
|
||||||
llm = GoogleLLMService(
|
llm = GoogleLLMService(
|
||||||
api_key=os.getenv("GOOGLE_API_KEY"),
|
api_key=os.getenv("GOOGLE_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=GoogleLLMService.Settings(
|
settings=GoogleLLMService.Settings(
|
||||||
system_instruction=(
|
system_instruction=(
|
||||||
"You are a helpful assistant in a voice conversation. "
|
"You are a helpful assistant in a voice conversation. "
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ indicate you should use the get_image tool are:
|
|||||||
|
|
||||||
llm = GoogleLLMService(
|
llm = GoogleLLMService(
|
||||||
api_key=os.getenv("GOOGLE_API_KEY"),
|
api_key=os.getenv("GOOGLE_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=GoogleLLMService.Settings(
|
settings=GoogleLLMService.Settings(
|
||||||
system_instruction=system_prompt,
|
system_instruction=system_prompt,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
|
|
||||||
llm = OpenAILLMService(
|
llm = OpenAILLMService(
|
||||||
api_key=os.getenv("OPENAI_API_KEY"),
|
api_key=os.getenv("OPENAI_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=OpenAILLMService.Settings(
|
settings=OpenAILLMService.Settings(
|
||||||
system_instruction=(
|
system_instruction=(
|
||||||
"You are a helpful assistant in a voice conversation. "
|
"You are a helpful assistant in a voice conversation. "
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
|
|
||||||
llm = OpenAILLMService(
|
llm = OpenAILLMService(
|
||||||
api_key=os.getenv("OPENAI_API_KEY"),
|
api_key=os.getenv("OPENAI_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=OpenAILLMService.Settings(
|
settings=OpenAILLMService.Settings(
|
||||||
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.",
|
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.",
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
|
|
||||||
llm = OpenAIResponsesLLMService(
|
llm = OpenAIResponsesLLMService(
|
||||||
api_key=os.getenv("OPENAI_API_KEY"),
|
api_key=os.getenv("OPENAI_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=OpenAIResponsesLLMService.Settings(
|
settings=OpenAIResponsesLLMService.Settings(
|
||||||
system_instruction=(
|
system_instruction=(
|
||||||
"You are a helpful assistant in a voice conversation. "
|
"You are a helpful assistant in a voice conversation. "
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
|||||||
|
|
||||||
llm = OpenAIResponsesLLMService(
|
llm = OpenAIResponsesLLMService(
|
||||||
api_key=os.getenv("OPENAI_API_KEY"),
|
api_key=os.getenv("OPENAI_API_KEY"),
|
||||||
|
enable_async_tool_cancellation=True,
|
||||||
settings=OpenAIResponsesLLMService.Settings(
|
settings=OpenAIResponsesLLMService.Settings(
|
||||||
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.",
|
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.",
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user