grasp_agents 0.1.5__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.
- grasp_agents-0.1.5/.gitignore +174 -0
- grasp_agents-0.1.5/LICENSE +21 -0
- grasp_agents-0.1.5/PKG-INFO +14 -0
- grasp_agents-0.1.5/README.md +1 -0
- grasp_agents-0.1.5/pyproject.toml +43 -0
- grasp_agents-0.1.5/src/grasp_agents/agent_message.py +28 -0
- grasp_agents-0.1.5/src/grasp_agents/agent_message_pool.py +94 -0
- grasp_agents-0.1.5/src/grasp_agents/base_agent.py +72 -0
- grasp_agents-0.1.5/src/grasp_agents/cloud_llm.py +353 -0
- grasp_agents-0.1.5/src/grasp_agents/comm_agent.py +230 -0
- grasp_agents-0.1.5/src/grasp_agents/costs_dict.yaml +122 -0
- grasp_agents-0.1.5/src/grasp_agents/data_retrieval/__init__.py +7 -0
- grasp_agents-0.1.5/src/grasp_agents/data_retrieval/rate_limiter_chunked.py +195 -0
- grasp_agents-0.1.5/src/grasp_agents/data_retrieval/types.py +57 -0
- grasp_agents-0.1.5/src/grasp_agents/data_retrieval/utils.py +57 -0
- grasp_agents-0.1.5/src/grasp_agents/grasp_logging.py +36 -0
- grasp_agents-0.1.5/src/grasp_agents/http_client.py +24 -0
- grasp_agents-0.1.5/src/grasp_agents/llm.py +106 -0
- grasp_agents-0.1.5/src/grasp_agents/llm_agent.py +361 -0
- grasp_agents-0.1.5/src/grasp_agents/llm_agent_state.py +73 -0
- grasp_agents-0.1.5/src/grasp_agents/memory.py +150 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/__init__.py +83 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/completion_converters.py +49 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/content_converters.py +80 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/converters.py +170 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/message_converters.py +155 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/openai_llm.py +179 -0
- grasp_agents-0.1.5/src/grasp_agents/openai/tool_converters.py +37 -0
- grasp_agents-0.1.5/src/grasp_agents/printer.py +156 -0
- grasp_agents-0.1.5/src/grasp_agents/prompt_builder.py +204 -0
- grasp_agents-0.1.5/src/grasp_agents/run_context.py +90 -0
- grasp_agents-0.1.5/src/grasp_agents/tool_orchestrator.py +181 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/__init__.py +0 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/completion.py +30 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/content.py +116 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/converters.py +118 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/io.py +32 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/message.py +130 -0
- grasp_agents-0.1.5/src/grasp_agents/typing/tool.py +52 -0
- grasp_agents-0.1.5/src/grasp_agents/usage_tracker.py +99 -0
- grasp_agents-0.1.5/src/grasp_agents/utils.py +151 -0
- grasp_agents-0.1.5/src/grasp_agents/workflow/__init__.py +0 -0
- grasp_agents-0.1.5/src/grasp_agents/workflow/looped_agent.py +113 -0
- grasp_agents-0.1.5/src/grasp_agents/workflow/sequential_agent.py +57 -0
- grasp_agents-0.1.5/src/grasp_agents/workflow/workflow_agent.py +69 -0
@@ -0,0 +1,174 @@
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
2
|
+
__pycache__/
|
3
|
+
*.py[cod]
|
4
|
+
*$py.class
|
5
|
+
|
6
|
+
# C extensions
|
7
|
+
*.so
|
8
|
+
|
9
|
+
# Distribution / packaging
|
10
|
+
.Python
|
11
|
+
build/
|
12
|
+
develop-eggs/
|
13
|
+
dist/
|
14
|
+
downloads/
|
15
|
+
eggs/
|
16
|
+
.eggs/
|
17
|
+
lib/
|
18
|
+
lib64/
|
19
|
+
parts/
|
20
|
+
sdist/
|
21
|
+
var/
|
22
|
+
wheels/
|
23
|
+
share/python-wheels/
|
24
|
+
*.egg-info/
|
25
|
+
.installed.cfg
|
26
|
+
*.egg
|
27
|
+
MANIFEST
|
28
|
+
|
29
|
+
# PyInstaller
|
30
|
+
# Usually these files are written by a python script from a template
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32
|
+
*.manifest
|
33
|
+
*.spec
|
34
|
+
|
35
|
+
# Installer logs
|
36
|
+
pip-log.txt
|
37
|
+
pip-delete-this-directory.txt
|
38
|
+
|
39
|
+
# Unit test / coverage reports
|
40
|
+
htmlcov/
|
41
|
+
.tox/
|
42
|
+
.nox/
|
43
|
+
.coverage
|
44
|
+
.coverage.*
|
45
|
+
.cache
|
46
|
+
nosetests.xml
|
47
|
+
coverage.xml
|
48
|
+
*.cover
|
49
|
+
*.py,cover
|
50
|
+
.hypothesis/
|
51
|
+
.pytest_cache/
|
52
|
+
cover/
|
53
|
+
|
54
|
+
# Translations
|
55
|
+
*.mo
|
56
|
+
*.pot
|
57
|
+
|
58
|
+
# Django stuff:
|
59
|
+
*.log
|
60
|
+
local_settings.py
|
61
|
+
db.sqlite3
|
62
|
+
db.sqlite3-journal
|
63
|
+
|
64
|
+
# Flask stuff:
|
65
|
+
instance/
|
66
|
+
.webassets-cache
|
67
|
+
|
68
|
+
# Scrapy stuff:
|
69
|
+
.scrapy
|
70
|
+
|
71
|
+
# Sphinx documentation
|
72
|
+
docs/_build/
|
73
|
+
|
74
|
+
# PyBuilder
|
75
|
+
.pybuilder/
|
76
|
+
target/
|
77
|
+
|
78
|
+
# Jupyter Notebook
|
79
|
+
.ipynb_checkpoints
|
80
|
+
|
81
|
+
# IPython
|
82
|
+
profile_default/
|
83
|
+
ipython_config.py
|
84
|
+
|
85
|
+
# pyenv
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
88
|
+
# .python-version
|
89
|
+
|
90
|
+
# pipenv
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94
|
+
# install all needed dependencies.
|
95
|
+
#Pipfile.lock
|
96
|
+
|
97
|
+
# UV
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
100
|
+
# commonly ignored for libraries.
|
101
|
+
#uv.lock
|
102
|
+
|
103
|
+
# poetry
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
106
|
+
# commonly ignored for libraries.
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
108
|
+
#poetry.lock
|
109
|
+
|
110
|
+
# pdm
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
112
|
+
#pdm.lock
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
114
|
+
# in version control.
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
116
|
+
.pdm.toml
|
117
|
+
.pdm-python
|
118
|
+
.pdm-build/
|
119
|
+
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
121
|
+
__pypackages__/
|
122
|
+
|
123
|
+
# Celery stuff
|
124
|
+
celerybeat-schedule
|
125
|
+
celerybeat.pid
|
126
|
+
|
127
|
+
# SageMath parsed files
|
128
|
+
*.sage.py
|
129
|
+
|
130
|
+
# Environments
|
131
|
+
.env
|
132
|
+
.venv
|
133
|
+
env/
|
134
|
+
venv/
|
135
|
+
ENV/
|
136
|
+
env.bak/
|
137
|
+
venv.bak/
|
138
|
+
|
139
|
+
# Spyder project settings
|
140
|
+
.spyderproject
|
141
|
+
.spyproject
|
142
|
+
|
143
|
+
# Rope project settings
|
144
|
+
.ropeproject
|
145
|
+
|
146
|
+
# mkdocs documentation
|
147
|
+
/site
|
148
|
+
|
149
|
+
# mypy
|
150
|
+
.mypy_cache/
|
151
|
+
.dmypy.json
|
152
|
+
dmypy.json
|
153
|
+
|
154
|
+
# Pyre type checker
|
155
|
+
.pyre/
|
156
|
+
|
157
|
+
# pytype static type analyzer
|
158
|
+
.pytype/
|
159
|
+
|
160
|
+
# Cython debug symbols
|
161
|
+
cython_debug/
|
162
|
+
|
163
|
+
# PyCharm
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
168
|
+
#.idea/
|
169
|
+
|
170
|
+
# Ruff stuff:
|
171
|
+
.ruff_cache/
|
172
|
+
|
173
|
+
# PyPI configuration file
|
174
|
+
.pypirc
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Grasp
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: grasp_agents
|
3
|
+
Version: 0.1.5
|
4
|
+
Summary: Add your description here
|
5
|
+
License-File: LICENSE
|
6
|
+
Requires-Python: <3.12,>=3.11.4
|
7
|
+
Requires-Dist: httpx<1,>=0.27.0
|
8
|
+
Requires-Dist: openai<2,>=1.68.2
|
9
|
+
Requires-Dist: tenacity>=9.1.2
|
10
|
+
Requires-Dist: termcolor<3,>=2.4.0
|
11
|
+
Requires-Dist: tqdm<5,>=4.66.2
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
# grasp-agents
|
@@ -0,0 +1 @@
|
|
1
|
+
# grasp-agents
|
@@ -0,0 +1,43 @@
|
|
1
|
+
[project]
|
2
|
+
name = "grasp_agents"
|
3
|
+
version = "0.1.5"
|
4
|
+
description = "Add your description here"
|
5
|
+
readme = "README.md"
|
6
|
+
requires-python = ">=3.11.4,<3.12"
|
7
|
+
dependencies = [
|
8
|
+
"httpx>=0.27.0,<1",
|
9
|
+
"openai>=1.68.2,<2",
|
10
|
+
"tenacity>=9.1.2",
|
11
|
+
"termcolor>=2.4.0,<3",
|
12
|
+
"tqdm>=4.66.2,<5",
|
13
|
+
]
|
14
|
+
|
15
|
+
[dependency-groups]
|
16
|
+
dev = [
|
17
|
+
"dotenv>=0.9.9",
|
18
|
+
"ipython>=8.3.0,<9",
|
19
|
+
"ipykernel>=6.19.1,<7",
|
20
|
+
"ipywidgets>=8.0.4,<9",
|
21
|
+
"widgetsnbextension>=4.0.5,<5",
|
22
|
+
"tk>=0.1.0,<0.2",
|
23
|
+
"types-cachetools>=5.0.1,<6",
|
24
|
+
"keyring>=24.2.0,<25",
|
25
|
+
"pydantic>=2",
|
26
|
+
"pre-commit-uv>=4.1.4",
|
27
|
+
"twine>=5.1.1,<6",
|
28
|
+
"keyrings-google-artifactregistry-auth>=1.1.2,<2",
|
29
|
+
"ruff>=0.11.8",
|
30
|
+
"pyright>=1.1.400",
|
31
|
+
]
|
32
|
+
|
33
|
+
[build-system]
|
34
|
+
requires = ["hatchling"]
|
35
|
+
build-backend = "hatchling.build"
|
36
|
+
|
37
|
+
[tool.hatch.build.targets.sdist]
|
38
|
+
include = ["src/grasp_agents"]
|
39
|
+
exclude = ["src/grasp_agents/examples", "*.ipynb"]
|
40
|
+
|
41
|
+
[tool.hatch.build.targets.wheel]
|
42
|
+
packages = ["src/grasp_agents"]
|
43
|
+
exclude = ["src/grasp_agents/examples", "*.ipynb"]
|
@@ -0,0 +1,28 @@
|
|
1
|
+
from collections.abc import Sequence
|
2
|
+
from typing import Generic, TypeVar
|
3
|
+
from uuid import uuid4
|
4
|
+
|
5
|
+
from pydantic import BaseModel, ConfigDict, Field
|
6
|
+
|
7
|
+
# from .base_agent import StateT
|
8
|
+
from .typing.io import AgentID, AgentPayload, AgentState
|
9
|
+
|
10
|
+
_PayloadT = TypeVar("_PayloadT", bound=AgentPayload, covariant=True) # noqa: PLC0105
|
11
|
+
_StateT = TypeVar("_StateT", bound=AgentState, covariant=True) # noqa: PLC0105
|
12
|
+
|
13
|
+
|
14
|
+
class AgentMessage(BaseModel, Generic[_PayloadT, _StateT]):
|
15
|
+
payloads: Sequence[_PayloadT]
|
16
|
+
sender_id: AgentID
|
17
|
+
sender_state: _StateT | None = None
|
18
|
+
recipient_ids: Sequence[AgentID] = Field(default_factory=list)
|
19
|
+
|
20
|
+
message_id: str = Field(default_factory=lambda: str(uuid4())[:8])
|
21
|
+
|
22
|
+
model_config = ConfigDict(extra="forbid", frozen=True)
|
23
|
+
|
24
|
+
def __repr__(self) -> str:
|
25
|
+
return (
|
26
|
+
f"From: {self.sender_id}, To: {', '.join(self.recipient_ids)}, "
|
27
|
+
f"Payloads: {len(self.payloads)}"
|
28
|
+
)
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import asyncio
|
2
|
+
import logging
|
3
|
+
from typing import Any, Generic, Protocol, TypeVar
|
4
|
+
|
5
|
+
from .agent_message import AgentMessage
|
6
|
+
from .run_context import CtxT, RunContextWrapper
|
7
|
+
from .typing.io import AgentID, AgentPayload, AgentState
|
8
|
+
|
9
|
+
logger = logging.getLogger(__name__)
|
10
|
+
|
11
|
+
|
12
|
+
_MH_PayloadT = TypeVar("_MH_PayloadT", bound=AgentPayload, contravariant=True) # noqa: PLC0105
|
13
|
+
_MH_StateT = TypeVar("_MH_StateT", bound=AgentState, contravariant=True) # noqa: PLC0105
|
14
|
+
|
15
|
+
|
16
|
+
class MessageHandler(Protocol[_MH_PayloadT, _MH_StateT, CtxT]):
|
17
|
+
async def __call__(
|
18
|
+
self,
|
19
|
+
message: AgentMessage[_MH_PayloadT, _MH_StateT],
|
20
|
+
ctx: RunContextWrapper[CtxT] | None,
|
21
|
+
**kwargs: Any,
|
22
|
+
) -> None: ...
|
23
|
+
|
24
|
+
|
25
|
+
class AgentMessagePool(Generic[CtxT]):
|
26
|
+
def __init__(self) -> None:
|
27
|
+
self._queues: dict[
|
28
|
+
AgentID, asyncio.Queue[AgentMessage[AgentPayload, AgentState]]
|
29
|
+
] = {}
|
30
|
+
self._message_handlers: dict[
|
31
|
+
AgentID, MessageHandler[AgentPayload, AgentState, CtxT]
|
32
|
+
] = {}
|
33
|
+
self._tasks: dict[AgentID, asyncio.Task[None]] = {}
|
34
|
+
|
35
|
+
async def post(self, message: AgentMessage[AgentPayload, AgentState]) -> None:
|
36
|
+
for recipient_id in message.recipient_ids:
|
37
|
+
queue = self._queues.setdefault(recipient_id, asyncio.Queue())
|
38
|
+
await queue.put(message)
|
39
|
+
|
40
|
+
def register_message_handler(
|
41
|
+
self,
|
42
|
+
agent_id: AgentID,
|
43
|
+
handler: MessageHandler[AgentPayload, AgentState, CtxT],
|
44
|
+
ctx: RunContextWrapper[CtxT] | None = None,
|
45
|
+
**run_kwargs: Any,
|
46
|
+
) -> None:
|
47
|
+
self._message_handlers[agent_id] = handler
|
48
|
+
self._queues.setdefault(agent_id, asyncio.Queue())
|
49
|
+
if agent_id not in self._tasks:
|
50
|
+
self._tasks[agent_id] = asyncio.create_task(
|
51
|
+
self._process_messages(agent_id, ctx=ctx, **run_kwargs)
|
52
|
+
)
|
53
|
+
|
54
|
+
async def _process_messages(
|
55
|
+
self,
|
56
|
+
agent_id: AgentID,
|
57
|
+
ctx: RunContextWrapper[CtxT] | None = None,
|
58
|
+
**run_kwargs: Any,
|
59
|
+
) -> None:
|
60
|
+
queue = self._queues[agent_id]
|
61
|
+
while True:
|
62
|
+
try:
|
63
|
+
message = await queue.get()
|
64
|
+
handler = self._message_handlers.get(agent_id)
|
65
|
+
if handler is None:
|
66
|
+
break
|
67
|
+
|
68
|
+
try:
|
69
|
+
await self._message_handlers[agent_id](
|
70
|
+
message, ctx=ctx, **run_kwargs
|
71
|
+
)
|
72
|
+
except Exception:
|
73
|
+
logger.exception(f"Error handling message for {agent_id}")
|
74
|
+
|
75
|
+
queue.task_done()
|
76
|
+
|
77
|
+
except Exception:
|
78
|
+
logger.exception(f"Unexpected error in processing loop for {agent_id}")
|
79
|
+
|
80
|
+
async def unregister_message_handler(self, agent_id: AgentID) -> None:
|
81
|
+
if task := self._tasks.get(agent_id):
|
82
|
+
task.cancel()
|
83
|
+
try:
|
84
|
+
await task
|
85
|
+
except asyncio.CancelledError:
|
86
|
+
logger.debug(f"{agent_id} exited")
|
87
|
+
|
88
|
+
self._tasks.pop(agent_id, None)
|
89
|
+
self._queues.pop(agent_id, None)
|
90
|
+
self._message_handlers.pop(agent_id, None)
|
91
|
+
|
92
|
+
async def stop_all(self) -> None:
|
93
|
+
for agent_id in list(self._tasks):
|
94
|
+
await self.unregister_message_handler(agent_id)
|
@@ -0,0 +1,72 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from typing import Any, Generic, Protocol
|
3
|
+
|
4
|
+
from pydantic import BaseModel
|
5
|
+
|
6
|
+
from .run_context import CtxT, RunContextWrapper
|
7
|
+
from .typing.io import AgentID, AgentPayload, OutT, StateT
|
8
|
+
from .typing.tool import BaseTool
|
9
|
+
|
10
|
+
|
11
|
+
class ParseOutputHandler(Protocol[OutT, CtxT]):
|
12
|
+
def __call__(
|
13
|
+
self, *args: Any, ctx: RunContextWrapper[CtxT] | None, **kwargs: Any
|
14
|
+
) -> OutT: ...
|
15
|
+
|
16
|
+
|
17
|
+
class BaseAgent(ABC, Generic[OutT, StateT, CtxT]):
|
18
|
+
@abstractmethod
|
19
|
+
def __init__(
|
20
|
+
self,
|
21
|
+
agent_id: AgentID,
|
22
|
+
*,
|
23
|
+
out_schema: type[OutT] = AgentPayload,
|
24
|
+
**kwargs: Any,
|
25
|
+
) -> None:
|
26
|
+
self._state: StateT
|
27
|
+
self._agent_id = agent_id
|
28
|
+
self._out_schema = out_schema
|
29
|
+
self._parse_output_impl: ParseOutputHandler[OutT, CtxT] | None = None
|
30
|
+
|
31
|
+
def parse_output_handler(
|
32
|
+
self, func: ParseOutputHandler[OutT, CtxT]
|
33
|
+
) -> ParseOutputHandler[OutT, CtxT]:
|
34
|
+
self._parse_output_impl = func
|
35
|
+
|
36
|
+
return func
|
37
|
+
|
38
|
+
def _parse_output(
|
39
|
+
self, *args: Any, ctx: RunContextWrapper[CtxT] | None = None, **kwargs: Any
|
40
|
+
) -> OutT:
|
41
|
+
if self._parse_output_impl:
|
42
|
+
return self._parse_output_impl(*args, ctx=ctx, **kwargs)
|
43
|
+
|
44
|
+
return self._out_schema()
|
45
|
+
|
46
|
+
@property
|
47
|
+
def agent_id(self) -> AgentID:
|
48
|
+
return self._agent_id
|
49
|
+
|
50
|
+
@property
|
51
|
+
def state(self) -> StateT:
|
52
|
+
return self._state
|
53
|
+
|
54
|
+
@property
|
55
|
+
def out_schema(self) -> type[OutT]:
|
56
|
+
return self._out_schema
|
57
|
+
|
58
|
+
@abstractmethod
|
59
|
+
async def run(
|
60
|
+
self,
|
61
|
+
inp_items: Any,
|
62
|
+
*,
|
63
|
+
ctx: RunContextWrapper[CtxT] | None = None,
|
64
|
+
**kwargs: Any,
|
65
|
+
) -> Any:
|
66
|
+
pass
|
67
|
+
|
68
|
+
@abstractmethod
|
69
|
+
def as_tool(
|
70
|
+
self, tool_name: str, tool_description: str, tool_strict: bool = True
|
71
|
+
) -> BaseTool[BaseModel, BaseModel, CtxT]:
|
72
|
+
pass
|