Skip to content
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

Dynamic agent creation (i.e. persisting system_prompt, result_type, etc in DB) #973

Open
seunggs opened this issue Feb 23, 2025 · 0 comments

Comments

@seunggs
Copy link

seunggs commented Feb 23, 2025

I have a use case where the users are able to create a custom agent with desired system_prompt, result_type, etc which get stored in a relational database (Postgres in my case). During the chat with the agent, the frontend just sends the agent_id and the backend grabs the rest of the information from the DB to instantiate a Pydantic AI Agent.

But I learned that Pydantic models cannot be easily serialized to JSON to be persisted in DB. What is the recommended strategy here to enable my dynamic agent creation use case?

Any guidance is appreciated!

@seunggs seunggs changed the title Dynamic agent creation (i.e. storing system_prompt, result_type, etc in DB) Dynamic agent creation (i.e. persisting system_prompt, result_type, etc in DB) Feb 23, 2025
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

No branches or pull requests

1 participant