Skip to content

Pydantic AI #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: tool-packages
Choose a base branch
from
Draft

Pydantic AI #159

wants to merge 12 commits into from

Conversation

tcdent
Copy link
Collaborator

@tcdent tcdent commented Dec 21, 2024

Basic working prototype using the hello_alex template.

from typing import Any
import asyncio
import agentstack
from pydantic_ai import Agent


@agentstack.agent('alex')  # agent name is optional
def alex(**kwargs) -> Agent:
    return Agent(
        **kwargs, 
        tools=[*agentstack.tools['file_read']],
    )


@agentstack.task('hello_world')  # task name is optional
async def hello_world(**kwargs) -> Any:
    return await alex().run(**kwargs)


async def run():
    response = await hello_world()
    print(response.data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant