File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121from sentry_sdk .scope import should_send_default_pii
2222from sentry_sdk .integrations import DidNotEnable , Integration
2323from sentry_sdk .utils import capture_internal_exceptions , event_from_exception , reraise
24+ from sentry_sdk .integrations .cohere_v2 import setup_v2
2425
2526try :
2627 from cohere .client import Client
@@ -79,9 +80,6 @@ def setup_once() -> None:
7980 BaseCohere .chat = _wrap_chat (BaseCohere .chat , streaming = False )
8081 Client .embed = _wrap_embed (Client .embed )
8182 BaseCohere .chat_stream = _wrap_chat (BaseCohere .chat_stream , streaming = True )
82-
83- from sentry_sdk .integrations .cohere_v2 import setup_v2
84-
8583 setup_v2 (_wrap_embed )
8684
8785
@@ -167,18 +165,9 @@ def new_chat(*args: "Any", **kwargs: "Any") -> "Any":
167165 if should_send_default_pii () and integration .include_prompts :
168166 messages = []
169167 for x in kwargs .get ("chat_history" , []):
170- < << << << HEAD
171168 messages .append (
172169 {
173170 "role" : getattr (x , "role" , "" ).lower (),
174- == == == =
175- role = getattr (x , "role" , "" ).lower ()
176- if role == "chatbot" :
177- role = "assistant"
178- messages .append (
179- {
180- "role" : role ,
181- >> >> >> > c51eeb90 (correct model )
182171 "content" : getattr (x , "message" , "" ),
183172 }
184173 )
You can’t perform that action at this time.
0 commit comments