Skip to content

Commit 76112fe

Browse files
move _transform_system_instructions up
1 parent 7dec8c9 commit 76112fe

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎sentry_sdk/integrations/boto3/_services/bedrock.py‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,19 @@ def sentry_patched_close(self: "EventStream[Any]") -> None:
147147
EventStream.close = sentry_patched_close # type: ignore[method-assign]
148148

149149

150+
def _transform_system_instructions(
151+
system_instructions: "Union[list[dict[str, Any]], tuple[dict[str, Any], ...]]",
152+
) -> "list[TextPart]":
153+
instruction_text_parts: "list[TextPart]" = []
154+
for block in system_instructions:
155+
if not isinstance(block, dict) or "text" not in block:
156+
continue
157+
158+
instruction_text_parts.append({"type": "text", "content": block["text"]})
159+
160+
return instruction_text_parts
161+
162+
150163
def _transform_tool_definitions(
151164
tools: "list[dict[str, Any]]",
152165
) -> "list[ToolDefinition]":
@@ -189,19 +202,6 @@ def _transform_tool_definitions(
189202
return result
190203

191204

192-
def _transform_system_instructions(
193-
system_instructions: "Union[list[dict[str, Any]], tuple[dict[str, Any], ...]]",
194-
) -> "list[TextPart]":
195-
instruction_text_parts: "list[TextPart]" = []
196-
for block in system_instructions:
197-
if not isinstance(block, dict) or "text" not in block:
198-
continue
199-
200-
instruction_text_parts.append({"type": "text", "content": block["text"]})
201-
202-
return instruction_text_parts
203-
204-
205205
class _BedrockExtension(_ServiceExtension):
206206
__slots__ = ()
207207
skip_if_no_active_span = False

0 commit comments

Comments
 (0)