Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46ae756

Browse files
committed
sync
1 parent f0001ff commit 46ae756

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/mcp/sse_example/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ async def run(mcp_server: MCPServer):
1515
name="Assistant",
1616
instructions="Use the tools to answer the questions.",
1717
mcp_servers=[mcp_server],
18-
model_settings=ModelSettings(tool_choice="required"),
18+
model="gpt-4o",
19+
model_settings=ModelSettings(tool_choice="auto", temperature=0.08, top_p=0.8),
1920
)
2021

2122
# Use the `add` tool to add two numbers
@@ -36,6 +37,11 @@ async def run(mcp_server: MCPServer):
3637
result = await Runner.run(starting_agent=agent, input=message)
3738
print(result.final_output)
3839

40+
message = "What's the capital of France?"
41+
print(f"\n\nRunning: {message}")
42+
result = await Runner.run(starting_agent=agent, input=message)
43+
print(result.final_output)
44+
3945

4046
async def main():
4147
async with MCPServerSse(

0 commit comments

Comments
 (0)