meshagent-openai 0.0.6__tar.gz → 0.0.8__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 (23) hide show
  1. meshagent_openai-0.0.8/CHANGELOG.md +15 -0
  2. meshagent_openai-0.0.8/MANIFEST.in +1 -0
  3. {meshagent_openai-0.0.6/meshagent_openai.egg-info → meshagent_openai-0.0.8}/PKG-INFO +5 -12
  4. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent/openai/__init__.py +2 -1
  5. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent/openai/tools/completions_adapter.py +1 -0
  6. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent/openai/tools/responses_adapter.py +24 -3
  7. meshagent_openai-0.0.8/meshagent/openai/version.py +1 -0
  8. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8/meshagent_openai.egg-info}/PKG-INFO +5 -12
  9. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent_openai.egg-info/SOURCES.txt +1 -2
  10. meshagent_openai-0.0.8/meshagent_openai.egg-info/requires.txt +7 -0
  11. meshagent_openai-0.0.8/pyproject.toml +35 -0
  12. meshagent_openai-0.0.6/CHANGELOG.md +0 -8
  13. meshagent_openai-0.0.6/MANIFEST.in +0 -2
  14. meshagent_openai-0.0.6/meshagent_openai.egg-info/requires.txt +0 -7
  15. meshagent_openai-0.0.6/pyproject.toml +0 -5
  16. meshagent_openai-0.0.6/setup.py +0 -44
  17. meshagent_openai-0.0.6/version.py +0 -1
  18. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/LICENSE +0 -0
  19. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/README.md +0 -0
  20. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent/openai/tools/__init__.py +0 -0
  21. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent_openai.egg-info/dependency_links.txt +0 -0
  22. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/meshagent_openai.egg-info/top_level.txt +0 -0
  23. {meshagent_openai-0.0.6 → meshagent_openai-0.0.8}/setup.cfg +0 -0
@@ -0,0 +1,15 @@
1
+ ## [0.0.8]
2
+ - Stability
3
+
4
+ ## [0.0.7]
5
+ - Added code editor agent
6
+ - Fixes
7
+
8
+ ## [0.0.6]
9
+ - Fixes
10
+
11
+ ## [0.0.5]
12
+ - Fix chatbox initialization
13
+
14
+ ## [0.0.4]
15
+ - Streaming support
@@ -0,0 +1 @@
1
+ include CHANGELOG.md
@@ -1,9 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-openai
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: OpenAI Building Blocks for Meshagent
5
- Home-page:
6
- License: Apache License 2.0
5
+ License-Expression: Apache-2.0
7
6
  Project-URL: Documentation, https://meshagent.com
8
7
  Project-URL: Website, https://meshagent.com
9
8
  Project-URL: Source, https://github.com/meshagent
@@ -14,13 +13,7 @@ Requires-Dist: pyjwt>=2.0.0
14
13
  Requires-Dist: pytest>=8.3.4
15
14
  Requires-Dist: pytest-asyncio>=0.24.0
16
15
  Requires-Dist: openai>=1.66.2
17
- Requires-Dist: meshagent-api>=0.0.6
18
- Requires-Dist: meshagent-agents>=0.0.6
19
- Requires-Dist: meshagent-tools>=0.0.6
20
- Dynamic: description-content-type
21
- Dynamic: license
16
+ Requires-Dist: meshagent-api>=0.0.8
17
+ Requires-Dist: meshagent-agents>=0.0.8
18
+ Requires-Dist: meshagent-tools>=0.0.8
22
19
  Dynamic: license-file
23
- Dynamic: project-url
24
- Dynamic: requires-dist
25
- Dynamic: requires-python
26
- Dynamic: summary
@@ -1 +1,2 @@
1
- from .tools import OpenAICompletionsAdapter, OpenAIResponsesAdapter, OpenAICompletionsToolResponseAdapter, OpenAIResponsesToolResponseAdapter
1
+ from .tools import OpenAICompletionsAdapter, OpenAIResponsesAdapter, OpenAICompletionsToolResponseAdapter, OpenAIResponsesToolResponseAdapter
2
+ from .version import __version__
@@ -322,6 +322,7 @@ class OpenAICompletionsAdapter(LLMAdapter):
322
322
  tool_context = ToolContext(
323
323
  room=room,
324
324
  caller=room.local_participant,
325
+ caller_context={ "chat" : context.to_json }
325
326
  )
326
327
  tool_response = await tool_bundle.execute(context=tool_context, tool_call=tool_call)
327
328
  logger.info(f"tool response {tool_response}")
@@ -235,7 +235,7 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
235
235
  model: str = os.getenv("OPENAI_MODEL"),
236
236
  parallel_tool_calls : Optional[bool] = None,
237
237
  client: Optional[AsyncOpenAI] = None,
238
- retries : int = 10,
238
+ retries : int = 0,
239
239
  response_options : Optional[dict] = None
240
240
  ):
241
241
  self._model = model
@@ -395,8 +395,15 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
395
395
  tool_context = ToolContext(
396
396
  room=room,
397
397
  caller=room.local_participant,
398
+ caller_context={ "chat" : context.to_json }
398
399
  )
399
400
  tool_response = await tool_bundle.execute(context=tool_context, tool_call=tool_call)
401
+ if tool_response.caller_context != None:
402
+ if tool_response.caller_context.get("chat", None) != None:
403
+ tool_chat_context = AgentChatContext.from_json(tool_response.caller_context["chat"])
404
+ if tool_chat_context.previous_response_id != None:
405
+ context.track_response(tool_chat_context.previous_response_id)
406
+
400
407
  logger.info(f"tool response {tool_response}")
401
408
  return await tool_adapter.create_messages(context=context, tool_call=tool_call, room=room, response=tool_response)
402
409
  except Exception as e:
@@ -425,6 +432,7 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
425
432
  tool_context = ToolContext(
426
433
  room=room,
427
434
  caller=room.local_participant,
435
+ caller_context={ "chat" : context.to_json }
428
436
  )
429
437
  outputs = (await tool_bundle.get_tool("computer_call").execute(context=tool_context, arguments=message.to_dict(mode="json"))).outputs
430
438
 
@@ -469,11 +477,13 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
469
477
  if stream == False:
470
478
  room.developer.log_nowait(type="llm.message", data={ "context" : context.id, "participant_id" : room.local_participant.id, "participant_name" : room.local_participant.get_attribute("name"), "response" : response.to_dict() })
471
479
 
472
- context.create_response(response.id)
480
+ context.track_response(response.id)
473
481
 
474
482
  final_outputs = []
475
483
 
484
+
476
485
  for message in response.output:
486
+ context.previous_messages.append(message.to_dict())
477
487
  outputs, done = await handle_message(message=message)
478
488
  if done:
479
489
  final_outputs.extend(outputs)
@@ -484,6 +494,17 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
484
494
  if len(final_outputs) > 0:
485
495
 
486
496
  return final_outputs[0]
497
+
498
+ term = await self.check_for_termination(context=context, room=room)
499
+ if term:
500
+ text = ""
501
+ for output in response.output:
502
+ if output.type == "message":
503
+ for content in output.content:
504
+ text += content.text
505
+
506
+ return text
507
+
487
508
 
488
509
  else:
489
510
 
@@ -496,7 +517,7 @@ class OpenAIResponsesAdapter(LLMAdapter[ResponsesToolBundle]):
496
517
  event_handler(event)
497
518
 
498
519
  if event.type == "response.completed":
499
- context.create_response(event.response.id)
520
+ context.track_response(event.response.id)
500
521
 
501
522
  context.messages.extend(all_outputs)
502
523
 
@@ -0,0 +1 @@
1
+ __version__ = "0.0.8"
@@ -1,9 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-openai
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: OpenAI Building Blocks for Meshagent
5
- Home-page:
6
- License: Apache License 2.0
5
+ License-Expression: Apache-2.0
7
6
  Project-URL: Documentation, https://meshagent.com
8
7
  Project-URL: Website, https://meshagent.com
9
8
  Project-URL: Source, https://github.com/meshagent
@@ -14,13 +13,7 @@ Requires-Dist: pyjwt>=2.0.0
14
13
  Requires-Dist: pytest>=8.3.4
15
14
  Requires-Dist: pytest-asyncio>=0.24.0
16
15
  Requires-Dist: openai>=1.66.2
17
- Requires-Dist: meshagent-api>=0.0.6
18
- Requires-Dist: meshagent-agents>=0.0.6
19
- Requires-Dist: meshagent-tools>=0.0.6
20
- Dynamic: description-content-type
21
- Dynamic: license
16
+ Requires-Dist: meshagent-api>=0.0.8
17
+ Requires-Dist: meshagent-agents>=0.0.8
18
+ Requires-Dist: meshagent-tools>=0.0.8
22
19
  Dynamic: license-file
23
- Dynamic: project-url
24
- Dynamic: requires-dist
25
- Dynamic: requires-python
26
- Dynamic: summary
@@ -3,9 +3,8 @@ LICENSE
3
3
  MANIFEST.in
4
4
  README.md
5
5
  pyproject.toml
6
- setup.py
7
- version.py
8
6
  meshagent/openai/__init__.py
7
+ meshagent/openai/version.py
9
8
  meshagent/openai/tools/__init__.py
10
9
  meshagent/openai/tools/completions_adapter.py
11
10
  meshagent/openai/tools/responses_adapter.py
@@ -0,0 +1,7 @@
1
+ pyjwt>=2.0.0
2
+ pytest>=8.3.4
3
+ pytest-asyncio>=0.24.0
4
+ openai>=1.66.2
5
+ meshagent-api>=0.0.8
6
+ meshagent-agents>=0.0.8
7
+ meshagent-tools>=0.0.8
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "meshagent-openai"
7
+ description = "OpenAI Building Blocks for Meshagent"
8
+ dynamic = ["version", "readme"]
9
+ requires-python = ">=3.9.0"
10
+ license = "Apache-2.0"
11
+ keywords = []
12
+ dependencies = [
13
+ "pyjwt>=2.0.0",
14
+ "pytest>=8.3.4",
15
+ "pytest-asyncio>=0.24.0",
16
+ "openai>=1.66.2",
17
+ "meshagent-api>=0.0.8",
18
+ "meshagent-agents>=0.0.8",
19
+ "meshagent-tools>=0.0.8"
20
+ ]
21
+
22
+ [project.urls]
23
+ Documentation = "https://meshagent.com"
24
+ Website = "https://meshagent.com"
25
+ Source = "https://github.com/meshagent"
26
+
27
+ [tool.setuptools.packages.find]
28
+ include = ["meshagent.*"]
29
+
30
+ [tool.setuptools.package-data]
31
+ "meshagent.openai" = ["py.typed", "*.pyi", "**/*.pyi", "**/*.js"]
32
+
33
+ [tool.setuptools.dynamic]
34
+ version = {attr = "meshagent.openai.version.__version__"}
35
+ readme = { file = "README.md", content-type = "text/markdown" }
@@ -1,8 +0,0 @@
1
- ## [0.0.6]
2
- - Fixes
3
-
4
- ## [0.0.5]
5
- - Fix chatbox initialization
6
-
7
- ## [0.0.4]
8
- - Streaming support
@@ -1,2 +0,0 @@
1
- include version.py
2
- include CHANGELOG.md
@@ -1,7 +0,0 @@
1
- pyjwt>=2.0.0
2
- pytest>=8.3.4
3
- pytest-asyncio>=0.24.0
4
- openai>=1.66.2
5
- meshagent-api>=0.0.6
6
- meshagent-agents>=0.0.6
7
- meshagent-tools>=0.0.6
@@ -1,5 +0,0 @@
1
- [build-system]
2
- requires = [
3
- "setuptools>=42",
4
- ]
5
- build-backend = "setuptools.build_meta"
@@ -1,44 +0,0 @@
1
- import os
2
- import pathlib
3
- from typing import Any, Dict
4
-
5
- import setuptools # type: ignore
6
-
7
- here = pathlib.Path(__file__).parent.resolve()
8
- about: Dict[Any, Any] = {}
9
- with open(os.path.join(here, "version.py"), "r") as f:
10
- exec(f.read(), about)
11
-
12
- setuptools.setup(
13
- name="meshagent-openai",
14
- version=about["__version__"],
15
- description="OpenAI Building Blocks for Meshagent",
16
- long_description=(here / "README.md").read_text(encoding="utf-8"),
17
- long_description_content_type="text/markdown",
18
- url="",
19
- classifiers=[
20
- ],
21
- keywords=[],
22
- license="Apache License 2.0",
23
- packages=setuptools.find_namespace_packages(include=[
24
- "meshagent.*",
25
- ]),
26
- python_requires=">=3.9.0",
27
- install_requires=[
28
- "pyjwt>=2.0.0",
29
- "pytest>=8.3.4",
30
- "pytest-asyncio>=0.24.0",
31
- "openai>=1.66.2",
32
- "meshagent-api>=0.0.6",
33
- "meshagent-agents>=0.0.6",
34
- "meshagent-tools>=0.0.6"
35
- ],
36
- package_data={
37
- "meshagent.openai": ["py.typed", "*.pyi", "**/*.pyi", "**/*.js"],
38
- },
39
- project_urls={
40
- "Documentation": "https://meshagent.com",
41
- "Website": "https://meshagent.com",
42
- "Source": "https://github.com/meshagent",
43
- },
44
- )
@@ -1 +0,0 @@
1
- __version__ = "0.0.6"