langroid 0.43.0__py3-none-any.whl → 0.43.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/chat_agent.py +16 -2
- {langroid-0.43.0.dist-info → langroid-0.43.1.dist-info}/METADATA +1 -1
- {langroid-0.43.0.dist-info → langroid-0.43.1.dist-info}/RECORD +5 -5
- {langroid-0.43.0.dist-info → langroid-0.43.1.dist-info}/WHEEL +0 -0
- {langroid-0.43.0.dist-info → langroid-0.43.1.dist-info}/licenses/LICENSE +0 -0
langroid/agent/chat_agent.py
CHANGED
@@ -1069,6 +1069,13 @@ class ChatAgent(Agent):
|
|
1069
1069
|
was enabled, disables it for the tool, else triggers strict recovery.
|
1070
1070
|
"""
|
1071
1071
|
self.tool_error = False
|
1072
|
+
most_recent_sent_by_llm = (
|
1073
|
+
len(self.message_history) > 0
|
1074
|
+
and self.message_history[-1].role == Role.ASSISTANT
|
1075
|
+
)
|
1076
|
+
was_llm = most_recent_sent_by_llm or (
|
1077
|
+
isinstance(msg, ChatDocument) and msg.metadata.sender == Entity.LLM
|
1078
|
+
)
|
1072
1079
|
try:
|
1073
1080
|
tools = super().get_tool_messages(msg, all_tools)
|
1074
1081
|
except ValidationError as ve:
|
@@ -1099,9 +1106,16 @@ class ChatAgent(Agent):
|
|
1099
1106
|
if isinstance(msg, ChatDocument):
|
1100
1107
|
self.tool_error = msg.metadata.sender == Entity.LLM
|
1101
1108
|
else:
|
1102
|
-
self.tool_error =
|
1109
|
+
self.tool_error = most_recent_sent_by_llm
|
1103
1110
|
|
1104
|
-
|
1111
|
+
if was_llm:
|
1112
|
+
raise ve
|
1113
|
+
else:
|
1114
|
+
self.tool_error = False
|
1115
|
+
return []
|
1116
|
+
|
1117
|
+
if not was_llm:
|
1118
|
+
self.tool_error = False
|
1105
1119
|
|
1106
1120
|
return tools
|
1107
1121
|
|
@@ -5,7 +5,7 @@ langroid/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
langroid/agent/__init__.py,sha256=ll0Cubd2DZ-fsCMl7e10hf9ZjFGKzphfBco396IKITY,786
|
6
6
|
langroid/agent/base.py,sha256=0szJ5ZxNSmobFO5805ur2cqKfD6vUP4ooN76Z5qAeyw,78677
|
7
7
|
langroid/agent/batch.py,sha256=vi1r5i1-vN80WfqHDSwjEym_KfGsqPGUtwktmiK1nuk,20635
|
8
|
-
langroid/agent/chat_agent.py,sha256=
|
8
|
+
langroid/agent/chat_agent.py,sha256=be7GlySBCuZ4jGQzk0FdVKlqhGeAuewfDywmHDACjh8,84924
|
9
9
|
langroid/agent/chat_document.py,sha256=xzMtrPbaW-Y-BnF7kuhr2dorsD-D5rMWzfOqJ8HAoo8,17885
|
10
10
|
langroid/agent/openai_assistant.py,sha256=JkAcs02bIrgPNVvUWVR06VCthc5-ulla2QMBzux_q6o,34340
|
11
11
|
langroid/agent/task.py,sha256=HB6N-Jn80HFqCf0ZYOC1v3Bn3oO7NLjShHQJJFwW0q4,90557
|
@@ -127,7 +127,7 @@ langroid/vector_store/pineconedb.py,sha256=otxXZNaBKb9f_H75HTaU3lMHiaR2NUp5MqwLZ
|
|
127
127
|
langroid/vector_store/postgres.py,sha256=DQHd6dt-OcV_QVNm-ymn28rlTfhI6hqgcpLTPCsm0jI,15990
|
128
128
|
langroid/vector_store/qdrantdb.py,sha256=v7TAsIoj_vxeKDYS9tpwJLBZA8fuTweTYxHo0X_uawM,17949
|
129
129
|
langroid/vector_store/weaviatedb.py,sha256=tjlqEtkwrhykelt-nbr2WIuHWJBuSAGjZuG6gsAMBsc,11753
|
130
|
-
langroid-0.43.
|
131
|
-
langroid-0.43.
|
132
|
-
langroid-0.43.
|
133
|
-
langroid-0.43.
|
130
|
+
langroid-0.43.1.dist-info/METADATA,sha256=AQaUq3J9kszROM1HO3-8s9us3eGpSt9yJy7SI8eznkU,61773
|
131
|
+
langroid-0.43.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
132
|
+
langroid-0.43.1.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
133
|
+
langroid-0.43.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|