MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / do_ai

Function do_ai

examples/mcpserver/memory.py:53–65  ·  view source on GitHub ↗
(
    user_prompt: str,
    system_prompt: str,
    result_type: type[T] | Annotated,
    deps=None,
)

Source from the content-addressed store, hash-verified

51
52
53async def do_ai(
54 user_prompt: str,
55 system_prompt: str,
56 result_type: type[T] | Annotated,
57 deps=None,
58) -> T:
59 agent = Agent(
60 DEFAULT_LLM_MODEL,
61 system_prompt=system_prompt,
62 result_type=result_type,
63 )
64 result = await agent.run(user_prompt, deps=deps)
65 return result.data
66
67
68@dataclass

Callers 1

merge_withMethod · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected