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

Support for cohere 5.0.0+ #38349

Open
1 task done
Taragolis opened this issue Mar 20, 2024 · 1 comment
Open
1 task done

Support for cohere 5.0.0+ #38349

Taragolis opened this issue Mar 20, 2024 · 1 comment
Assignees
Labels
area:providers good first issue kind:meta High-level information important to the community provider:cohere

Comments

@Taragolis
Copy link
Contributor

Body

Cohere v5.0.0 just released and seems like it might not work out of the box with Cohere Provider

airflow/providers/cohere/hooks/cohere.py:58: error: Unexpected keyword argument
"max_retries" for "Client"  [call-arg]
            return cohere.Client(
                   ^
/usr/local/lib/python3.8/site-packages/cohere/client.py:60: note: "Client" defined here
airflow/providers/cohere/hooks/cohere.py:58: error: Unexpected keyword argument
"api_url" for "Client"  [call-arg]
            return cohere.Client(
                   ^
/usr/local/lib/python3.8/site-packages/cohere/client.py:60: note: "Client" defined here
airflow/providers/cohere/hooks/cohere.py:56: error: Signature of "get_conn"
incompatible with supertype "BaseHook"  [override]
        def get_conn(self) -> cohere.Client:
        ^
airflow/providers/cohere/hooks/cohere.py:56: note:      Superclass:
airflow/providers/cohere/hooks/cohere.py:56: note:          def get_conn(self) -> Any
airflow/providers/cohere/hooks/cohere.py:56: note:      Subclass:
airflow/providers/cohere/hooks/cohere.py:56: note:          Client
airflow/providers/cohere/hooks/cohere.py:67: error: Incompatible return value
type (got "Union[List[List[float]], EmbedByTypeResponseEmbeddings]", expected
"List[List[float]]")  [return-value]
            return embeddings
                   ^~~~~~~~~~
airflow/providers/cohere/hooks/cohere.py:80: error: Too many positional
arguments for "generate" of "BaseCohere"  [misc]
                self.get_conn.generate("Test", max_tokens=10)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We need eventually add support for v5, Migration Guide

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@Taragolis Taragolis added area:providers good first issue kind:meta High-level information important to the community provider:cohere labels Mar 20, 2024
@Taragolis Taragolis changed the title Support cohere to 5+ Support for cohere 5.0.0+ Mar 20, 2024
@okirialbert
Copy link
Contributor

Hi @Taragolis I'd like to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers good first issue kind:meta High-level information important to the community provider:cohere
Projects
None yet
Development

No branches or pull requests

2 participants