agentouto 0.2.0__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.
- agentouto-0.2.0/.github/workflows/ci.yml +33 -0
- agentouto-0.2.0/.github/workflows/publish.yml +33 -0
- agentouto-0.2.0/.gitignore +20 -0
- agentouto-0.2.0/LICENSE +190 -0
- agentouto-0.2.0/PKG-INFO +347 -0
- agentouto-0.2.0/README.md +331 -0
- agentouto-0.2.0/agentouto/__init__.py +24 -0
- agentouto-0.2.0/agentouto/_constants.py +4 -0
- agentouto-0.2.0/agentouto/agent.py +18 -0
- agentouto-0.2.0/agentouto/context.py +55 -0
- agentouto-0.2.0/agentouto/event_log.py +68 -0
- agentouto-0.2.0/agentouto/exceptions.py +36 -0
- agentouto-0.2.0/agentouto/message.py +14 -0
- agentouto-0.2.0/agentouto/provider.py +12 -0
- agentouto-0.2.0/agentouto/providers/__init__.py +61 -0
- agentouto-0.2.0/agentouto/providers/anthropic.py +132 -0
- agentouto-0.2.0/agentouto/providers/google.py +177 -0
- agentouto-0.2.0/agentouto/providers/openai.py +196 -0
- agentouto-0.2.0/agentouto/router.py +136 -0
- agentouto-0.2.0/agentouto/runtime.py +403 -0
- agentouto-0.2.0/agentouto/streaming.py +32 -0
- agentouto-0.2.0/agentouto/tool.py +62 -0
- agentouto-0.2.0/agentouto/tracing.py +87 -0
- agentouto-0.2.0/ai-docs/AI_INSTRUCTIONS.md +88 -0
- agentouto-0.2.0/ai-docs/ARCHITECTURE.md +443 -0
- agentouto-0.2.0/ai-docs/CONVENTIONS.md +331 -0
- agentouto-0.2.0/ai-docs/MESSAGE_PROTOCOL.md +252 -0
- agentouto-0.2.0/ai-docs/PHILOSOPHY.md +108 -0
- agentouto-0.2.0/ai-docs/PROVIDER_BACKENDS.md +238 -0
- agentouto-0.2.0/ai-docs/ROADMAP.md +129 -0
- agentouto-0.2.0/pyproject.toml +26 -0
- agentouto-0.2.0/tests/__init__.py +0 -0
- agentouto-0.2.0/tests/conftest.py +1 -0
- agentouto-0.2.0/tests/test_core.py +215 -0
- agentouto-0.2.0/tests/test_event_log.py +172 -0
- agentouto-0.2.0/tests/test_router.py +120 -0
- agentouto-0.2.0/tests/test_runtime.py +370 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install -e ".[dev]"
|
|
28
|
+
|
|
29
|
+
- name: Run tests
|
|
30
|
+
run: pytest tests/ -v
|
|
31
|
+
|
|
32
|
+
- name: Type check
|
|
33
|
+
run: mypy agentouto/ --ignore-missing-imports
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.12"
|
|
23
|
+
|
|
24
|
+
- name: Install build tools
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install build
|
|
28
|
+
|
|
29
|
+
- name: Build package
|
|
30
|
+
run: python -m build
|
|
31
|
+
|
|
32
|
+
- name: Publish to PyPI
|
|
33
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
agentouto-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 AgentOutO Contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
agentouto-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentouto
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Multi-agent Python SDK with peer-to-peer agent communication
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: anthropic>=0.34.0
|
|
9
|
+
Requires-Dist: google-generativeai>=0.8.0
|
|
10
|
+
Requires-Dist: openai>=1.50.0
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: mypy>=1.8; extra == 'dev'
|
|
13
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
14
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# AgentOutO
|
|
18
|
+
|
|
19
|
+
**멀티 에이전트 특화 Python SDK — 오케스트레이터 없는 피어 간 자유 호출**
|
|
20
|
+
|
|
21
|
+
A multi-agent Python SDK where every agent is equal. No orchestrator. No hierarchy. No restrictions.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 핵심 철학 (Core Philosophy)
|
|
26
|
+
|
|
27
|
+
AgentOutO rejects the orchestrator pattern used by existing frameworks (CrewAI, AutoGen, etc.).
|
|
28
|
+
|
|
29
|
+
> **모든 에이전트는 완전히 대등하다.** Base 에이전트가 존재하지 않는다.
|
|
30
|
+
>
|
|
31
|
+
> **모든 에이전트는 모든 에이전트를 호출할 수 있다.** 호출 제한이 없다.
|
|
32
|
+
>
|
|
33
|
+
> **모든 에이전트는 모든 도구를 사용할 수 있다.** 도구 제한이 없다.
|
|
34
|
+
>
|
|
35
|
+
> **메시지 프로토콜은 전달/반환 2종류뿐이다.**
|
|
36
|
+
>
|
|
37
|
+
> **사용자는 LLM이 없는 에이전트일 뿐이다.** 별도의 인터페이스, 프로토콜, 도구는 존재하지 않는다.
|
|
38
|
+
|
|
39
|
+
| Existing Frameworks | AgentOutO |
|
|
40
|
+
|---|---|
|
|
41
|
+
| Orchestrator-centric hierarchy | Peer-to-peer free calls |
|
|
42
|
+
| Base agent required | No base agent |
|
|
43
|
+
| Per-agent allowed-call lists | Any agent calls any agent |
|
|
44
|
+
| Per-agent tool assignment | All tools are global |
|
|
45
|
+
| Complex message protocols | Forward / Return only |
|
|
46
|
+
| Top-down message flow | Bidirectional free flow |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install agentouto
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Requires Python ≥ 3.11.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from agentouto import Agent, Tool, Provider, run
|
|
64
|
+
|
|
65
|
+
# Provider — API connection info only
|
|
66
|
+
openai = Provider(name="openai", kind="openai", api_key="sk-...")
|
|
67
|
+
|
|
68
|
+
# Tool — globally available to all agents
|
|
69
|
+
@Tool
|
|
70
|
+
def search_web(query: str) -> str:
|
|
71
|
+
"""Search the web."""
|
|
72
|
+
return f"Results for: {query}"
|
|
73
|
+
|
|
74
|
+
# Agent — model settings live here
|
|
75
|
+
researcher = Agent(
|
|
76
|
+
name="researcher",
|
|
77
|
+
instructions="Research expert. Search and organize information.",
|
|
78
|
+
model="gpt-4o",
|
|
79
|
+
provider="openai",
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
writer = Agent(
|
|
83
|
+
name="writer",
|
|
84
|
+
instructions="Skilled writer. Turn research into polished reports.",
|
|
85
|
+
model="gpt-4o",
|
|
86
|
+
provider="openai",
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# Run — user is just an agent without an LLM
|
|
90
|
+
result = run(
|
|
91
|
+
entry=researcher,
|
|
92
|
+
message="Write an AI trends report.",
|
|
93
|
+
agents=[researcher, writer],
|
|
94
|
+
tools=[search_web],
|
|
95
|
+
providers=[openai],
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
print(result.output)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Architecture
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
┌─────────────────────────────────────────────────────────┐
|
|
107
|
+
│ run() │
|
|
108
|
+
│ (User = LLM-less agent) │
|
|
109
|
+
│ │ │
|
|
110
|
+
│ Forward Message │
|
|
111
|
+
│ ▼ │
|
|
112
|
+
│ ┌─────────────── Agent Loop ──────────────────┐ │
|
|
113
|
+
│ │ │ │
|
|
114
|
+
│ │ ┌──→ LLM Call (via Provider Backend) │ │
|
|
115
|
+
│ │ │ │ │ │
|
|
116
|
+
│ │ │ ├── tool_call → Tool.execute() │ │
|
|
117
|
+
│ │ │ │ │ │ │
|
|
118
|
+
│ │ │ │ result back ───┐ │ │
|
|
119
|
+
│ │ │ │ │ │ │
|
|
120
|
+
│ │ │ ├── call_agent → New Loop ────┤ │ │
|
|
121
|
+
│ │ │ │ │ │ │ │
|
|
122
|
+
│ │ │ │ return back ───┐│ │ │
|
|
123
|
+
│ │ │ │ ││ │ │
|
|
124
|
+
│ │ │ └── finish → Return Message ││ │ │
|
|
125
|
+
│ │ │ ││ │ │
|
|
126
|
+
│ │ └────────────── next iteration ◄──────┘┘ │ │
|
|
127
|
+
│ └─────────────────────────────────────────────┘ │
|
|
128
|
+
│ │ │
|
|
129
|
+
│ Return Message │
|
|
130
|
+
│ ▼ │
|
|
131
|
+
│ RunResult.output │
|
|
132
|
+
└─────────────────────────────────────────────────────────┘
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Message Flow — Peer to Peer
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
[User] ──(forward)──→ [Agent A]
|
|
139
|
+
│
|
|
140
|
+
├──(forward)──→ [Agent B]
|
|
141
|
+
│ ├──(forward)──→ [Agent C]
|
|
142
|
+
│ │ │
|
|
143
|
+
│ │←──(return)──────┘
|
|
144
|
+
│ │
|
|
145
|
+
│←──(return)─────┘
|
|
146
|
+
│
|
|
147
|
+
└──(return)──→ [User]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
User→A and A→B use the **exact same mechanism**. There is no special user protocol.
|
|
151
|
+
|
|
152
|
+
### Parallel Calls
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
[Agent A]
|
|
156
|
+
├──(forward)──→ [Agent B] ─┐
|
|
157
|
+
├──(forward)──→ [Agent C] ├── asyncio.gather — all run concurrently
|
|
158
|
+
└──(forward)──→ [Agent D] ─┘
|
|
159
|
+
│
|
|
160
|
+
←──(3 returns, batched)────┘
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Core Concepts
|
|
166
|
+
|
|
167
|
+
### Provider — API Connection Only
|
|
168
|
+
|
|
169
|
+
Providers hold API credentials. No model settings, no inference config.
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
from agentouto import Provider
|
|
173
|
+
|
|
174
|
+
openai = Provider(name="openai", kind="openai", api_key="sk-...")
|
|
175
|
+
anthropic = Provider(name="anthropic", kind="anthropic", api_key="sk-ant-...")
|
|
176
|
+
google = Provider(name="google", kind="google", api_key="AIza...")
|
|
177
|
+
|
|
178
|
+
# OpenAI-compatible APIs (vLLM, Ollama, LM Studio, etc.)
|
|
179
|
+
local = Provider(name="local", kind="openai", base_url="http://localhost:11434/v1")
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
| Field | Description | Required |
|
|
183
|
+
|-------|-------------|----------|
|
|
184
|
+
| `name` | Identifier for the provider | ✅ |
|
|
185
|
+
| `kind` | API type: `"openai"`, `"anthropic"`, `"google"` | ✅ |
|
|
186
|
+
| `api_key` | API key | ✅ |
|
|
187
|
+
| `base_url` | Custom endpoint URL (for compatible APIs) | ❌ |
|
|
188
|
+
|
|
189
|
+
### Agent — Model Settings Live Here
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from agentouto import Agent
|
|
193
|
+
|
|
194
|
+
agent = Agent(
|
|
195
|
+
name="researcher",
|
|
196
|
+
instructions="Research expert.",
|
|
197
|
+
model="gpt-4o",
|
|
198
|
+
provider="openai",
|
|
199
|
+
max_output_tokens=16384,
|
|
200
|
+
reasoning=True,
|
|
201
|
+
reasoning_effort="high",
|
|
202
|
+
temperature=1.0,
|
|
203
|
+
)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
| Field | Description | Default |
|
|
207
|
+
|-------|-------------|---------|
|
|
208
|
+
| `name` | Agent name | (required) |
|
|
209
|
+
| `instructions` | Role description | (required) |
|
|
210
|
+
| `model` | Model name | (required) |
|
|
211
|
+
| `provider` | Provider name | (required) |
|
|
212
|
+
| `max_output_tokens` | Max output tokens | `4096` |
|
|
213
|
+
| `reasoning` | Enable reasoning/thinking mode | `False` |
|
|
214
|
+
| `reasoning_effort` | Reasoning intensity | `"medium"` |
|
|
215
|
+
| `reasoning_budget` | Thinking token budget (Anthropic) | `None` |
|
|
216
|
+
| `temperature` | Temperature | `1.0` |
|
|
217
|
+
| `extra` | Additional API parameters (free dict) | `{}` |
|
|
218
|
+
|
|
219
|
+
The SDK uses unified parameter names. Each provider backend maps them internally:
|
|
220
|
+
|
|
221
|
+
| SDK Parameter | OpenAI | Anthropic | Google Gemini |
|
|
222
|
+
|---|---|---|---|
|
|
223
|
+
| `max_output_tokens` | `max_completion_tokens` | `max_tokens` | `max_output_tokens` (in generation_config) |
|
|
224
|
+
| `reasoning=True` | sends `reasoning_effort` | `thinking={"type": "enabled", "budget_tokens": ...}` | `thinking_config={"thinking_budget": ...}` |
|
|
225
|
+
| `reasoning_effort` | top-level `reasoning_effort` | N/A | N/A |
|
|
226
|
+
| `reasoning_budget` | N/A | `thinking.budget_tokens` | `thinking_config.thinking_budget` |
|
|
227
|
+
| `temperature` (reasoning=True) | **not sent** | **forced to 1** | sent as-is |
|
|
228
|
+
|
|
229
|
+
See [`ai-docs/PROVIDER_BACKENDS.md`](./ai-docs/PROVIDER_BACKENDS.md) for full mapping details.
|
|
230
|
+
|
|
231
|
+
### Tool — Global, No Per-Agent Restrictions
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
from agentouto import Tool
|
|
235
|
+
|
|
236
|
+
@Tool
|
|
237
|
+
def search_web(query: str) -> str:
|
|
238
|
+
"""Search the web."""
|
|
239
|
+
return f"Results for: {query}"
|
|
240
|
+
|
|
241
|
+
# Async tools are supported
|
|
242
|
+
@Tool
|
|
243
|
+
async def fetch_data(url: str) -> str:
|
|
244
|
+
"""Fetch data from URL."""
|
|
245
|
+
async with aiohttp.ClientSession() as session:
|
|
246
|
+
async with session.get(url) as resp:
|
|
247
|
+
return await resp.text()
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Tools are automatically converted to JSON schemas from function signatures and docstrings. All agents can use all tools.
|
|
251
|
+
|
|
252
|
+
### Message — Forward and Return Only
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
@dataclass
|
|
256
|
+
class Message:
|
|
257
|
+
type: Literal["forward", "return"]
|
|
258
|
+
sender: str
|
|
259
|
+
receiver: str
|
|
260
|
+
content: str
|
|
261
|
+
call_id: str # Unique tracking ID
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Two types. No exceptions.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Supported Providers
|
|
269
|
+
|
|
270
|
+
| Kind | Provider | Compatible With |
|
|
271
|
+
|------|----------|-----------------|
|
|
272
|
+
| `"openai"` | OpenAI API | vLLM, Ollama, LM Studio, any OpenAI-compatible API |
|
|
273
|
+
| `"anthropic"` | Anthropic API | — |
|
|
274
|
+
| `"google"` | Google Gemini API | — |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Async Usage
|
|
279
|
+
|
|
280
|
+
```python
|
|
281
|
+
import asyncio
|
|
282
|
+
from agentouto import async_run
|
|
283
|
+
|
|
284
|
+
result = await async_run(
|
|
285
|
+
entry=researcher,
|
|
286
|
+
message="Write an AI trends report.",
|
|
287
|
+
agents=[researcher, writer, reviewer],
|
|
288
|
+
tools=[search_web, write_file],
|
|
289
|
+
providers=[openai, anthropic, google],
|
|
290
|
+
)
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Package Structure
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
agentouto/
|
|
299
|
+
├── __init__.py # Public API: Agent, Tool, Provider, run, async_run, Message, RunResult
|
|
300
|
+
├── agent.py # Agent dataclass
|
|
301
|
+
├── tool.py # Tool decorator/class with auto JSON schema generation
|
|
302
|
+
├── message.py # Message dataclass (forward/return)
|
|
303
|
+
├── provider.py # Provider dataclass (API connection info)
|
|
304
|
+
├── context.py # Per-agent conversation context management
|
|
305
|
+
├── router.py # Message routing, system prompt generation, tool schema building
|
|
306
|
+
├── runtime.py # Agent loop engine, parallel execution, run()/async_run()
|
|
307
|
+
├── _constants.py # Shared constants (CALL_AGENT, FINISH)
|
|
308
|
+
├── exceptions.py # ProviderError, AgentError, ToolError, RoutingError
|
|
309
|
+
└── providers/
|
|
310
|
+
├── __init__.py # ProviderBackend ABC, LLMResponse, get_backend()
|
|
311
|
+
├── openai.py # OpenAI (+ compatible APIs) implementation
|
|
312
|
+
├── anthropic.py # Anthropic implementation
|
|
313
|
+
└── google.py # Google Gemini implementation
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Development Status
|
|
319
|
+
|
|
320
|
+
| Phase | Description | Status |
|
|
321
|
+
|-------|-------------|--------|
|
|
322
|
+
| **1** | Core classes: Provider, Agent, Tool, Message | ✅ Done |
|
|
323
|
+
| **2** | Single agent execution: agent loop + tool calling | ✅ Done |
|
|
324
|
+
| **3** | Multi-agent: call_agent + finish + message routing | ✅ Done |
|
|
325
|
+
| **4** | Parallel calls: asyncio.gather concurrent execution | ✅ Done |
|
|
326
|
+
| **5** | Streaming, logging, tracing, debug mode | ✅ Done |
|
|
327
|
+
| **6** | CI/CD, tests, PyPI publish | 🔶 Partial (CI/CD + tests done, PyPI pending) |
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Technical Documentation
|
|
332
|
+
|
|
333
|
+
For AI contributors and detailed technical reference, see **[`ai-docs/`](./ai-docs/)**:
|
|
334
|
+
|
|
335
|
+
- [`AI_INSTRUCTIONS.md`](./ai-docs/AI_INSTRUCTIONS.md) — **Read this first.** How to work on this project and update docs.
|
|
336
|
+
- [`PHILOSOPHY.md`](./ai-docs/PHILOSOPHY.md) — Core philosophy and inviolable principles.
|
|
337
|
+
- [`ARCHITECTURE.md`](./ai-docs/ARCHITECTURE.md) — Package structure, module responsibilities, data flow.
|
|
338
|
+
- [`PROVIDER_BACKENDS.md`](./ai-docs/PROVIDER_BACKENDS.md) — Provider system, parameter mapping, API-specific behavior.
|
|
339
|
+
- [`MESSAGE_PROTOCOL.md`](./ai-docs/MESSAGE_PROTOCOL.md) — Message types, routing rules, parallel calls, agent loop.
|
|
340
|
+
- [`CONVENTIONS.md`](./ai-docs/CONVENTIONS.md) — Coding conventions, patterns, naming, style guide.
|
|
341
|
+
- [`ROADMAP.md`](./ai-docs/ROADMAP.md) — Current status, planned features, known issues.
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## License
|
|
346
|
+
|
|
347
|
+
Apache License 2.0 — see [LICENSE](./LICENSE) for details.
|