pybotchi 3.4.1__tar.gz → 3.4.3__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.
- {pybotchi-3.4.1 → pybotchi-3.4.3}/PKG-INFO +1 -1
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/action.py +4 -4
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/action.pyi +10 -2
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/context.pyi +1 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/action.pyi +1 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/context.pyi +3 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/exception.pyi +1 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/pybotchi_pb2.pyi +2 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/pybotchi_pb2_grpc.pyi +1 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/action.py +7 -1
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/action.pyi +1 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/common.py +0 -5
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/common.pyi +0 -3
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pyproject.toml +1 -1
- {pybotchi-3.4.1 → pybotchi-3.4.3}/LICENSE +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/README.md +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/__init__.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/__init__.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/common.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/common.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/context.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/__init__.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/__init__.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/action.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/cli.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/cli.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/common.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/common.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/context.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/exception.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/handler.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/handler.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/pybotchi.proto +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/pybotchi_pb2.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/pybotchi_pb2_grpc.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/utils.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/grpc/utils.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/llm.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/llm.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/__init__.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/__init__.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/context.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/mcp/context.pyi +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/py.typed +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/utils.py +0 -0
- {pybotchi-3.4.1 → pybotchi-3.4.3}/pybotchi/utils.pyi +0 -0
|
@@ -7,7 +7,7 @@ from collections import deque
|
|
|
7
7
|
from collections.abc import Generator
|
|
8
8
|
from inspect import getmembers
|
|
9
9
|
from os import getenv
|
|
10
|
-
from typing import Any, Generic, TYPE_CHECKING, TypeVar
|
|
10
|
+
from typing import Any, Generic, Literal, TYPE_CHECKING, TypeVar
|
|
11
11
|
|
|
12
12
|
from pydantic import BaseModel, PrivateAttr
|
|
13
13
|
|
|
@@ -503,13 +503,13 @@ class Action(BaseModel, Generic[TContext]):
|
|
|
503
503
|
|
|
504
504
|
return ActionReturn.GO
|
|
505
505
|
|
|
506
|
-
def serialize(self) -> ActionEntry:
|
|
506
|
+
def serialize(self, mode: str | Literal["python", "json"] = "python") -> ActionEntry:
|
|
507
507
|
"""Serialize Action."""
|
|
508
508
|
return {
|
|
509
509
|
"name": self.__class__.__name__,
|
|
510
|
-
"args": self.model_dump(),
|
|
510
|
+
"args": self.model_dump(mode=mode),
|
|
511
511
|
"usages": self._usage,
|
|
512
|
-
"actions": [a.serialize() if isinstance(a, Action) else a for a in self._actions],
|
|
512
|
+
"actions": [a.serialize(mode) if isinstance(a, Action) else a for a in self._actions],
|
|
513
513
|
}
|
|
514
514
|
|
|
515
515
|
####################################################################################################
|
|
@@ -4,7 +4,7 @@ from .utils import apply_placeholders as apply_placeholders, unwrap_exceptions a
|
|
|
4
4
|
from _typeshed import Incomplete
|
|
5
5
|
from collections.abc import Generator
|
|
6
6
|
from pydantic import BaseModel
|
|
7
|
-
from typing import Any, Generic, TypeVar
|
|
7
|
+
from typing import Any, Generic, Literal, TypeVar
|
|
8
8
|
|
|
9
9
|
DEFAULT_ACTION: Incomplete
|
|
10
10
|
DEFAULT_TOOL_CALL_PROMPT: Incomplete
|
|
@@ -38,10 +38,18 @@ class Action(BaseModel, Generic[TContext]):
|
|
|
38
38
|
__display_name__: str
|
|
39
39
|
__groups__: Groups | set[str] | None
|
|
40
40
|
__to_commit__: bool
|
|
41
|
+
_usage: list[UsageData]
|
|
42
|
+
_actions: list[Action | ActionEntry]
|
|
43
|
+
_parent: Action | None
|
|
44
|
+
_children: list['Action']
|
|
41
45
|
@classmethod
|
|
42
46
|
def __pydantic_init_subclass__(cls, **kwargs: Any) -> None: ...
|
|
43
47
|
@classmethod
|
|
44
48
|
def __init_child_actions__(cls) -> None: ...
|
|
49
|
+
@property
|
|
50
|
+
def _tool_call(self) -> ToolCall: ...
|
|
51
|
+
@classmethod
|
|
52
|
+
async def _as_tool(cls, context: TContext) -> dict[str, Any] | type[BaseModel]: ...
|
|
45
53
|
async def pre(self, context: TContext) -> ActionReturn: ...
|
|
46
54
|
async def fallback(self, context: TContext, content: str) -> ActionReturn: ...
|
|
47
55
|
async def on_child_init_error(self, context: TContext, next_actions: list['Action'], child_cls: type[Action], child_args: dict[str, Any], exception: Exception) -> str | None: ...
|
|
@@ -58,7 +66,7 @@ class Action(BaseModel, Generic[TContext]):
|
|
|
58
66
|
async def execution(self, context: TContext) -> ActionReturn: ...
|
|
59
67
|
async def concurrent_children_execution(self, context: TContext, next_actions: list[Action]) -> ActionReturn: ...
|
|
60
68
|
async def sequential_children_execution(self, context: TContext, next_actions: list[Action]) -> ActionReturn: ...
|
|
61
|
-
def serialize(self) -> ActionEntry: ...
|
|
69
|
+
def serialize(self, mode: str | Literal['python', 'json'] = 'python') -> ActionEntry: ...
|
|
62
70
|
@classmethod
|
|
63
71
|
def add_child(cls, action: type['Action'], name: str | None = None, override: bool = False, extended: bool = True) -> None: ...
|
|
64
72
|
@classmethod
|
|
@@ -36,6 +36,7 @@ class GRPCAction(Action[TContext], Generic[TContext]):
|
|
|
36
36
|
@classmethod
|
|
37
37
|
def __init_child_actions__(cls) -> None: ...
|
|
38
38
|
async def pre_grpc(self, context: TContext) -> ActionReturn: ...
|
|
39
|
+
_parent: Incomplete
|
|
39
40
|
__to_commit__: bool
|
|
40
41
|
async def execute(self, context: TContext, parent: Action | None = None, append: bool = True) -> ActionReturn: ...
|
|
41
42
|
async def get_child_actions(self, context: TContext) -> ChildActions: ...
|
|
@@ -3,6 +3,7 @@ from ..context import Action as Action, ChatRole as ChatRole, Context as Context
|
|
|
3
3
|
from ..utils import uuid as uuid
|
|
4
4
|
from .common import GRPCIntegration as GRPCIntegration
|
|
5
5
|
from .pybotchi_pb2 import Event as Event
|
|
6
|
+
from asyncio import Queue
|
|
6
7
|
from typing import Any, Generic, TypeVar
|
|
7
8
|
|
|
8
9
|
TContext = TypeVar('TContext', bound='GRPCContext')
|
|
@@ -11,6 +12,8 @@ class GRPCContext(Context[TLLM], Generic[TLLM]):
|
|
|
11
12
|
integrations: dict[str, GRPCIntegration]
|
|
12
13
|
source_id: str | None
|
|
13
14
|
context_id: str
|
|
15
|
+
_response_queue: Queue[Event] | None
|
|
16
|
+
_request_queues: dict[str, Queue]
|
|
14
17
|
def grpc_dump(self) -> dict[str, Any]: ...
|
|
15
18
|
def grpc_sharing_dump(self) -> dict[str, Any]: ...
|
|
16
19
|
async def grpc_send_up(self, source_id: str | None, name: str, data: dict[str, Any]) -> None: ...
|
|
@@ -402,7 +402,13 @@ async def multi_mcp_clients(
|
|
|
402
402
|
)
|
|
403
403
|
else:
|
|
404
404
|
async_client = await stack.enter_async_context(
|
|
405
|
-
AsyncClient(
|
|
405
|
+
AsyncClient(
|
|
406
|
+
base_url=overrided_config["url"],
|
|
407
|
+
headers=overrided_config["headers"],
|
|
408
|
+
timeout=overrided_config["timeout"],
|
|
409
|
+
**overrided_config["async_client_args"],
|
|
410
|
+
follow_redirects=True,
|
|
411
|
+
)
|
|
406
412
|
)
|
|
407
413
|
|
|
408
414
|
streams = await stack.enter_async_context(
|
|
@@ -38,6 +38,7 @@ class MCPAction(Action[TContext], Generic[TContext]):
|
|
|
38
38
|
@classmethod
|
|
39
39
|
def __init_child_actions__(cls) -> None: ...
|
|
40
40
|
async def pre_mcp(self, context: TContext) -> ActionReturn: ...
|
|
41
|
+
_parent: Incomplete
|
|
41
42
|
__to_commit__: bool
|
|
42
43
|
async def execute(self, context: TContext, parent: Action | None = None, append: bool = True) -> ActionReturn: ...
|
|
43
44
|
async def get_child_actions(self, context: TContext) -> ChildActions: ...
|
|
@@ -35,18 +35,13 @@ class AsyncClientArgs(TypedDict, total=False):
|
|
|
35
35
|
| bytes
|
|
36
36
|
| None
|
|
37
37
|
)
|
|
38
|
-
headers: (
|
|
39
|
-
Mapping[str, str] | Mapping[bytes, bytes] | Sequence[tuple[str, str]] | Sequence[tuple[bytes, bytes]] | None
|
|
40
|
-
)
|
|
41
38
|
cookies: dict[str, str] | list[tuple[str, str]] | None
|
|
42
39
|
verify: str | bool
|
|
43
40
|
cert: CertTypes | None
|
|
44
41
|
http1: bool
|
|
45
42
|
http2: bool
|
|
46
43
|
proxy: str | None
|
|
47
|
-
timeout: float | None | tuple[float | None, float | None, float | None, float | None] | None
|
|
48
44
|
max_redirects: int
|
|
49
|
-
base_url: str
|
|
50
45
|
trust_env: bool
|
|
51
46
|
default_encoding: str
|
|
52
47
|
|
|
@@ -14,16 +14,13 @@ class MCPMode(StrEnum):
|
|
|
14
14
|
class AsyncClientArgs(TypedDict, total=False):
|
|
15
15
|
auth: tuple[str | bytes, str | bytes] | None
|
|
16
16
|
params: Mapping[str, PrimitiveData | Sequence[PrimitiveData]] | list[tuple[str, PrimitiveData]] | tuple[tuple[str, PrimitiveData], ...] | str | bytes | None
|
|
17
|
-
headers: Mapping[str, str] | Mapping[bytes, bytes] | Sequence[tuple[str, str]] | Sequence[tuple[bytes, bytes]] | None
|
|
18
17
|
cookies: dict[str, str] | list[tuple[str, str]] | None
|
|
19
18
|
verify: str | bool
|
|
20
19
|
cert: CertTypes | None
|
|
21
20
|
http1: bool
|
|
22
21
|
http2: bool
|
|
23
22
|
proxy: str | None
|
|
24
|
-
timeout: float | None | tuple[float | None, float | None, float | None, float | None] | None
|
|
25
23
|
max_redirects: int
|
|
26
|
-
base_url: str
|
|
27
24
|
trust_env: bool
|
|
28
25
|
default_encoding: str
|
|
29
26
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|