-
Notifications
You must be signed in to change notification settings - Fork 353
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
deepseek model adapter please enhance/extend #586
Comments
Hi @georgiedekker, Could you please provide a bit more context here? What is your goal / request here? |
Hi @sydney-runkle, |
I think we are open to changes/refactors to the OpenAIModel if they don't modify the behavior with OpenAI but make it more compatible with other models or make it easier to override in a useful way. Especially if the change you need is small or can be done in a way that is API-compatible with the actual OpenAI APIs, feel free to open a PR. If it's too big of a change, you can also create a python package containing the |
@dmontagu Thank you David. Honestly I have no idea how to create a python package. as you can see in the above code, this is the only change I had to make to make it work for my testing purposes. I just wanted to see how well deepseek v3 compared to other models like llama3.2. I haven't played around with the OpenAI model itself, or its API, so this might be completely in line with that API, or it might be a misinterpretation by the deepseek team. tldr, I noticed an error: Asked chatgpt: Analysis Tool Call Handling: Implemented this and it worked for me. Current openai model in latest pydantic-ai
adjusted version to account for the empty message when it finishes with "stop"
|
@georgiedekker based on the exchanges, it appears you are looking for the project to add support for a new model There are project guidelines on what the threshold is for new models to be added [1] To add a new model with an extra dependency, that dependency needs > 500k monthly downloads from PyPI consistently over 3 months or more and to add a new model which uses another models logic internally and has no extra dependencies, that model's GitHub org needs > 20k stars in total The new model [2] does not currently meet the threshold for the model to be included in the main package It appears, the remaining option is for you to release your own Python package pydantic-ai-xxx, which depends on pydantic-ai-slim and implements a model that inherits from the base model. You can take a look at [4] and [5] for how to create a python package for pydantic-ai-deepseek I hope this helps References |
Closed by #613 I think. |
based on a copy of the openai model in latest pydantic-ai version. imports based on a separate copy of pydantic-ai in my codebase/src folder. Mostly just had chatgpt rewrite the _process_response method to account for empty messages from Deepseek v3.
Works with Deepseek v3 in simple example:
Example pydantic-ai script:
deepseek model based on openai:
result:
The text was updated successfully, but these errors were encountered: