Skip to content

Commit 5bb67dd

Browse files
committed
Fix TResponseInputItem
1 parent 1f9d8a3 commit 5bb67dd

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

coagent/agents/react_agent/types.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,29 @@
1818
TResponse = Response
1919
"""A type alias for the Response type from the OpenAI SDK."""
2020

21-
TResponseInputItem = ResponseInputItemParam
21+
22+
class FunctionToolCallProgressItem(BaseModel):
23+
call_id: str
24+
"""The unique ID of the function tool call generated by the model."""
25+
26+
progress: float = 0
27+
"""The current progress value of the function call. (e.g. 24)"""
28+
29+
total: float = 0
30+
"""The total value of the function call. (e.g. 100)"""
31+
32+
message: str = ""
33+
"""The human readable progress information. (e.g. Starting render...)"""
34+
35+
type: Literal["function_call_progress"]
36+
"""The type of the function tool call progress. Always `function_call_progress`."""
37+
38+
39+
TResponseInputItem: TypeAlias = Union[
40+
ResponseInputItemParam,
41+
ResponseFunctionToolCallOutputItem,
42+
FunctionToolCallProgressItem,
43+
]
2244
"""A type alias for the ResponseInputItemParam type from the OpenAI SDK."""
2345

2446
TResponseOutputItem = ResponseOutputItem
@@ -50,27 +72,6 @@ class FunctionTool:
5072
"""A type alias for the FunctionTool class."""
5173

5274

53-
class FunctionToolCallProgressItem(BaseModel):
54-
call_id: str
55-
"""The unique ID of the function tool call generated by the model."""
56-
57-
progress: float = 0
58-
"""
59-
The current progress value of the function call. (e.g. 24)
60-
total: Optional total value e.g. 100
61-
message: Optional message e.g. Starting render...A float between 0 and 1, where 0 means the function
62-
"""
63-
64-
total: float = 0
65-
"""The total value of the function call. (e.g. 100)"""
66-
67-
message: str = ""
68-
"""The human readable progress information. (e.g. Starting render...)"""
69-
70-
type: Literal["function_call_progress"]
71-
"""The type of the function tool call progress. Always `function_call_progress`."""
72-
73-
7475
@dataclass
7576
class MessageOutputItem:
7677
"""Represents a message from the LLM."""

0 commit comments

Comments
 (0)