move connect debug prints

This commit is contained in:
2025-12-25 01:36:44 -08:00
parent 457e77603b
commit c300d8ceba
11 changed files with 2086 additions and 1 deletions

52
claude_dspy/trace.py Normal file
View File

@@ -0,0 +1,52 @@
from dataclasses import dataclass
from typing import Any
@dataclass
class TraceItem:
"""Base class for trace items."""
pass
@dataclass
class AgentMessageItem(TraceItem):
"""Agent's text response."""
text: str
model: str
@dataclass
class ThinkingItem(TraceItem):
"""Agent's internal reasoning (extended thinking)."""
text: str
model: str
@dataclass
class ToolUseItem(TraceItem):
"""Tool invocation request."""
tool_name: str
tool_input: dict[str, Any]
tool_use_id: str
@dataclass
class ToolResultItem(TraceItem):
"""Tool execution result."""
tool_name: str
tool_use_id: str
content: str | list[dict[str, Any]] | None = None
is_error: bool = False
@dataclass
class ErrorItem(TraceItem):
"""Error that occurred during execution."""
message: str
error_type: str | None = None