isa-model 0.3.2__py3-none-any.whl → 0.3.3__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.
- isa_model/inference/services/llm/llm_adapter.py +27 -0
- {isa_model-0.3.2.dist-info → isa_model-0.3.3.dist-info}/METADATA +1 -1
- {isa_model-0.3.2.dist-info → isa_model-0.3.3.dist-info}/RECORD +5 -5
- {isa_model-0.3.2.dist-info → isa_model-0.3.3.dist-info}/WHEEL +0 -0
- {isa_model-0.3.2.dist-info → isa_model-0.3.3.dist-info}/top_level.txt +0 -0
@@ -89,6 +89,33 @@ class LangChainMessageAdapter:
|
|
89
89
|
msg_dict["role"] = "user"
|
90
90
|
elif msg.type == "ai":
|
91
91
|
msg_dict["role"] = "assistant"
|
92
|
+
# Handle tool calls if present in LangChain AI messages
|
93
|
+
if hasattr(msg, 'tool_calls') and msg.tool_calls:
|
94
|
+
tool_calls = []
|
95
|
+
for tc in msg.tool_calls:
|
96
|
+
if isinstance(tc, dict):
|
97
|
+
# LangChain format: {"name": "func", "args": {...}, "id": "..."}
|
98
|
+
tool_call = {
|
99
|
+
"id": tc.get("id", f"call_{len(tool_calls)}"),
|
100
|
+
"type": "function",
|
101
|
+
"function": {
|
102
|
+
"name": tc.get("name", "unknown"),
|
103
|
+
"arguments": json.dumps(tc.get("args", {}))
|
104
|
+
}
|
105
|
+
}
|
106
|
+
else:
|
107
|
+
# Handle other tool call formats
|
108
|
+
tool_call = {
|
109
|
+
"id": getattr(tc, 'id', f"call_{len(tool_calls)}"),
|
110
|
+
"type": "function",
|
111
|
+
"function": {
|
112
|
+
"name": getattr(tc, 'name', 'unknown'),
|
113
|
+
"arguments": json.dumps(getattr(tc, 'args', {}))
|
114
|
+
}
|
115
|
+
}
|
116
|
+
tool_calls.append(tool_call)
|
117
|
+
|
118
|
+
msg_dict["tool_calls"] = tool_calls # type: ignore
|
92
119
|
elif msg.type == "tool":
|
93
120
|
msg_dict["role"] = "tool"
|
94
121
|
if hasattr(msg, 'tool_call_id'):
|
@@ -43,7 +43,7 @@ isa_model/inference/services/embedding/ollama_embed_service.py,sha256=s6LPSh-D06
|
|
43
43
|
isa_model/inference/services/embedding/openai_embed_service.py,sha256=cjAzmYXlY0XLgwemdlhhUVlDecgzFy2xn3DSycoYvdo,8474
|
44
44
|
isa_model/inference/services/llm/__init__.py,sha256=C6t9w33j3Ap4oGcJal9-htifKe0rxwws_kC3F-_B_Ps,341
|
45
45
|
isa_model/inference/services/llm/base_llm_service.py,sha256=SXxFhH2z1UYqt2ihiuursrKEjiiiC3vWCvRQVETsdVc,5238
|
46
|
-
isa_model/inference/services/llm/llm_adapter.py,sha256=
|
46
|
+
isa_model/inference/services/llm/llm_adapter.py,sha256=_NUfFzTD0t0vjcTFBIz7JKA5BCCbjBwIzp8cV3LGZ98,18791
|
47
47
|
isa_model/inference/services/llm/ollama_llm_service.py,sha256=c5xAdbbicskbxhivIQUse-QiUbCElR_Bo88wIA3dZUI,10194
|
48
48
|
isa_model/inference/services/llm/openai_llm_service.py,sha256=e5GmO4YpVUBImQvQTZ26UwiAmHkU1RPl_vIa1dNe_NM,8148
|
49
49
|
isa_model/inference/services/llm/triton_llm_service.py,sha256=ZFo7JoZ799Nvyi8Cz1jfWOa6TUn0hDRJtBrotadMAd4,17673
|
@@ -85,7 +85,7 @@ isa_model/training/core/config.py,sha256=oqgKpBvtzrN6jwLIQYQ2707lH6nmjrktRiSxp9i
|
|
85
85
|
isa_model/training/core/dataset.py,sha256=XCFsnf0NUMU1dJpdvo_CAMyvXB-9_RCUEiy8TU50e20,7802
|
86
86
|
isa_model/training/core/trainer.py,sha256=h5TjqjdFr0Fsv5y4-0siy1KmOlqLfliVaUXybvuoeXU,26932
|
87
87
|
isa_model/training/core/utils.py,sha256=Nik0M2ssfNbWqP6fKO0Kfyhzr_H6Q19ioxB-qCYbn5E,8387
|
88
|
-
isa_model-0.3.
|
89
|
-
isa_model-0.3.
|
90
|
-
isa_model-0.3.
|
91
|
-
isa_model-0.3.
|
88
|
+
isa_model-0.3.3.dist-info/METADATA,sha256=JR7HYP8HN8ZStGhRBuqFz-yH1SGnEE2I8BTU61c5QRU,12226
|
89
|
+
isa_model-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
90
|
+
isa_model-0.3.3.dist-info/top_level.txt,sha256=eHSy_Xb3kNkh2kK11mi1mZh0Wz91AQ5b8k2KFYO-rE8,10
|
91
|
+
isa_model-0.3.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|