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

feat: CohereGenerator #6395

Merged
merged 32 commits into from
Nov 23, 2023
Merged

feat: CohereGenerator #6395

merged 32 commits into from
Nov 23, 2023

Conversation

ZanSara
Copy link
Contributor

@ZanSara ZanSara commented Nov 23, 2023

Related Issues

Note:

This PR is a workaround to my lack of access to @sunilkumardash9's original PR here: #6034 Please refer to the original PR.

sunilkumardash9 and others added 25 commits October 12, 2023 13:26
Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
2. removed commented files in test-cohere_generators
3. removed unused imports

Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
2. remove dict casting of metadata in run

Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
2. small change in doc string

Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
2. changed api key env var from CO_API_KEY to COHERE_API_KEY

Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
2. Added kwargs doc strings for CohereGenerator
3. removed type hints for metadata and replies
4. use COHERE_API_URL instead of hard coded URL.

Signed-off-by: sunilkumardash9 <sunilkumardash9@gmail.com>
Co-authored-by: Daria Fokina <daria.f93@gmail.com>
Co-authored-by: Daria Fokina <daria.f93@gmail.com>
Co-authored-by: Daria Fokina <daria.f93@gmail.com>
Co-authored-by: Daria Fokina <daria.f93@gmail.com>
Co-authored-by: Daria Fokina <daria.f93@gmail.com>
@github-actions github-actions bot added topic:tests topic:CI 2.x Related to Haystack v2.0 type:documentation Improvements on the docs labels Nov 23, 2023
@ZanSara ZanSara marked this pull request as ready for review November 23, 2023 11:26
@ZanSara ZanSara requested review from a team as code owners November 23, 2023 11:27
@ZanSara ZanSara requested review from dfokina and julian-risch and removed request for a team November 23, 2023 11:27
Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of smaller change requests, otherwise looks good to me

haystack/preview/components/generators/cohere.py Outdated Show resolved Hide resolved
haystack/preview/components/generators/cohere.py Outdated Show resolved Hide resolved
Copy link
Member

@julian-risch julian-risch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@vblagoje
Copy link
Member

Wow, didn't know about this @ZanSara and @julian-risch Great work @sunilkumardash9 Any chance you can add the Chat version, I think they also support it if I'm not mistaken.

@ZanSara
Copy link
Contributor Author

ZanSara commented Nov 23, 2023

@vblagoje in another PR please 🙏

@sunilkumardash9
Copy link
Contributor

@vblagoje Yes, I was initially working on the chat endpoint instead of the Generate. I can work on it.

@vblagoje
Copy link
Member

Yes, another PR @ZanSara @sunilkumardash9 chat would be a fantastic contribution. Try to match the format of TGI and OpenAI chat and non-chat generators as much as possible. We would like these to be completely interchangeable. When done, feel free to assign me for chat review!

@ZanSara ZanSara merged commit 4ec6a60 into deepset-ai:main Nov 23, 2023
21 checks passed
@ZanSara ZanSara deleted the fix-tests branch November 23, 2023 16:21
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:CI topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CohereGenerator
5 participants