hdsp-jupyter-extension 2.0.21__py3-none-any.whl → 2.0.23__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.
- agent_server/langchain/models/gpt_oss_chat.py +51 -32
- agent_server/routers/langchain_agent.py +100 -341
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/build_log.json +1 -1
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/package.json +2 -2
- jupyter_ext/labextension/static/lib_index_js.90f80cb80187de8c5ae5.js → hdsp_jupyter_extension-2.0.23.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.2d5ea542350862f7c531.js +7 -7
- hdsp_jupyter_extension-2.0.23.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.2d5ea542350862f7c531.js.map +1 -0
- hdsp_jupyter_extension-2.0.21.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.93b1c499786ecd47b837.js → hdsp_jupyter_extension-2.0.23.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.f0127d8744730f2092c1.js +3 -3
- jupyter_ext/labextension/static/remoteEntry.93b1c499786ecd47b837.js.map → hdsp_jupyter_extension-2.0.23.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.f0127d8744730f2092c1.js.map +1 -1
- {hdsp_jupyter_extension-2.0.21.dist-info → hdsp_jupyter_extension-2.0.23.dist-info}/METADATA +1 -1
- {hdsp_jupyter_extension-2.0.21.dist-info → hdsp_jupyter_extension-2.0.23.dist-info}/RECORD +40 -40
- jupyter_ext/_version.py +1 -1
- jupyter_ext/labextension/build_log.json +1 -1
- jupyter_ext/labextension/package.json +2 -2
- hdsp_jupyter_extension-2.0.21.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.90f80cb80187de8c5ae5.js → jupyter_ext/labextension/static/lib_index_js.2d5ea542350862f7c531.js +7 -7
- jupyter_ext/labextension/static/lib_index_js.2d5ea542350862f7c531.js.map +1 -0
- jupyter_ext/labextension/static/{remoteEntry.93b1c499786ecd47b837.js → remoteEntry.f0127d8744730f2092c1.js} +3 -3
- hdsp_jupyter_extension-2.0.21.data/data/share/jupyter/labextensions/hdsp-agent/static/remoteEntry.93b1c499786ecd47b837.js.map → jupyter_ext/labextension/static/remoteEntry.f0127d8744730f2092c1.js.map +1 -1
- hdsp_jupyter_extension-2.0.21.data/data/share/jupyter/labextensions/hdsp-agent/static/lib_index_js.90f80cb80187de8c5ae5.js.map +0 -1
- jupyter_ext/labextension/static/lib_index_js.90f80cb80187de8c5ae5.js.map +0 -1
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/etc/jupyter/jupyter_server_config.d/hdsp_jupyter_extension.json +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/install.json +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/frontend_styles_index_js.96745acc14125453fba8.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/frontend_styles_index_js.96745acc14125453fba8.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b80.c095373419d05e6f141a.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b80.c095373419d05e6f141a.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b81.61e75fb98ecff46cf836.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/node_modules_emotion_use-insertion-effect-with-fallbacks_dist_emotion-use-insertion-effect-wi-3ba6b81.61e75fb98ecff46cf836.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/style.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_babel_runtime_helpers_esm_extends_js-node_modules_emotion_serialize_dist-051195.e2553aab0c3963b83dd7.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_babel_runtime_helpers_esm_extends_js-node_modules_emotion_serialize_dist-051195.e2553aab0c3963b83dd7.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_cache_dist_emotion-cache_browser_development_esm_js.24edcc52a1c014a8a5f0.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_cache_dist_emotion-cache_browser_development_esm_js.24edcc52a1c014a8a5f0.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_react_dist_emotion-react_browser_development_esm_js.19ecf6babe00caff6b8a.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_react_dist_emotion-react_browser_development_esm_js.19ecf6babe00caff6b8a.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_styled_dist_emotion-styled_browser_development_esm_js.661fb5836f4978a7c6e1.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_emotion_styled_dist_emotion-styled_browser_development_esm_js.661fb5836f4978a7c6e1.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_index_js.985697e0162d8d088ca2.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_index_js.985697e0162d8d088ca2.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_utils_createSvgIcon_js.1f5038488cdfd8b3a85d.js +0 -0
- {hdsp_jupyter_extension-2.0.21.data → hdsp_jupyter_extension-2.0.23.data}/data/share/jupyter/labextensions/hdsp-agent/static/vendors-node_modules_mui_material_utils_createSvgIcon_js.1f5038488cdfd8b3a85d.js.map +0 -0
- {hdsp_jupyter_extension-2.0.21.dist-info → hdsp_jupyter_extension-2.0.23.dist-info}/WHEEL +0 -0
- {hdsp_jupyter_extension-2.0.21.dist-info → hdsp_jupyter_extension-2.0.23.dist-info}/licenses/LICENSE +0 -0
|
@@ -98,7 +98,9 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
98
98
|
"function": {
|
|
99
99
|
"name": tool.name,
|
|
100
100
|
"description": tool.description or "",
|
|
101
|
-
"parameters": tool.args_schema.schema()
|
|
101
|
+
"parameters": tool.args_schema.schema()
|
|
102
|
+
if tool.args_schema
|
|
103
|
+
else {"type": "object", "properties": {}},
|
|
102
104
|
},
|
|
103
105
|
}
|
|
104
106
|
formatted_tools.append(tool_schema)
|
|
@@ -116,6 +118,7 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
116
118
|
temperature=self.temperature,
|
|
117
119
|
max_tokens=self.max_tokens,
|
|
118
120
|
streaming=self.streaming,
|
|
121
|
+
callbacks=self.callbacks, # Preserve callbacks (e.g., LLMTraceLogger)
|
|
119
122
|
)
|
|
120
123
|
new_instance._tools = formatted_tools
|
|
121
124
|
new_instance._tool_choice = tool_choice
|
|
@@ -131,15 +134,19 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
131
134
|
for msg in messages:
|
|
132
135
|
if isinstance(msg, SystemMessage):
|
|
133
136
|
# Convert system to developer for gpt-oss instruction hierarchy
|
|
134
|
-
result.append(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
result.append(
|
|
138
|
+
{
|
|
139
|
+
"role": "developer",
|
|
140
|
+
"content": msg.content,
|
|
141
|
+
}
|
|
142
|
+
)
|
|
138
143
|
elif isinstance(msg, HumanMessage):
|
|
139
|
-
result.append(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
result.append(
|
|
145
|
+
{
|
|
146
|
+
"role": "user",
|
|
147
|
+
"content": msg.content,
|
|
148
|
+
}
|
|
149
|
+
)
|
|
143
150
|
elif isinstance(msg, AIMessage):
|
|
144
151
|
ai_msg: Dict[str, Any] = {
|
|
145
152
|
"role": "assistant",
|
|
@@ -154,25 +161,31 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
154
161
|
"type": "function",
|
|
155
162
|
"function": {
|
|
156
163
|
"name": tc["name"],
|
|
157
|
-
"arguments": json.dumps(tc["args"])
|
|
164
|
+
"arguments": json.dumps(tc["args"])
|
|
165
|
+
if isinstance(tc["args"], dict)
|
|
166
|
+
else tc["args"],
|
|
158
167
|
},
|
|
159
168
|
}
|
|
160
169
|
for tc in tool_calls
|
|
161
170
|
]
|
|
162
171
|
result.append(ai_msg)
|
|
163
172
|
elif isinstance(msg, ToolMessage):
|
|
164
|
-
result.append(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
result.append(
|
|
174
|
+
{
|
|
175
|
+
"role": "tool",
|
|
176
|
+
"tool_call_id": msg.tool_call_id,
|
|
177
|
+
"content": msg.content,
|
|
178
|
+
}
|
|
179
|
+
)
|
|
169
180
|
else:
|
|
170
181
|
# Fallback for other message types
|
|
171
182
|
role = getattr(msg, "role", "user")
|
|
172
|
-
result.append(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
183
|
+
result.append(
|
|
184
|
+
{
|
|
185
|
+
"role": role,
|
|
186
|
+
"content": msg.content,
|
|
187
|
+
}
|
|
188
|
+
)
|
|
176
189
|
|
|
177
190
|
return result
|
|
178
191
|
|
|
@@ -204,12 +217,14 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
204
217
|
args = json.loads(tc.function.arguments)
|
|
205
218
|
except json.JSONDecodeError:
|
|
206
219
|
args = {"raw": tc.function.arguments}
|
|
207
|
-
tool_calls_list.append(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
220
|
+
tool_calls_list.append(
|
|
221
|
+
{
|
|
222
|
+
"name": tc.function.name,
|
|
223
|
+
"args": args,
|
|
224
|
+
"id": tc.id,
|
|
225
|
+
"type": "tool_call",
|
|
226
|
+
}
|
|
227
|
+
)
|
|
213
228
|
|
|
214
229
|
ai_message = AIMessage(
|
|
215
230
|
content=content,
|
|
@@ -260,7 +275,9 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
260
275
|
request_kwargs["tool_choice"] = self._tool_choice
|
|
261
276
|
|
|
262
277
|
# Make API call
|
|
263
|
-
logger.debug(
|
|
278
|
+
logger.debug(
|
|
279
|
+
f"ChatGPTOSS request: model={self.model}, messages_count={len(openai_messages)}"
|
|
280
|
+
)
|
|
264
281
|
response = self.client.chat.completions.create(**request_kwargs)
|
|
265
282
|
|
|
266
283
|
return self._create_chat_result(response)
|
|
@@ -328,12 +345,14 @@ class ChatGPTOSS(BaseChatModel):
|
|
|
328
345
|
tool_calls_accum[idx]["arguments"] += tc.function.arguments
|
|
329
346
|
|
|
330
347
|
# Build tool call chunk for LangChain
|
|
331
|
-
tool_call_chunks.append(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
348
|
+
tool_call_chunks.append(
|
|
349
|
+
{
|
|
350
|
+
"index": idx,
|
|
351
|
+
"id": tool_calls_accum[idx]["id"],
|
|
352
|
+
"name": tool_calls_accum[idx]["name"],
|
|
353
|
+
"args": tool_calls_accum[idx]["arguments"],
|
|
354
|
+
}
|
|
355
|
+
)
|
|
337
356
|
|
|
338
357
|
# Create chunk message
|
|
339
358
|
chunk_message = AIMessageChunk(
|