mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
refactor(backend/copilot): move SDK imports to top-level
Move TextBlock, ThinkingBlock, ToolResultBlock imports from inside _format_sdk_content_blocks to top-level, following code style guidelines (prefer top-level imports over function-local imports).
This commit is contained in:
@@ -20,6 +20,9 @@ from claude_agent_sdk import (
|
||||
ClaudeAgentOptions,
|
||||
ClaudeSDKClient,
|
||||
ResultMessage,
|
||||
TextBlock,
|
||||
ThinkingBlock,
|
||||
ToolResultBlock,
|
||||
ToolUseBlock,
|
||||
)
|
||||
from langfuse import propagate_attributes
|
||||
@@ -442,8 +445,6 @@ def _format_sdk_content_blocks(blocks: list) -> list[dict[str, Any]]:
|
||||
|
||||
Handles TextBlock, ToolUseBlock, ToolResultBlock, and ThinkingBlock.
|
||||
"""
|
||||
from claude_agent_sdk import TextBlock, ThinkingBlock, ToolResultBlock
|
||||
|
||||
result: list[dict[str, Any]] = []
|
||||
for block in blocks or []:
|
||||
if isinstance(block, TextBlock):
|
||||
|
||||
Reference in New Issue
Block a user