File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ def _common_set_input_data(
283283 span .set_data (SPANDATA .GEN_AI_OPERATION_NAME , "chat" )
284284 if (
285285 messages is not None
286- and len (messages ) > 0
286+ and len (messages ) > 0 # type: ignore
287287 and should_send_default_pii ()
288288 and integration .include_prompts
289289 ):
@@ -357,7 +357,7 @@ def _common_set_input_data(
357357 if top_p is not None and _is_given (top_p ):
358358 span .set_data (SPANDATA .GEN_AI_REQUEST_TOP_P , top_p )
359359
360- if tools is not None and _is_given (tools ) and len (tools ) > 0 :
360+ if tools is not None and _is_given (tools ) and len (tools ) > 0 : # type: ignore
361361 span .set_data (SPANDATA .GEN_AI_REQUEST_AVAILABLE_TOOLS , safe_serialize (tools ))
362362
363363
@@ -805,6 +805,9 @@ def _wrap_message_stream_manager_enter(f: "Any") -> "Any":
805805 @wraps (f )
806806 def _sentry_patched_enter (self ) -> "MessageStreamManager" :
807807 stream_manager = f (self )
808+ if not hasattr (self , "_max_tokens" ):
809+ return stream_manager
810+
808811 _sentry_patched_stream_common (
809812 stream_manager = stream_manager ,
810813 max_tokens = self ._max_tokens ,
You can’t perform that action at this time.
0 commit comments