Closed tcapelle closed 4 days ago
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=f1a7d7bc2d4f8f59423385562763157622dd9059
@tssweeney I need help with 2 things:
pydantic.v1.BaseModel
that we don't parse correctlyThe only thing that may need changing is how the patching is applied.
As you know @tssweeney the cohere Client modifies the chat function on the init, so we need to patch before creating a client. Two options for this:
weave.init
before creating the client (this is weird in general and wouldn't be how most of of the users do, but... it is all over our docs: anthropic, mistral, etc...)import cohere
import os
import weave
from weave.integrations.cohere import cohere_patcher
# we need to patch before we create the client
cohere_patcher.attempt_patch()
co = cohere.Client(api_key=os.environ["COHERE_API_KEY"])
weave.init("cohere_project")
one option could be:
# cohere.__init__.py
from weave.integrations.cohere.cohere_sdk import cohere_patcher as _cohere_patcher
def cohere_patcher():
_cohere_patcher.attempt_patch()
but feel free to change this import logic...
Cohere API integration with Weave