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

Add support for Cohere models #203

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rafidka
Copy link

@rafidka rafidka commented Dec 10, 2024

Adding support for Cohere models. Currently, only non-streaming chat is supported.

@rafidka
Copy link
Author

rafidka commented Dec 10, 2024

Hi Pydantic-AI Maintainers,

Cohere employee here. I really am excited about this new library from Pydantic, and I love to see Cohere models added as well. I published this WIP PR to help making this happen. It currently only supports non-streaming chat, but if I get initial blessing on your willingness to add Cohere and the direction I am going on in this direction, then I am happy to update the PR and add streaming support. Looking forward to hearing from you!

Thanks,
Rafid

@rafidka rafidka force-pushed the feat/support-cohere branch from 2e49958 to 28143f3 Compare December 10, 2024 16:08
@samuelcolvin
Copy link
Member

Hi @rafidka, thanks so much for the contribution and sorry for the slow reply. As per #239 we'd definitely be happy to add support for Cohere!

Note: we've made a few changes to internal APIs since you started this PR, let us know if you have any questions or need any help, you can always join our slack if you want more immediate help.

@rafidka
Copy link
Author

rafidka commented Dec 14, 2024

@samuelcolvin , thank you, great to hear you are willing to integrate Cohere with your library <3

BTW, we announced another model yesterday, which is "provides state-of-the-art performance in its class of open-weights models".

@rafidka rafidka force-pushed the feat/support-cohere branch from 28143f3 to d763c28 Compare December 14, 2024 22:18
@rafidka
Copy link
Author

rafidka commented Dec 14, 2024

Note: we've made a few changes to internal APIs since you started this PR, let us know if you have any questions or need any help, you can always join our slack if you want more immediate help.

I updated my PR to work with the new changes.

Question: would you want to have streaming support as well in the same PR, or you are ok breaking this down into two PRs?

@corafid
Copy link

corafid commented Dec 20, 2024

Any update on this?

@samuelcolvin
Copy link
Member

Question: would you want to have streaming support as well in the same PR, or you are ok breaking this down into two PRs?

I'm happy for streaming to come in a follow up pr.

@rafidka
Copy link
Author

rafidka commented Dec 21, 2024

I'm happy for streaming to come in a follow up pr.

Great! I will rebase the PR again then and hopefully can get it merged so I do the streaming next.

@rafidka rafidka force-pushed the feat/support-cohere branch from d763c28 to 8defdbb Compare December 25, 2024 20:20
@rafidka rafidka changed the title [WIP] Early support for Cohere models Early support for Cohere models Dec 25, 2024
Added support for Cohere models by introducing the `models/cohere.py`
file. Currently, the support is limited to non-streaming, but streaming
support is planned soon.
@rafidka rafidka force-pushed the feat/support-cohere branch from 8defdbb to dfb7326 Compare December 25, 2024 20:22
@rafidka
Copy link
Author

rafidka commented Dec 25, 2024

@samuelcolvin , I rebased the PR and made the necessary changes based on your recent changes. I would like to get this merged soon if possible, to avoid having to rebase again since this is a quickly evolving code base (I had to refactor the code 2-3 times so far.) Thank you!

@rafidka rafidka changed the title Early support for Cohere models Add support for Cohere models Dec 27, 2024
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.

3 participants