meshagent-agents 0.0.37__py3-none-any.whl → 0.0.39__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-agents might be problematic. Click here for more details.
- meshagent/agents/__init__.py +27 -2
- meshagent/agents/adapter.py +18 -9
- meshagent/agents/agent.py +317 -214
- meshagent/agents/chat.py +392 -267
- meshagent/agents/context.py +58 -30
- meshagent/agents/development.py +11 -13
- meshagent/agents/hosting.py +109 -46
- meshagent/agents/indexer.py +241 -224
- meshagent/agents/listener.py +55 -52
- meshagent/agents/mail.py +145 -109
- meshagent/agents/planning.py +294 -199
- meshagent/agents/prompt.py +14 -12
- meshagent/agents/pydantic.py +98 -61
- meshagent/agents/schemas/__init__.py +11 -0
- meshagent/agents/schemas/document.py +32 -21
- meshagent/agents/schemas/gallery.py +23 -14
- meshagent/agents/schemas/presentation.py +33 -17
- meshagent/agents/schemas/schema.py +99 -45
- meshagent/agents/schemas/super_editor_document.py +52 -46
- meshagent/agents/single_shot_writer.py +37 -31
- meshagent/agents/thread_schema.py +74 -32
- meshagent/agents/utils.py +20 -12
- meshagent/agents/version.py +1 -1
- meshagent/agents/worker.py +48 -28
- meshagent/agents/writer.py +36 -23
- meshagent_agents-0.0.39.dist-info/METADATA +64 -0
- meshagent_agents-0.0.39.dist-info/RECORD +30 -0
- meshagent_agents-0.0.37.dist-info/METADATA +0 -36
- meshagent_agents-0.0.37.dist-info/RECORD +0 -30
- {meshagent_agents-0.0.37.dist-info → meshagent_agents-0.0.39.dist-info}/WHEEL +0 -0
- {meshagent_agents-0.0.37.dist-info → meshagent_agents-0.0.39.dist-info}/licenses/LICENSE +0 -0
- {meshagent_agents-0.0.37.dist-info → meshagent_agents-0.0.39.dist-info}/top_level.txt +0 -0
meshagent/agents/__init__.py
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
|
-
from .agent import
|
|
1
|
+
from .agent import (
|
|
2
|
+
Agent,
|
|
3
|
+
AgentCallContext,
|
|
4
|
+
AgentChatContext,
|
|
5
|
+
RequiredToolkit,
|
|
6
|
+
TaskRunner,
|
|
7
|
+
SingleRoomAgent,
|
|
8
|
+
)
|
|
2
9
|
from .development import connect_development_agent
|
|
3
10
|
from .listener import Listener, ListenerContext
|
|
4
11
|
from .hosting import RemoteTaskRunnerServer
|
|
5
12
|
from .adapter import ToolResponseAdapter, LLMAdapter
|
|
6
13
|
from .thread_schema import thread_schema
|
|
7
|
-
from .version import __version__
|
|
14
|
+
from .version import __version__
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
Agent,
|
|
19
|
+
AgentCallContext,
|
|
20
|
+
AgentChatContext,
|
|
21
|
+
RequiredToolkit,
|
|
22
|
+
TaskRunner,
|
|
23
|
+
SingleRoomAgent,
|
|
24
|
+
connect_development_agent,
|
|
25
|
+
Listener,
|
|
26
|
+
ListenerContext,
|
|
27
|
+
RemoteTaskRunnerServer,
|
|
28
|
+
ToolResponseAdapter,
|
|
29
|
+
LLMAdapter,
|
|
30
|
+
thread_schema,
|
|
31
|
+
__version__,
|
|
32
|
+
]
|
meshagent/agents/adapter.py
CHANGED
|
@@ -7,40 +7,49 @@ from typing import Any, Optional, Callable, TypeVar, Generic
|
|
|
7
7
|
|
|
8
8
|
T = TypeVar("T")
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
class ToolResponseAdapter(ABC):
|
|
11
12
|
def __init__(self):
|
|
12
13
|
pass
|
|
13
|
-
|
|
14
|
+
|
|
14
15
|
@abstractmethod
|
|
15
16
|
async def to_plain_text(self, *, room: RoomClient, response: Response):
|
|
16
17
|
pass
|
|
17
18
|
|
|
18
19
|
@abstractmethod
|
|
19
|
-
async def create_messages(
|
|
20
|
+
async def create_messages(
|
|
21
|
+
self,
|
|
22
|
+
*,
|
|
23
|
+
context: AgentChatContext,
|
|
24
|
+
tool_call: Any,
|
|
25
|
+
room: RoomClient,
|
|
26
|
+
response: Response,
|
|
27
|
+
) -> list:
|
|
20
28
|
pass
|
|
21
29
|
|
|
22
30
|
|
|
23
31
|
class LLMAdapter(Generic[T]):
|
|
24
|
-
|
|
25
32
|
def create_chat_context(self) -> AgentChatContext:
|
|
26
33
|
return AgentChatContext()
|
|
27
|
-
|
|
34
|
+
|
|
28
35
|
@abstractmethod
|
|
29
|
-
async def check_for_termination(
|
|
36
|
+
async def check_for_termination(
|
|
37
|
+
self, *, context: AgentChatContext, room: RoomClient
|
|
38
|
+
):
|
|
30
39
|
return True
|
|
31
40
|
|
|
32
41
|
@abstractmethod
|
|
33
|
-
async def next(
|
|
42
|
+
async def next(
|
|
43
|
+
self,
|
|
34
44
|
*,
|
|
35
45
|
context: AgentChatContext,
|
|
36
46
|
room: RoomClient,
|
|
37
47
|
toolkits: Toolkit,
|
|
38
48
|
tool_adapter: Optional[ToolResponseAdapter] = None,
|
|
39
49
|
output_schema: Optional[dict] = None,
|
|
40
|
-
event_handler: Optional[Callable[[T],None]] = None
|
|
41
|
-
) -> Any:
|
|
50
|
+
event_handler: Optional[Callable[[T], None]] = None,
|
|
51
|
+
) -> Any:
|
|
42
52
|
pass
|
|
43
53
|
|
|
44
54
|
def validate(response: dict, output_schema: dict):
|
|
45
55
|
validate(response, output_schema)
|
|
46
|
-
|