langroid 0.37.4__py3-none-any.whl → 0.37.5__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 +1 -1
- langroid/agent/special/sql/sql_chat_agent.py +2 -10
- langroid/language_models/openai_gpt.py +6 -1
- {langroid-0.37.4.dist-info → langroid-0.37.5.dist-info}/METADATA +1 -1
- {langroid-0.37.4.dist-info → langroid-0.37.5.dist-info}/RECORD +7 -7
- {langroid-0.37.4.dist-info → langroid-0.37.5.dist-info}/WHEEL +0 -0
- {langroid-0.37.4.dist-info → langroid-0.37.5.dist-info}/licenses/LICENSE +0 -0
langroid/agent/chat_agent.py
CHANGED
@@ -1023,7 +1023,7 @@ class ChatAgent(Agent):
|
|
1023
1023
|
all_tools: bool = False,
|
1024
1024
|
) -> List[ToolMessage]:
|
1025
1025
|
"""
|
1026
|
-
Extracts messages and tracks whether any errors
|
1026
|
+
Extracts messages and tracks whether any errors occurred. If strict mode
|
1027
1027
|
was enabled, disables it for the tool, else triggers strict recovery.
|
1028
1028
|
"""
|
1029
1029
|
self.tool_error = False
|
@@ -427,15 +427,7 @@ class SQLChatAgent(ChatAgent):
|
|
427
427
|
return error_message_template
|
428
428
|
|
429
429
|
def _available_tool_names(self) -> str:
|
430
|
-
return ",".join(
|
431
|
-
tool.name() # type: ignore
|
432
|
-
for tool in [
|
433
|
-
RunQueryTool,
|
434
|
-
GetTableNamesTool,
|
435
|
-
GetTableSchemaTool,
|
436
|
-
GetColumnDescriptionsTool,
|
437
|
-
]
|
438
|
-
)
|
430
|
+
return ",".join(self.llm_tools_usable)
|
439
431
|
|
440
432
|
def _tool_result_llm_answer_prompt(self) -> str:
|
441
433
|
"""
|
@@ -510,7 +502,7 @@ class SQLChatAgent(ChatAgent):
|
|
510
502
|
{self._tool_result_llm_answer_prompt()}
|
511
503
|
OTHERWISE:
|
512
504
|
continue using one of your available TOOLs:
|
513
|
-
{self.
|
505
|
+
{",".join(self.llm_tools_usable)}
|
514
506
|
"""
|
515
507
|
return final_message
|
516
508
|
|
@@ -1897,7 +1897,12 @@ class OpenAIGPT(LanguageModel):
|
|
1897
1897
|
}
|
1898
1898
|
}
|
1899
1899
|
"""
|
1900
|
-
|
1900
|
+
if response.get("choices") is None:
|
1901
|
+
message = {}
|
1902
|
+
else:
|
1903
|
+
message = response["choices"][0].get("message", {})
|
1904
|
+
if message is None:
|
1905
|
+
message = {}
|
1901
1906
|
msg = message.get("content", "")
|
1902
1907
|
reasoning = message.get("reasoning_content", "")
|
1903
1908
|
|
@@ -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=oThlrYygKDu1-bKjAfygldJ511gMKT8Z0qCrD52DdDM,77834
|
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=_7vOhTauPpPiOih2hnec8hz0rytaxGN110ja9wRCLJ0,82276
|
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=XrXUbSoiFasvpIsZPn_cBpdWaTCKljJPRimtLMrSZrs,90347
|
@@ -35,7 +35,7 @@ langroid/agent/special/neo4j/neo4j_chat_agent.py,sha256=1RMKupJra0KZ-hA7AiiR662S
|
|
35
35
|
langroid/agent/special/neo4j/system_messages.py,sha256=m2jsVayey6E_88F5B_gW2WbWKBJvIeDUoVCRBbNs97o,4522
|
36
36
|
langroid/agent/special/neo4j/tools.py,sha256=Vw3HvtDfG2c4_bUHgt4_ZbJq48lpIQstbjjwhh1BjrQ,905
|
37
37
|
langroid/agent/special/sql/__init__.py,sha256=mWfmm1QpXCezpFOS2eI57M0L_Ok3q5_ukG8tXBnBrEA,319
|
38
|
-
langroid/agent/special/sql/sql_chat_agent.py,sha256=
|
38
|
+
langroid/agent/special/sql/sql_chat_agent.py,sha256=X0GzKPOHoYv36M_jYYUgYKW9H1Rum87O11iFpR0yhKQ,25430
|
39
39
|
langroid/agent/special/sql/utils/__init__.py,sha256=JFif6CRTrN-bc91uuAI4K9fe2ndIWSNMVxJ0WA68--M,446
|
40
40
|
langroid/agent/special/sql/utils/description_extractors.py,sha256=cX8TIpmTPXZXQTMpIi3OUFwFsPywxFFdurpx717Kq0I,6529
|
41
41
|
langroid/agent/special/sql/utils/populate_metadata.py,sha256=1J22UsyEPKzwK0XlJZtYn9r6kYc0FXIr8-lZrndYlhc,3131
|
@@ -69,7 +69,7 @@ langroid/language_models/azure_openai.py,sha256=zNQzzsERxNestq-hFfQZbvTzK43G2vjR
|
|
69
69
|
langroid/language_models/base.py,sha256=avM_RgoTPm1Esr8KSmW-4G0YBSfabeOnTEX3hrT_vM0,24104
|
70
70
|
langroid/language_models/config.py,sha256=9Q8wk5a7RQr8LGMT_0WkpjY8S4ywK06SalVRjXlfCiI,378
|
71
71
|
langroid/language_models/mock_lm.py,sha256=5BgHKDVRWFbUwDT_PFgTZXz9-k8wJSA2e3PZmyDgQ1k,4022
|
72
|
-
langroid/language_models/openai_gpt.py,sha256=
|
72
|
+
langroid/language_models/openai_gpt.py,sha256=Bpo1CKO5WavKWJBgJqpUU7zpYVcd-dUE4D_DK_5vP-U,79698
|
73
73
|
langroid/language_models/utils.py,sha256=L4_CbihDMTGcsg0TOG1Yd5JFEto46--h7CX_14m89sQ,5016
|
74
74
|
langroid/language_models/prompt_formatter/__init__.py,sha256=2-5cdE24XoFDhifOLl8yiscohil1ogbP1ECkYdBlBsk,372
|
75
75
|
langroid/language_models/prompt_formatter/base.py,sha256=eDS1sgRNZVnoajwV_ZIha6cba5Dt8xjgzdRbPITwx3Q,1221
|
@@ -123,7 +123,7 @@ langroid/vector_store/meilisearch.py,sha256=6frB7GFWeWmeKzRfLZIvzRjllniZ1cYj3Hmh
|
|
123
123
|
langroid/vector_store/momento.py,sha256=xOaU7Hlyyn_5ihb0ARS5JHtmrKrTCt2IdRA-ioMM5ek,10307
|
124
124
|
langroid/vector_store/qdrantdb.py,sha256=v7TAsIoj_vxeKDYS9tpwJLBZA8fuTweTYxHo0X_uawM,17949
|
125
125
|
langroid/vector_store/weaviatedb.py,sha256=FOzgvqLqvdN5jJebVtJ-8tu2CeBzBfSP3ih4_ODEOOw,10605
|
126
|
-
langroid-0.37.
|
127
|
-
langroid-0.37.
|
128
|
-
langroid-0.37.
|
129
|
-
langroid-0.37.
|
126
|
+
langroid-0.37.5.dist-info/METADATA,sha256=2wTE_fB76vBz5un3RldampCIcired_fnMIqFdYxxifY,60524
|
127
|
+
langroid-0.37.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
128
|
+
langroid-0.37.5.dist-info/licenses/LICENSE,sha256=EgVbvA6VSYgUlvC3RvPKehSg7MFaxWDsFuzLOsPPfJg,1065
|
129
|
+
langroid-0.37.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|