meshagent-openai 0.0.31__py3-none-any.whl → 0.0.33__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.
Potentially problematic release.
This version of meshagent-openai might be problematic. Click here for more details.
- meshagent/openai/proxy/proxy.py +2 -0
- meshagent/openai/tools/responses_adapter.py +8 -4
- meshagent/openai/version.py +1 -1
- {meshagent_openai-0.0.31.dist-info → meshagent_openai-0.0.33.dist-info}/METADATA +4 -4
- {meshagent_openai-0.0.31.dist-info → meshagent_openai-0.0.33.dist-info}/RECORD +8 -8
- {meshagent_openai-0.0.31.dist-info → meshagent_openai-0.0.33.dist-info}/WHEEL +0 -0
- {meshagent_openai-0.0.31.dist-info → meshagent_openai-0.0.33.dist-info}/licenses/LICENSE +0 -0
- {meshagent_openai-0.0.31.dist-info → meshagent_openai-0.0.33.dist-info}/top_level.txt +0 -0
meshagent/openai/proxy/proxy.py
CHANGED
|
@@ -9,9 +9,11 @@ def get_client(*, room: RoomClient) -> AsyncOpenAI:
|
|
|
9
9
|
url : str = room.room_url
|
|
10
10
|
|
|
11
11
|
room_proxy_url = f"{url}/v1"
|
|
12
|
+
|
|
12
13
|
if room_proxy_url.startswith("ws:") or room_proxy_url.startswith("wss:"):
|
|
13
14
|
room_proxy_url = room_proxy_url.replace("ws","http",1)
|
|
14
15
|
|
|
16
|
+
print(room_proxy_url)
|
|
15
17
|
openai=AsyncOpenAI(
|
|
16
18
|
api_key=token,
|
|
17
19
|
base_url=room_proxy_url,
|
|
@@ -26,6 +26,11 @@ from opentelemetry import trace
|
|
|
26
26
|
|
|
27
27
|
tracer = trace.get_tracer("openai.llm.responses")
|
|
28
28
|
|
|
29
|
+
def safe_model_dump(model: BaseModel):
|
|
30
|
+
try:
|
|
31
|
+
return model.model_dump_json()
|
|
32
|
+
except:
|
|
33
|
+
return {"error":"unable to dump json for model"}
|
|
29
34
|
|
|
30
35
|
def _replace_non_matching(text: str, allowed_chars: str, replacement: str) -> str:
|
|
31
36
|
"""
|
|
@@ -369,7 +374,6 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
|
369
374
|
response_options = self._response_options
|
|
370
375
|
if response_options == None:
|
|
371
376
|
response_options = {}
|
|
372
|
-
|
|
373
377
|
response : Response = await openai.responses.create(
|
|
374
378
|
stream=stream,
|
|
375
379
|
model = self._model,
|
|
@@ -398,9 +402,9 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
|
398
402
|
|
|
399
403
|
span.set_attributes({
|
|
400
404
|
"type" : message.type,
|
|
401
|
-
"message" : message
|
|
405
|
+
"message" : safe_model_dump(message)
|
|
402
406
|
})
|
|
403
|
-
|
|
407
|
+
|
|
404
408
|
room.developer.log_nowait(type=f"llm.message", data={
|
|
405
409
|
"context" : context.id, "participant_id" : room.local_participant.id, "participant_name" : room.local_participant.get_attribute("name"), "message" : message.to_dict()
|
|
406
410
|
})
|
|
@@ -576,7 +580,7 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
|
|
|
576
580
|
event : ResponseStreamEvent = e
|
|
577
581
|
span.set_attributes({
|
|
578
582
|
"type" : event.type,
|
|
579
|
-
"event" : event
|
|
583
|
+
"event" : safe_model_dump(event)
|
|
580
584
|
})
|
|
581
585
|
|
|
582
586
|
event_handler(event)
|
meshagent/openai/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.0.
|
|
1
|
+
__version__ = "0.0.33"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meshagent-openai
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.33
|
|
4
4
|
Summary: OpenAI Building Blocks for Meshagent
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Documentation, https://docs.meshagent.com
|
|
@@ -13,9 +13,9 @@ Requires-Dist: pyjwt~=2.10.1
|
|
|
13
13
|
Requires-Dist: pytest~=8.3.5
|
|
14
14
|
Requires-Dist: pytest-asyncio~=0.26.0
|
|
15
15
|
Requires-Dist: openai~=1.86.0
|
|
16
|
-
Requires-Dist: meshagent-api~=0.0.
|
|
17
|
-
Requires-Dist: meshagent-agents~=0.0.
|
|
18
|
-
Requires-Dist: meshagent-tools~=0.0.
|
|
16
|
+
Requires-Dist: meshagent-api~=0.0.33
|
|
17
|
+
Requires-Dist: meshagent-agents~=0.0.33
|
|
18
|
+
Requires-Dist: meshagent-tools~=0.0.33
|
|
19
19
|
Dynamic: license-file
|
|
20
20
|
|
|
21
21
|
### Meshagent OpenAI
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
meshagent/openai/__init__.py,sha256=4JRby-ltGfJzrNYhJkMNIpVc2ml2zL_JkkFC0T1_8Vk,174
|
|
2
|
-
meshagent/openai/version.py,sha256=
|
|
2
|
+
meshagent/openai/version.py,sha256=OVBfA7gV0WEUFOPlDpSwglGiTHQIokMTgkKEviraGo8,22
|
|
3
3
|
meshagent/openai/proxy/__init__.py,sha256=SqoueAmMXHbDKd8O4EeqGkI0gEiC3xLTLlpESGxySPU,30
|
|
4
|
-
meshagent/openai/proxy/proxy.py,sha256=
|
|
4
|
+
meshagent/openai/proxy/proxy.py,sha256=5yWcxUI49nGHKwng95HCc0GiyB4pIkuyU4O7VHZStgw,855
|
|
5
5
|
meshagent/openai/tools/__init__.py,sha256=SRJpWc_L9jv1c8aBLULflDg8co1kaw2Ffnr6hDkYEwg,240
|
|
6
6
|
meshagent/openai/tools/completions_adapter.py,sha256=M8PpyaLu02QwrYkLB3c1h72J3wlmrK3UdfNKx6yUDJk,14483
|
|
7
|
-
meshagent/openai/tools/responses_adapter.py,sha256=
|
|
7
|
+
meshagent/openai/tools/responses_adapter.py,sha256=tnAAZmXIUBaTvdOOyYF1PpI5M_8vjmizXt_TZ50PKyk,53297
|
|
8
8
|
meshagent/openai/tools/schema.py,sha256=7WvWFWK65G123G6ADxR27wA8vVpB_Twc3ZXlrYulMZg,9572
|
|
9
9
|
meshagent/openai/tools/stt.py,sha256=08QcfIcdUZgGRhgK-mwrkabKApE7uwhe4fG5invYSh0,3565
|
|
10
10
|
meshagent/openai/tools/stt_test.py,sha256=FCTWZ7bI0vUnTRjRivO_5QEZqHaTE0ehNp1QQkx8iJ0,2651
|
|
11
|
-
meshagent_openai-0.0.
|
|
12
|
-
meshagent_openai-0.0.
|
|
13
|
-
meshagent_openai-0.0.
|
|
14
|
-
meshagent_openai-0.0.
|
|
15
|
-
meshagent_openai-0.0.
|
|
11
|
+
meshagent_openai-0.0.33.dist-info/licenses/LICENSE,sha256=eTt0SPW-sVNdkZe9PS_S8WfCIyLjRXRl7sUBWdlteFg,10254
|
|
12
|
+
meshagent_openai-0.0.33.dist-info/METADATA,sha256=daEvurKCdK-9hOyrBkuj2IiGRtpB9-VuPUio6rtBnhY,660
|
|
13
|
+
meshagent_openai-0.0.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
meshagent_openai-0.0.33.dist-info/top_level.txt,sha256=GlcXnHtRP6m7zlG3Df04M35OsHtNXy_DY09oFwWrH74,10
|
|
15
|
+
meshagent_openai-0.0.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|