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

CohereGenerator #5984

Closed
Tracked by #5330
anakin87 opened this issue Oct 6, 2023 · 5 comments · Fixed by #6395
Closed
Tracked by #5330

CohereGenerator #5984

anakin87 opened this issue Oct 6, 2023 · 5 comments · Fixed by #6395
Labels
2.x Related to Haystack v2.0 topic:LLM

Comments

@anakin87
Copy link
Member

anakin87 commented Oct 6, 2023

Develop a Generator that uses Cohere models, similar to GPTGenerator.

(@bilgeyucel please add details if you want).

@anakin87 anakin87 added 2.x Related to Haystack v2.0 topic:LLM hacktoberfest labels Oct 6, 2023
@sunilkumardash9
Copy link
Contributor

Hi @anakin87, I can give it a shot. Do I need to be assigned, or should I go for a PR?

@anakin87
Copy link
Member Author

anakin87 commented Oct 9, 2023

Hey, @sunilkumardash9!

Feel free to open a PR...

  • You can take GPTGenerator as a similar example.
  • Be sure to lazy import the Cohere SDK. Something similar to this:
with LazyImport(message="Run 'pip install cohere'") as cohere_import:
    from cohere import Client

@Timoeller Timoeller added this to the 2.0-beta milestone Oct 9, 2023
@sunilkumardash9
Copy link
Contributor

sunilkumardash9 commented Oct 10, 2023

@anakin I was wondering which cohere endpoint we should go with, Chat or Generate. And what should we return as metadata? If we go with the Chat endpoint, Should we add citations and documents as metadata?
https://docs.cohere.com/reference/chat

@anakin87
Copy link
Member Author

I'm not an expert on Cohere models.
@bilgeyucel feel free to add your observations...

@bilgeyucel
Copy link
Contributor

@sunilkumardash9 we should use the /generate endpoint for CohereGenerator.
As the metadata, you can return the meta object that Cohere returns in the response. It would have been nice if we could provide token information but as far as I can understand, Cohere doesn't provide this information through /generate endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:LLM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants