langroid 0.56.0__py3-none-any.whl → 0.56.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langroid/agent/tools/task_tool.py +28 -3
- {langroid-0.56.0.dist-info → langroid-0.56.1.dist-info}/METADATA +1 -1
- {langroid-0.56.0.dist-info → langroid-0.56.1.dist-info}/RECORD +5 -5
- {langroid-0.56.0.dist-info → langroid-0.56.1.dist-info}/WHEEL +0 -0
- {langroid-0.56.0.dist-info → langroid-0.56.1.dist-info}/licenses/LICENSE +0 -0
@@ -88,10 +88,9 @@ class TaskTool(ToolMessage):
|
|
88
88
|
description="Optional max iterations for the sub-agent to run the task",
|
89
89
|
)
|
90
90
|
|
91
|
-
def
|
91
|
+
def _set_up_task(self, agent: ChatAgent) -> Task:
|
92
92
|
"""
|
93
|
-
|
94
|
-
and running the task non-interactively.
|
93
|
+
Helper method to set up a task for the sub-agent.
|
95
94
|
|
96
95
|
Args:
|
97
96
|
agent: The parent ChatAgent that is handling this tool
|
@@ -144,6 +143,32 @@ class TaskTool(ToolMessage):
|
|
144
143
|
# Create a non-interactive task
|
145
144
|
task = Task(sub_agent, interactive=False)
|
146
145
|
|
146
|
+
return task
|
147
|
+
|
148
|
+
def handle(self, agent: ChatAgent) -> Optional[ChatDocument]:
|
149
|
+
"""
|
150
|
+
|
151
|
+
Handle the TaskTool by creating a sub-agent with specified tools
|
152
|
+
and running the task non-interactively.
|
153
|
+
|
154
|
+
Args:
|
155
|
+
agent: The parent ChatAgent that is handling this tool
|
156
|
+
"""
|
157
|
+
|
158
|
+
task = self._set_up_task(agent)
|
147
159
|
# Run the task on the prompt, and return the result
|
148
160
|
result = task.run(self.prompt, turns=self.max_iterations or 10)
|
149
161
|
return result
|
162
|
+
|
163
|
+
async def handle_async(self, agent: ChatAgent) -> Optional[ChatDocument]:
|
164
|
+
"""
|
165
|
+
Async method to handle the TaskTool by creating a sub-agent with specified tools
|
166
|
+
and running the task non-interactively.
|
167
|
+
|
168
|
+
Args:
|
169
|
+
agent: The parent ChatAgent that is handling this tool
|
170
|
+
"""
|
171
|
+
task = self._set_up_task(agent)
|
172
|
+
# Run the task on the prompt, and return the result
|
173
|
+
result = await task.run_async(self.prompt, turns=self.max_iterations or 10)
|
174
|
+
return result
|
@@ -54,7 +54,7 @@ langroid/agent/tools/recipient_tool.py,sha256=dr0yTxgNEIoxUYxH6TtaExC4G_8WdJ0xGo
|
|
54
54
|
langroid/agent/tools/retrieval_tool.py,sha256=zcAV20PP_6VzSd-UE-IJcabaBseFL_QNz59Bnig8-lE,946
|
55
55
|
langroid/agent/tools/rewind_tool.py,sha256=XAXL3BpNhCmBGYq_qi_sZfHJuIw7NY2jp4wnojJ7WRs,5606
|
56
56
|
langroid/agent/tools/segment_extract_tool.py,sha256=__srZ_VGYLVOdPrITUM8S0HpmX4q7r5FHWMDdHdEv8w,1440
|
57
|
-
langroid/agent/tools/task_tool.py,sha256=
|
57
|
+
langroid/agent/tools/task_tool.py,sha256=O-3-tALocGuwfxXikBzRWFenFKZWIlOoRVvnZ5mf7io,6514
|
58
58
|
langroid/agent/tools/tavily_search_tool.py,sha256=soI-j0HdgVQLf09wRQScaEK4b5RpAX9C4cwOivRFWWI,1903
|
59
59
|
langroid/agent/tools/mcp/__init__.py,sha256=DJNM0VeFnFS3pJKCyFGggT8JVjVu0rBzrGzasT1HaSM,387
|
60
60
|
langroid/agent/tools/mcp/decorators.py,sha256=h7dterhsmvWJ8q4mp_OopmuG2DF71ty8cZwOyzdDZuk,1127
|
@@ -137,7 +137,7 @@ langroid/vector_store/pineconedb.py,sha256=otxXZNaBKb9f_H75HTaU3lMHiaR2NUp5MqwLZ
|
|
137
137
|
langroid/vector_store/postgres.py,sha256=wHPtIi2qM4fhO4pMQr95pz1ZCe7dTb2hxl4VYspGZoA,16104
|
138
138
|
langroid/vector_store/qdrantdb.py,sha256=O6dSBoDZ0jzfeVBd7LLvsXu083xs2fxXtPa9gGX3JX4,18443
|
139
139
|
langroid/vector_store/weaviatedb.py,sha256=Yn8pg139gOy3zkaPfoTbMXEEBCiLiYa1MU5d_3UA1K4,11847
|
140
|
-
langroid-0.56.
|
141
|
-
langroid-0.56.
|
142
|
-
langroid-0.56.
|
143
|
-
langroid-0.56.
|
140
|
+
langroid-0.56.1.dist-info/METADATA,sha256=Yz9pHxVllXS-Sihx0AqWVjuXom9AjDbc_2DsU0wCgks,65366
|
141
|
+
langroid-0.56.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
142
|
+
langroid-0.56.1.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
143
|
+
langroid-0.56.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|