meshagent-openai 0.0.31__tar.gz → 0.0.33__tar.gz

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.

Files changed (24) hide show
  1. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/CHANGELOG.md +6 -0
  2. {meshagent_openai-0.0.31/meshagent_openai.egg-info → meshagent_openai-0.0.33}/PKG-INFO +4 -4
  3. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/proxy/proxy.py +2 -0
  4. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/tools/responses_adapter.py +8 -4
  5. meshagent_openai-0.0.33/meshagent/openai/version.py +1 -0
  6. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33/meshagent_openai.egg-info}/PKG-INFO +4 -4
  7. meshagent_openai-0.0.33/meshagent_openai.egg-info/requires.txt +7 -0
  8. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/pyproject.toml +3 -3
  9. meshagent_openai-0.0.31/meshagent/openai/version.py +0 -1
  10. meshagent_openai-0.0.31/meshagent_openai.egg-info/requires.txt +0 -7
  11. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/LICENSE +0 -0
  12. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/MANIFEST.in +0 -0
  13. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/README.md +0 -0
  14. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/__init__.py +0 -0
  15. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/proxy/__init__.py +0 -0
  16. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/tools/__init__.py +0 -0
  17. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/tools/completions_adapter.py +0 -0
  18. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/tools/schema.py +0 -0
  19. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/tools/stt.py +0 -0
  20. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent/openai/tools/stt_test.py +0 -0
  21. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent_openai.egg-info/SOURCES.txt +0 -0
  22. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent_openai.egg-info/dependency_links.txt +0 -0
  23. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/meshagent_openai.egg-info/top_level.txt +0 -0
  24. {meshagent_openai-0.0.31 → meshagent_openai-0.0.33}/setup.cfg +0 -0
@@ -1,3 +1,9 @@
1
+ ## [0.0.33]
2
+ - Stability
3
+
4
+ ## [0.0.32]
5
+ - Stability
6
+
1
7
  ## [0.0.31]
2
8
  - Stability
3
9
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-openai
3
- Version: 0.0.31
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.31
17
- Requires-Dist: meshagent-agents~=0.0.31
18
- Requires-Dist: meshagent-tools~=0.0.31
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
@@ -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.model_dump_json()
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.model_dump_json()
583
+ "event" : safe_model_dump(event)
580
584
  })
581
585
 
582
586
  event_handler(event)
@@ -0,0 +1 @@
1
+ __version__ = "0.0.33"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-openai
3
- Version: 0.0.31
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.31
17
- Requires-Dist: meshagent-agents~=0.0.31
18
- Requires-Dist: meshagent-tools~=0.0.31
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
@@ -0,0 +1,7 @@
1
+ pyjwt~=2.10.1
2
+ pytest~=8.3.5
3
+ pytest-asyncio~=0.26.0
4
+ openai~=1.86.0
5
+ meshagent-api~=0.0.33
6
+ meshagent-agents~=0.0.33
7
+ meshagent-tools~=0.0.33
@@ -14,9 +14,9 @@ dependencies = [
14
14
  "pytest~=8.3.5",
15
15
  "pytest-asyncio~=0.26.0",
16
16
  "openai~=1.86.0",
17
- "meshagent-api~=0.0.31",
18
- "meshagent-agents~=0.0.31",
19
- "meshagent-tools~=0.0.31"
17
+ "meshagent-api~=0.0.33",
18
+ "meshagent-agents~=0.0.33",
19
+ "meshagent-tools~=0.0.33"
20
20
  ]
21
21
 
22
22
  [project.urls]
@@ -1 +0,0 @@
1
- __version__ = "0.0.31"
@@ -1,7 +0,0 @@
1
- pyjwt~=2.10.1
2
- pytest~=8.3.5
3
- pytest-asyncio~=0.26.0
4
- openai~=1.86.0
5
- meshagent-api~=0.0.31
6
- meshagent-agents~=0.0.31
7
- meshagent-tools~=0.0.31