Function
do_ai
(
user_prompt: str,
system_prompt: str,
result_type: type[T] | Annotated,
deps=None,
)
Source from the content-addressed store, hash-verified
| 51 | |
| 52 | |
| 53 | async 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 |
Tested by
no test coverage detected