AI-Engineer-Foundation / agent-protocol

Common interface for interacting with AI agents. The protocol is tech stack agnostic - you can use it with any framework for building agents.
https://agentprotocol.ai
MIT License
957 stars 116 forks source link

feat: add pydantic v2 compatibility #107

Closed Undertone0809 closed 5 months ago

Undertone0809 commented 6 months ago

Pull Request

Description

Add pydantic v2 compatibility, original agent-protocol can only use in pydantic v1.

Detail see https://docs.pydantic.dev/2.0/migration/#continue-using-pydantic-v1-features

Checklist

Please review and check the following items to ensure your pull request can be processed smoothly:

Additional Notes

This method is forked from langchain.

References, Fixes and Closes

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **agentprotocolai** | ⬜️ Ignored ([Inspect](https://vercel.com/ai-engineers-foundation/agentprotocolai/D16mJ21a5kqhYb1RSUAu4LZsgrMa)) | [Visit Preview](https://agentprotocolai-git-fork-underto-668e65-ai-engineers-foundation.vercel.app) | | Mar 20, 2024 3:59pm |
Undertone0809 commented 6 months ago

Hi @merwanehamadi , could you please review this PR? I would greatly appreciate your feedback. Thank you.

ntindle commented 6 months ago

What feature of v1 do we need that v2 doesn’t support?

Undertone0809 commented 6 months ago

I see the code. Current pydantic usage is compatible with both v1 and v2, it means this PR is unnecessary, but the problem is that poetry needs to be compatible with v2.

I create a new PR here #114