Skip to content

Commit

Permalink
update cohere client v2 chat
Browse files Browse the repository at this point in the history
  • Loading branch information
ayulockin committed Aug 20, 2024
1 parent 4e78195 commit bbbfd92
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions weave/integrations/cohere/cohere_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,17 @@ def wrapper(fn: typing.Callable) -> typing.Callable:
"AsyncClient.chat_stream",
cohere_stream_wrapper("cohere.AsyncClient.chat_stream"),
),
# Add patch for cohere v2
SymbolPatcher(
lambda: importlib.import_module("cohere"),
"ClientV2.chat",
cohere_wrapper("cohere.ClientV2.chat"),
),
# Add patch for cohre v2 async chat method
SymbolPatcher(
lambda: importlib.import_module("cohere"),
"AsyncClientV2.chat",
cohere_wrapper("cohere.AsyncClientV2.chat"),
),
]
)

0 comments on commit bbbfd92

Please sign in to comment.