File tree Expand file tree Collapse file tree
tests/integrations/openai Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 Union ,
4040 )
4141 from sentry_sdk .tracing import Span
42+ from sentry_sdk ._types import TextPart
4243
4344 from openai .types .responses import ResponseInputParam , ResponseInputItemParam
4445 from openai import Omit
@@ -289,16 +290,17 @@ def _set_responses_api_input_data(
289290 and should_send_default_pii ()
290291 and integration .include_prompts
291292 ):
292- # Deliberate use of function accepting completions API type because
293- # of shared structure FOR THIS PURPOSE ONLY.
294- instructions_text_parts = _transform_system_instructions (system_instructions )
293+ instructions_text_parts : "list[TextPart]" = []
295294 if explicit_instructions is not None and _is_given (explicit_instructions ):
296295 instructions_text_parts .append (
297296 {
298297 "type" : "text" ,
299- "content" : explicit_instructions , # type: ignore
298+ "content" : explicit_instructions ,
300299 }
301300 )
301+ # Deliberate use of function accepting completions API type because
302+ # of shared structure FOR THIS PURPOSE ONLY.
303+ instructions_text_parts += _transform_system_instructions (system_instructions )
302304
303305 set_data_normalized (
304306 span ,
You can’t perform that action at this time.
0 commit comments