meshagent-agents 0.0.14__tar.gz → 0.0.16__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-agents might be problematic. Click here for more details.

Files changed (37) hide show
  1. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/CHANGELOG.md +6 -0
  2. {meshagent_agents-0.0.14/meshagent_agents.egg-info → meshagent_agents-0.0.16}/PKG-INFO +4 -4
  3. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/hosting.py +1 -0
  4. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/planning.py +3 -32
  5. meshagent_agents-0.0.16/meshagent/agents/schemas/__init__.py +0 -0
  6. meshagent_agents-0.0.16/meshagent/agents/schemas/document.py +38 -0
  7. meshagent_agents-0.0.16/meshagent/agents/schemas/gallery.py +25 -0
  8. meshagent_agents-0.0.16/meshagent/agents/schemas/presentation.py +32 -0
  9. meshagent_agents-0.0.16/meshagent/agents/schemas/schema.py +75 -0
  10. meshagent_agents-0.0.16/meshagent/agents/schemas/super_editor_document.py +47 -0
  11. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/utils.py +3 -3
  12. meshagent_agents-0.0.16/meshagent/agents/version.py +1 -0
  13. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16/meshagent_agents.egg-info}/PKG-INFO +4 -4
  14. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent_agents.egg-info/SOURCES.txt +6 -0
  15. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent_agents.egg-info/requires.txt +3 -3
  16. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/pyproject.toml +3 -3
  17. meshagent_agents-0.0.14/meshagent/agents/version.py +0 -1
  18. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/LICENSE +0 -0
  19. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/MANIFEST.in +0 -0
  20. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/README.md +0 -0
  21. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/__init__.py +0 -0
  22. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/adapter.py +0 -0
  23. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/agent.py +0 -0
  24. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/chat.py +0 -0
  25. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/context.py +0 -0
  26. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/development.py +0 -0
  27. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/indexer.py +0 -0
  28. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/listener.py +0 -0
  29. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/prompt.py +0 -0
  30. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/pydantic.py +0 -0
  31. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/single_shot_writer.py +0 -0
  32. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/thread_schema.py +0 -0
  33. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/worker.py +0 -0
  34. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent/agents/writer.py +0 -0
  35. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent_agents.egg-info/dependency_links.txt +0 -0
  36. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/meshagent_agents.egg-info/top_level.txt +0 -0
  37. {meshagent_agents-0.0.14 → meshagent_agents-0.0.16}/setup.cfg +0 -0
@@ -1,3 +1,9 @@
1
+ ## [0.0.16]
2
+ - Stability
3
+
4
+ ## [0.0.15]
5
+ - Stability
6
+
1
7
  ## [0.0.14]
2
8
  - Stability
3
9
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-agents
3
- Version: 0.0.14
3
+ Version: 0.0.16
4
4
  Summary: Agent Building Blocks for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://meshagent.com
@@ -12,9 +12,9 @@ License-File: LICENSE
12
12
  Requires-Dist: pyjwt~=2.10.1
13
13
  Requires-Dist: pytest~=8.3.5
14
14
  Requires-Dist: pytest-asyncio~=0.26.0
15
- Requires-Dist: meshagent-api~=0.0.14
16
- Requires-Dist: meshagent-tools~=0.0.14
17
- Requires-Dist: meshagent-openai~=0.0.14
15
+ Requires-Dist: meshagent-api~=0.0.16
16
+ Requires-Dist: meshagent-tools~=0.0.16
17
+ Requires-Dist: meshagent-openai~=0.0.16
18
18
  Requires-Dist: pydantic~=2.11.1
19
19
  Requires-Dist: pydantic-ai~=0.0.48
20
20
  Requires-Dist: chonkie~=0.5.1
@@ -115,3 +115,4 @@ class RemoteAgentServer[T:SingleRoomAgent](WebhookServer):
115
115
 
116
116
  async def on_call(self, event: CallEvent):
117
117
  await self._spawn(room_name=event.room_name, room_url=event.room_url, token=event.token, arguments=event.arguments)
118
+
@@ -250,7 +250,7 @@ class PlanningWriter(Writer):
250
250
 
251
251
  class PlanningResponder(TaskRunner):
252
252
 
253
- def __init__(self, *, name:str, llm_adapter: LLMAdapter, tool_adapter: Optional[ToolResponseAdapter] = None, output_schema: dict, max_iterations : int = 100, toolkits: Optional[list[Toolkit]] = None, title: Optional[str] = None, description: Optional[str] = None, requires: Optional[list[Requirement]] = None, supports_tools : bool = True, input_prompt: bool = True, use_terminate_tool: bool = False, rules: Optional[list[str]] = None, labels: Optional[list[str]] = None):
253
+ def __init__(self, *, name:str, llm_adapter: LLMAdapter, tool_adapter: Optional[ToolResponseAdapter] = None, output_schema: dict, max_iterations : int = 100, toolkits: Optional[list[Toolkit]] = None, title: Optional[str] = None, description: Optional[str] = None, requires: Optional[list[Requirement]] = None, supports_tools : bool = True, input_prompt: bool = True, rules: Optional[list[str]] = None, labels: Optional[list[str]] = None):
254
254
  if isinstance(output_schema, dict) == False:
255
255
  raise Exception("schema must be a dict, got: {type}".format(type=type(output_schema)))
256
256
 
@@ -295,8 +295,6 @@ class PlanningResponder(TaskRunner):
295
295
  self._llm_adapter = llm_adapter
296
296
  self._tool_adapter = tool_adapter
297
297
 
298
- self._use_terminate_tool = use_terminate_tool
299
-
300
298
  async def init_chat_context(self):
301
299
  chat = self._llm_adapter.create_chat_context()
302
300
 
@@ -322,30 +320,6 @@ class PlanningResponder(TaskRunner):
322
320
  self.parent._responses[self.context] = kwargs
323
321
  return TextResponse(text="the response was sent")
324
322
 
325
- terminated = False
326
-
327
- class ExitTool(Tool):
328
- def __init__(self):
329
- super().__init__(
330
- name="terminate",
331
- title="terminate",
332
- description="terminates the agent, the agent will no longer be available",
333
- input_schema={
334
- "type" : "object",
335
- "required" : [],
336
- "additionalProperties" : False,
337
- "properties" : {}
338
- }
339
- )
340
-
341
- async def execute(self, *, context: ToolContext, **kwargs):
342
- nonlocal terminated
343
- terminated = True
344
- return TextResponse(text="the process was terminated")
345
-
346
- use_terminate_tool = self._use_terminate_tool
347
-
348
-
349
323
  class ResponseToolkit(Toolkit):
350
324
  def __init__(self, output_schema, context, parent):
351
325
 
@@ -353,9 +327,6 @@ class PlanningResponder(TaskRunner):
353
327
  ResponseTool(output_schema=output_schema, context=context, parent=parent)
354
328
  ]
355
329
 
356
- if use_terminate_tool:
357
- tools.append(ExitTool())
358
-
359
330
  super().__init__(
360
331
  name="meshagent.responder",
361
332
  title="responder",
@@ -372,7 +343,7 @@ class PlanningResponder(TaskRunner):
372
343
  based on what you know know, either execute the next task or formulate a new plan. If you have sufficient information to complete the task, return a final answer.
373
344
  """
374
345
 
375
- rs = reasoning_schema(description="uses tools", elements=[], has_done_property=self._use_terminate_tool == False, has_abort=self._use_terminate_tool == False).to_json()
346
+ rs = reasoning_schema(description="uses tools", elements=[], has_done_property=True, has_abort=True).to_json()
376
347
 
377
348
  if self._input_prompt:
378
349
  prompt = arguments["prompt"]
@@ -380,7 +351,7 @@ class PlanningResponder(TaskRunner):
380
351
 
381
352
  room = context.room
382
353
  i = 0
383
- while i < self._max_iterations and not terminated:
354
+ while i < self._max_iterations:
384
355
  i += 1
385
356
 
386
357
  try:
@@ -0,0 +1,38 @@
1
+ from meshagent.api.schema import MeshSchema, ElementType, ChildProperty, ValueProperty
2
+
3
+ document_schema = MeshSchema(
4
+ root_tag_name="document",
5
+ elements=[
6
+ ElementType(
7
+ tag_name="document",
8
+ description="a document",
9
+ properties=[
10
+ ChildProperty(name="content", description="the content in the document", child_tag_names=[
11
+ "heading", "body", "file"
12
+ ]),
13
+ ]
14
+ ),
15
+ ElementType(
16
+ tag_name="heading",
17
+ description="heading",
18
+ properties=[
19
+ ValueProperty(name="text", description="the text of the heading", type="string"),
20
+ ]
21
+ ),
22
+ ElementType(
23
+ tag_name="body",
24
+ description="text",
25
+ properties=[
26
+ ValueProperty(name="text", description="body content in markdown format", type="string"),
27
+ ]
28
+ ),
29
+ ElementType(
30
+ tag_name="file",
31
+ description="an image",
32
+ properties=[
33
+ ValueProperty(name="name", description="reference a file that was output from one of the steps. use to display the content of a file or image.", type="string"),
34
+ ]
35
+ ),
36
+ ]
37
+ )
38
+
@@ -0,0 +1,25 @@
1
+ from meshagent.api.schema import MeshSchema, ElementType, ChildProperty, ValueProperty
2
+
3
+ gallery_schema = MeshSchema(
4
+ root_tag_name="gallery",
5
+ elements=[
6
+ ElementType(
7
+ tag_name="gallery",
8
+ description="a media gallery",
9
+ properties=[
10
+ ChildProperty(name="content", description="the content in the gallery", child_tag_names=[
11
+ "file"
12
+ ]),
13
+ ]
14
+ ),
15
+ ElementType(
16
+ tag_name="file",
17
+ description="an image",
18
+ properties=[
19
+ ValueProperty(name="path", description="reference a file that was output from one of the steps. use to display the content of a file or image.", type="string"),
20
+ ValueProperty(name="description", description="a description of the image", type="string"),
21
+ ]
22
+ ),
23
+ ]
24
+ )
25
+
@@ -0,0 +1,32 @@
1
+ from meshagent.api.schema import MeshSchema, ElementType, ChildProperty, ValueProperty
2
+
3
+ presentation_schema = MeshSchema(
4
+ root_tag_name="presentation",
5
+ elements=[
6
+ ElementType(
7
+ tag_name="presentation",
8
+ description="a presentation",
9
+ properties=[
10
+ ChildProperty(name="slides", description="the slides for the presentation", child_tag_names=["slide"]),
11
+ ]
12
+ ),
13
+ ElementType(
14
+ tag_name="slide",
15
+ description="a slide",
16
+ properties=[
17
+ ValueProperty(name="title", description="a title for the slide", type="string"),
18
+ ValueProperty(name="background", description="an file to use for an background of the slide, must be a filename output from a previous step", type="string"),
19
+ ChildProperty(name="lines", description="the slides for the presentation", child_tag_names=["line"]),
20
+ ]
21
+ ),
22
+
23
+ ElementType(
24
+ tag_name="line",
25
+ description="a line of text",
26
+ properties=[
27
+ ValueProperty(name="line", description="the text of a bullet point for the slide", type="string"),
28
+ ]
29
+ )
30
+
31
+ ]
32
+ )
@@ -0,0 +1,75 @@
1
+ from meshagent.api.schema import ElementProperty, ValueProperty, MeshSchema, ChildProperty, ElementType
2
+ from meshagent.api.schema_document import Document
3
+
4
+ schema_schema = MeshSchema(
5
+ root_tag_name="schema",
6
+ elements=[
7
+ ElementType(tag_name="schema", description="defines an xml document representing a json schema", properties=[
8
+ ValueProperty(name="root_tag_name", description="the root tag name in this document (must match one of the elements defined in the schema)", type="string"),
9
+ ChildProperty(name="elements", description="the configuration of this sandbox", child_tag_names=[
10
+ "element"
11
+ ]),
12
+ ]),
13
+
14
+ ElementType(tag_name="element", description="an element inside the document", properties=[
15
+ ValueProperty(name="tag_name", description="the tag name used by this element. Element names are case-sensitive. Element names cannot contain spaces. Element names must start with a letter or underscore. Element names cannot start with the letters xml (or XML, or Xml, etc) Element names can contain letters, digits, hyphens, underscores, and periods.", type="string"),
16
+ ChildProperty(name="schema", description="the attributes of this node", child_tag_names=[
17
+ "attribute", "child_elements"
18
+ ]),
19
+ ValueProperty(name="description", type="string"),
20
+ ]),
21
+
22
+ ElementType(tag_name="attribute", properties=[
23
+ ValueProperty(name="name", description="the attribute name. Attribute names are case-sensitive. Attribute names cannot contain spaces. Attribute names must start with a letter or underscore. Attribute names cannot start with the letters xml (or XML, or Xml, etc) Attribute names can contain letters, digits, hyphens, underscores, and periods.", type="string"),
24
+ ValueProperty(name="type", description="the type of value stored by this attribute", type="string", enum= [ "string", "boolean", "number" ]),
25
+ ValueProperty(name="description", type="string"),
26
+ ]),
27
+
28
+ ElementType(tag_name="child_elements", properties=[
29
+ ValueProperty(name="name", description="the name of the property to store the children in. Propterty names cannot contain spaces. Propterty names must start with a letter or underscore. Propterty names cannot start with the letters xml (or XML, or Xml, etc) Propterty names can contain letters, digits, hyphens, and underscores.", type="string"),
30
+ ValueProperty(name="description", type="string"),
31
+ ChildProperty(name="children", description="the tag name of an element. The element must have a corresponding element definition under the schema elements", child_tag_names=["element_reference"]),
32
+ ]),
33
+
34
+ ElementType(tag_name="element_reference", description="an allowed child element for an element, should only used when a schema can contain multiple items of a specific type", properties=[
35
+ ValueProperty(name="tag_name", description="the tag name of an element. The element must have a corresponding element definition under the schema elements", type="string"),
36
+ ]),
37
+ ],
38
+ )
39
+
40
+ def schema_from_schema_document(document: Document):
41
+ root_tag_name = document.root["root_tag_name"]
42
+
43
+ elements = list[ElementType]()
44
+
45
+ for element in document.root.get_children():
46
+
47
+ properties = list[ElementProperty]()
48
+
49
+ for prop in element.get_children():
50
+ name = prop["name"]
51
+ description = prop["description"]
52
+ type = prop["type"]
53
+
54
+ if prop.tag_name == "attribute":
55
+ properties.append(ValueProperty(
56
+ name = name,
57
+ type = type,
58
+ description = description
59
+ ))
60
+ elif prop.tag_name == "child_elements":
61
+ child_tag_names = []
62
+
63
+ for child in prop.get_children():
64
+ child_tag_names.append(child["tag_name"])
65
+
66
+ properties.append(ChildProperty(
67
+ name=name,
68
+ child_tag_names = child_tag_names
69
+ ))
70
+
71
+ et = ElementType(tag_name = element["tag_name"], properties = properties, description = element["description"])
72
+ elements.append(et)
73
+
74
+ doc = MeshSchema(root_tag_name=root_tag_name, elements=elements)
75
+ return doc
@@ -0,0 +1,47 @@
1
+ from meshagent.api.schema import MeshSchema, ElementType, ChildProperty, ValueProperty, SimpleValue
2
+
3
+ super_editor_document_schema = MeshSchema(root_tag_name='document', elements=[
4
+ ElementType(
5
+ tag_name='document',
6
+ description='A SuperEditor document for use with Flutter apps',
7
+ properties=[
8
+ ChildProperty(name='children', child_tag_names=[
9
+ 'block',
10
+ 'horizontalRule',
11
+ 'image',
12
+ ]),
13
+ ],
14
+ ),
15
+ ElementType(
16
+ tag_name='block',
17
+ description='Block element - this can be a paragraph, list-item or tasks',
18
+ properties=[
19
+ ValueProperty(name='blockType', type="string"),
20
+ ValueProperty(name='textAlign', type="string"),
21
+ ValueProperty(name='itemType', type="string"),
22
+ ValueProperty(name='indent', type="number"),
23
+ ChildProperty(name='children', child_tag_names= ['text']),
24
+ ],
25
+ ),
26
+ ElementType(
27
+ tag_name='image',
28
+ description='Image element',
29
+ properties=[
30
+ ValueProperty(name='imageUrl', type="string"),
31
+ ValueProperty(name='width', type="number"),
32
+ ValueProperty(name='height', type="number"),
33
+ ],
34
+ ),
35
+ ElementType(
36
+ tag_name='horizontalRule',
37
+ description='Horizontal rule element',
38
+ properties=[],
39
+ ),
40
+ ElementType(
41
+ tag_name='text',
42
+ description='Text element',
43
+ properties=[
44
+ ValueProperty(name='text', type="string"),
45
+ ],
46
+ ),
47
+ ])
@@ -11,7 +11,7 @@ async def generate_json(*, on_behalf_of: Optional[Participant] = None, room: Roo
11
11
  for i in range(10):
12
12
  agents = await room.agents.list_agents()
13
13
  for a in agents:
14
- if a.name == "meshagent.planning_responder":
14
+ if a.name == "meshagent.schema_planner":
15
15
  agent = a
16
16
  break
17
17
 
@@ -21,7 +21,7 @@ async def generate_json(*, on_behalf_of: Optional[Participant] = None, room: Roo
21
21
  await asyncio.sleep(1)
22
22
 
23
23
  if agent == None:
24
- raise RoomException("unable to locate required agent (meshagent.planning_responder)")
24
+ raise RoomException("unable to locate required agent (meshagent.schema_planner)")
25
25
 
26
26
 
27
27
  if prompt == None:
@@ -30,7 +30,7 @@ async def generate_json(*, on_behalf_of: Optional[Participant] = None, room: Roo
30
30
  validate_openai_schema(output_schema)
31
31
  return await room.agents.ask(
32
32
  on_behalf_of=on_behalf_of,
33
- agent="meshagent.planning_responder",
33
+ agent="meshagent.schema_planner",
34
34
  requires = requires,
35
35
  arguments = {
36
36
  "prompt": prompt,
@@ -0,0 +1 @@
1
+ __version__ = "0.0.16"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-agents
3
- Version: 0.0.14
3
+ Version: 0.0.16
4
4
  Summary: Agent Building Blocks for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://meshagent.com
@@ -12,9 +12,9 @@ License-File: LICENSE
12
12
  Requires-Dist: pyjwt~=2.10.1
13
13
  Requires-Dist: pytest~=8.3.5
14
14
  Requires-Dist: pytest-asyncio~=0.26.0
15
- Requires-Dist: meshagent-api~=0.0.14
16
- Requires-Dist: meshagent-tools~=0.0.14
17
- Requires-Dist: meshagent-openai~=0.0.14
15
+ Requires-Dist: meshagent-api~=0.0.16
16
+ Requires-Dist: meshagent-tools~=0.0.16
17
+ Requires-Dist: meshagent-openai~=0.0.16
18
18
  Requires-Dist: pydantic~=2.11.1
19
19
  Requires-Dist: pydantic-ai~=0.0.48
20
20
  Requires-Dist: chonkie~=0.5.1
@@ -21,6 +21,12 @@ meshagent/agents/utils.py
21
21
  meshagent/agents/version.py
22
22
  meshagent/agents/worker.py
23
23
  meshagent/agents/writer.py
24
+ meshagent/agents/schemas/__init__.py
25
+ meshagent/agents/schemas/document.py
26
+ meshagent/agents/schemas/gallery.py
27
+ meshagent/agents/schemas/presentation.py
28
+ meshagent/agents/schemas/schema.py
29
+ meshagent/agents/schemas/super_editor_document.py
24
30
  meshagent_agents.egg-info/PKG-INFO
25
31
  meshagent_agents.egg-info/SOURCES.txt
26
32
  meshagent_agents.egg-info/dependency_links.txt
@@ -1,9 +1,9 @@
1
1
  pyjwt~=2.10.1
2
2
  pytest~=8.3.5
3
3
  pytest-asyncio~=0.26.0
4
- meshagent-api~=0.0.14
5
- meshagent-tools~=0.0.14
6
- meshagent-openai~=0.0.14
4
+ meshagent-api~=0.0.16
5
+ meshagent-tools~=0.0.16
6
+ meshagent-openai~=0.0.16
7
7
  pydantic~=2.11.1
8
8
  pydantic-ai~=0.0.48
9
9
  chonkie~=0.5.1
@@ -17,9 +17,9 @@ dependencies = [
17
17
  "pyjwt~=2.10.1",
18
18
  "pytest~=8.3.5",
19
19
  "pytest-asyncio~=0.26.0",
20
- "meshagent-api~=0.0.14",
21
- "meshagent-tools~=0.0.14",
22
- "meshagent-openai~=0.0.14",
20
+ "meshagent-api~=0.0.16",
21
+ "meshagent-tools~=0.0.16",
22
+ "meshagent-openai~=0.0.16",
23
23
  "pydantic~=2.11.1",
24
24
  "pydantic-ai~=0.0.48",
25
25
  "chonkie~=0.5.1",
@@ -1 +0,0 @@
1
- __version__ = "0.0.14"