Skip to content

Commit 5ce4a58

Browse files
committed
Fix system message format in custom agent example
1 parent 76eb300 commit 5ce4a58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/05_custom_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ def __init__(
6060
api_key=settings.api_key,
6161
)
6262

63-
async def get_system_messages(self) -> list[types.ContentBlock]:
64-
"""Return system prompt as content blocks."""
63+
async def get_system_messages(self) -> list[dict[str, Any]]:
64+
"""Return system prompt formatted for OpenAI chat API."""
6565
system_text = self.system_prompt or "You are a helpful assistant."
66-
return [types.TextContent(type="text", text=system_text)]
66+
return [{"role": "system", "content": system_text}]
6767

6868
def get_tool_schemas(self) -> list[dict[str, Any]]:
6969
"""Convert MCP tools to OpenAI function format."""

0 commit comments

Comments
 (0)