sofias-sdk-lite 0.1.5__tar.gz → 0.2.1__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.
- sofias_sdk_lite-0.2.1/LICENSE +69 -0
- sofias_sdk_lite-0.1.5/README.md → sofias_sdk_lite-0.2.1/PKG-INFO +57 -10
- sofias_sdk_lite-0.1.5/PKG-INFO → sofias_sdk_lite-0.2.1/README.md +21 -28
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/pyproject.toml +32 -2
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/pyproject.toml.orig +24 -2
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/__init__.py +2 -2
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/agent.py +3 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/agent_builder.py +6 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/agent_config.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/middleware.py +3 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/response_workflow.py +7 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/agent_settings.py +5 -4
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/runtime_config.py +4 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/sdk_config.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/source.py +6 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/agent_contracts.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/base_contracts.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/errors/error_handler.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/llm/__init__.py +11 -11
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/llm/factory.py +47 -34
- sofias_sdk_lite-0.1.5/src/sofias_sdk_lite/llm/bifrost.py → sofias_sdk_lite-0.2.1/src/sofias_sdk_lite/llm/gateway.py +53 -36
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/llm/openai_compatible.py +2 -2
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/llm/protocol.py +1 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/messaging/models.py +6 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/aggregator_config.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/aggregator_node.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/base_node.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/delegation_config.py +6 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/function_node.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/llm_node.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/llm_node_config.py +4 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/planner_node.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/prompt_assembler.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/observability/__init__.py +1 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/observability/events.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/observability/tracing.py +5 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/consumer.py +3 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/delegation_transport.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/rpc_client.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/routing/router.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/routing/strategies.py +14 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/runner/runner.py +3 -1
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/state/conversation_state.py +4 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/state/history.py +2 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/execution_context.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/streaming.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/defaults.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/node_contracts.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/strict_contract.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/errors/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/errors/circuit_breaker.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/errors/exceptions.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/llm/tokens.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/llm/tools.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/messaging/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/delegation_node.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/delegation_transport.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/plan_executor.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/nodes/planning_models.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/observability/_log.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/observability/trace_context.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/py.typed +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/client.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/config.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/publisher.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/rabbitmq/types.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/routing/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/runner/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/runner/config.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/state/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/state/memory.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/tools.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/workflows/__init__.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/workflows/chat.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/workflows/null.py +0 -0
- {sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/workflows/streaming_chat.py +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Sofias SDK Lite License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sofias Tech, S.L. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This licence applies to the software distributed as "sofias-sdk-lite" (the
|
|
6
|
+
"SDK"), including its source code, documentation and examples. By installing
|
|
7
|
+
or using the SDK you accept it. If you do not accept it, do not use the SDK.
|
|
8
|
+
|
|
9
|
+
1. Permitted use
|
|
10
|
+
|
|
11
|
+
Sofias Tech, S.L. ("Sofias") grants you a free, non-exclusive,
|
|
12
|
+
non-transferable and revocable licence to download, install and use the SDK
|
|
13
|
+
solely to develop, test and run agents intended to run on the Sofias
|
|
14
|
+
platform, including its developer portal and marketplace.
|
|
15
|
+
|
|
16
|
+
2. Source availability
|
|
17
|
+
|
|
18
|
+
The source code is made available so that you can read it and understand
|
|
19
|
+
how the SDK works. Access to the source code does not grant any right
|
|
20
|
+
beyond those set out in section 1.
|
|
21
|
+
|
|
22
|
+
3. Restrictions
|
|
23
|
+
|
|
24
|
+
Except as expressly permitted in section 1, you may not:
|
|
25
|
+
|
|
26
|
+
a) use the SDK, or any part or derivative of it, to build, run or offer
|
|
27
|
+
agents, applications or services for any platform other than Sofias;
|
|
28
|
+
b) copy, modify, adapt, translate or create derivative works of the SDK,
|
|
29
|
+
other than the local copies needed for the permitted use;
|
|
30
|
+
c) distribute, publish, sublicense, sell, rent or otherwise make the SDK or
|
|
31
|
+
any derivative of it available to third parties;
|
|
32
|
+
d) remove or alter this notice or any other notice of ownership.
|
|
33
|
+
|
|
34
|
+
4. Your agents
|
|
35
|
+
|
|
36
|
+
The agents you build with the SDK are yours. This licence does not give
|
|
37
|
+
Sofias any right over them. Any right Sofias needs to host, run or offer
|
|
38
|
+
your agents is governed by the terms you accept when you publish on the
|
|
39
|
+
Sofias platform.
|
|
40
|
+
|
|
41
|
+
5. Termination
|
|
42
|
+
|
|
43
|
+
This licence ends automatically if you breach any of its terms. Sofias may
|
|
44
|
+
also revoke it by written notice. On termination you must stop using the SDK
|
|
45
|
+
and delete every copy in your possession.
|
|
46
|
+
|
|
47
|
+
6. No warranty
|
|
48
|
+
|
|
49
|
+
THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
50
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION THE WARRANTIES OF MERCHANTABILITY,
|
|
51
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
52
|
+
|
|
53
|
+
7. Limitation of liability
|
|
54
|
+
|
|
55
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, SOFIAS SHALL NOT BE LIABLE FOR ANY
|
|
56
|
+
DAMAGE ARISING FROM THE USE OF, OR THE INABILITY TO USE, THE SDK.
|
|
57
|
+
|
|
58
|
+
8. Changes
|
|
59
|
+
|
|
60
|
+
Sofias may publish new versions of this licence. Each release of the SDK is
|
|
61
|
+
governed by the licence included with it.
|
|
62
|
+
|
|
63
|
+
9. Governing law and jurisdiction
|
|
64
|
+
|
|
65
|
+
This licence is governed by Spanish law. Any dispute shall be submitted to
|
|
66
|
+
the courts of Donostia - San Sebastian (Gipuzkoa), Spain, unless mandatory
|
|
67
|
+
law provides otherwise.
|
|
68
|
+
|
|
69
|
+
Contact: support@sofias.ai
|
|
@@ -1,7 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sofias-sdk-lite
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Build agents on the Sofias agent graph and run them over RabbitMQ.
|
|
5
|
+
Keywords: agents,ai,llm,rabbitmq,sofias
|
|
6
|
+
Author: Sofias Tech, S.L.
|
|
7
|
+
Author-email: Sofias Tech, S.L. <support@sofias.ai>
|
|
8
|
+
License-Expression: LicenseRef-Sofias-SDK-Lite
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Dist: pydantic>=2.0
|
|
20
|
+
Requires-Dist: aio-pika>=9.0.0
|
|
21
|
+
Requires-Dist: rstream>=1.0.0
|
|
22
|
+
Requires-Dist: nh3>=0.3.6
|
|
23
|
+
Requires-Dist: httpx>=0.27.0
|
|
24
|
+
Requires-Dist: mkdocs>=1.6,<2 ; extra == 'docs'
|
|
25
|
+
Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
|
|
26
|
+
Requires-Dist: mkdocstrings[python]>=0.25 ; extra == 'docs'
|
|
27
|
+
Requires-Dist: opentelemetry-api>=1.20.0 ; extra == 'otel'
|
|
28
|
+
Requires-Python: >=3.11
|
|
29
|
+
Project-URL: Homepage, https://sofias.ai/
|
|
30
|
+
Project-URL: Documentation, https://docs.sofias.ai/
|
|
31
|
+
Project-URL: Repository, https://github.com/Sofias-ai/sofias-sdk-lite
|
|
32
|
+
Project-URL: Changelog, https://github.com/Sofias-ai/sofias-sdk-lite/blob/main/CHANGELOG.md
|
|
33
|
+
Provides-Extra: docs
|
|
34
|
+
Provides-Extra: otel
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
1
37
|
# sofias-sdk-lite
|
|
2
38
|
|
|
3
39
|
Build multi-node agents on a declarative graph and run them against RabbitMQ.
|
|
4
40
|
|
|
41
|
+
**Documentation:** [docs.sofias.ai](https://docs.sofias.ai/) · **Developer portal:** [developers.sofias.ai](https://developers.sofias.ai/) · **Source:** [github.com/Sofias-ai/sofias-sdk-lite](https://github.com/Sofias-ai/sofias-sdk-lite)
|
|
42
|
+
|
|
5
43
|
`sofias-sdk-lite` gives you:
|
|
6
44
|
|
|
7
45
|
- **An agent graph** — LLM nodes, function nodes, delegation nodes (agent-to-agent),
|
|
@@ -13,8 +51,8 @@ Build multi-node agents on a declarative graph and run them against RabbitMQ.
|
|
|
13
51
|
- **A runner** — `AgentRunner` consumes tasks from a queue, resolves per-request
|
|
14
52
|
settings, executes your agent, and streams the response back — with graceful
|
|
15
53
|
shutdown, retries, and circuit breakers built in.
|
|
16
|
-
- **An LLM that is already wired** — LLM nodes talk to the Sofias
|
|
17
|
-
|
|
54
|
+
- **An LLM that is already wired** — LLM nodes talk to the Sofias gateway
|
|
55
|
+
(or any OpenAI-compatible endpoint) using the model, URL and key
|
|
18
56
|
from the agent's settings or the `SOFIAS_LLM_*` environment. `create_llm()`
|
|
19
57
|
builds the client when you need it explicitly; `LLMCallable` stays a protocol
|
|
20
58
|
for anything the bundled clients do not cover.
|
|
@@ -97,12 +135,11 @@ resolved at `build()`:
|
|
|
97
135
|
|
|
98
136
|
1. Under `AgentRunner`, from the per-task settings the platform sends
|
|
99
137
|
(`model_name`, `router_url`, `router_api_key` on `BaseAgentSettings`).
|
|
100
|
-
2. Otherwise from the environment: `SOFIAS_LLM_MODEL`, `SOFIAS_LLM_BASE_URL
|
|
101
|
-
(default `
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
portal-deployed agent needs no LLM configuration at all.
|
|
138
|
+
2. Otherwise from the environment: `SOFIAS_LLM_MODEL`, `SOFIAS_LLM_BASE_URL`,
|
|
139
|
+
`SOFIAS_LLM_API_KEY` and `SOFIAS_LLM_PROVIDER` (default `sofias`). The
|
|
140
|
+
Sofias platform injects them into every agent it runs, so an agent
|
|
141
|
+
deployed through the developer portal needs no LLM configuration at all.
|
|
142
|
+
There is no default URL: to run locally against a real gateway, set it.
|
|
106
143
|
3. Or explicitly: `.with_llm(create_llm(model="default", api_key=...))`.
|
|
107
144
|
|
|
108
145
|
```python
|
|
@@ -173,11 +210,21 @@ if __name__ == "__main__":
|
|
|
173
210
|
## Scope (v1)
|
|
174
211
|
|
|
175
212
|
Core agent graph, RabbitMQ messaging, the runner, and LLM clients for the
|
|
176
|
-
|
|
213
|
+
Sofias gateway / any OpenAI-compatible endpoint ship today. Memory and MCP
|
|
177
214
|
tool discovery are intentionally out of scope for v1 — the SDK ships the
|
|
178
215
|
relevant protocols (`MemoryProvider`, `ToolProvider`) so you can plug in
|
|
179
216
|
your own, and these become optional extras in a later release.
|
|
180
217
|
|
|
218
|
+
## Source and contributions
|
|
219
|
+
|
|
220
|
+
The public repository holds read-only release snapshots: each release of
|
|
221
|
+
`sofias-sdk-lite` appears there as a single commit. Development happens
|
|
222
|
+
elsewhere, so pull requests cannot be merged and we do not accept
|
|
223
|
+
contributions at the moment. For questions or to report a problem, write to
|
|
224
|
+
support@sofias.ai.
|
|
225
|
+
|
|
181
226
|
## License
|
|
182
227
|
|
|
183
|
-
|
|
228
|
+
Source-available under the [Sofias SDK Lite License](https://github.com/Sofias-ai/sofias-sdk-lite/blob/main/LICENSE):
|
|
229
|
+
you may use `sofias-sdk-lite` to develop, test and run agents for the Sofias
|
|
230
|
+
platform. The agents you build with it are yours.
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sofias-sdk-lite
|
|
3
|
-
Version: 0.1.5
|
|
4
|
-
Summary: Build agents on the Sofias agent graph and run them over RabbitMQ.
|
|
5
|
-
License-Expression: Apache-2.0
|
|
6
|
-
Requires-Dist: pydantic>=2.0
|
|
7
|
-
Requires-Dist: aio-pika>=9.0.0
|
|
8
|
-
Requires-Dist: rstream>=1.0.0
|
|
9
|
-
Requires-Dist: nh3>=0.3.6
|
|
10
|
-
Requires-Dist: httpx>=0.27.0
|
|
11
|
-
Requires-Dist: mkdocs-material>=9.5 ; extra == 'docs'
|
|
12
|
-
Requires-Dist: mkdocstrings[python]>=0.25 ; extra == 'docs'
|
|
13
|
-
Requires-Dist: opentelemetry-api>=1.20.0 ; extra == 'otel'
|
|
14
|
-
Requires-Python: >=3.11
|
|
15
|
-
Provides-Extra: docs
|
|
16
|
-
Provides-Extra: otel
|
|
17
|
-
Description-Content-Type: text/markdown
|
|
18
|
-
|
|
19
1
|
# sofias-sdk-lite
|
|
20
2
|
|
|
21
3
|
Build multi-node agents on a declarative graph and run them against RabbitMQ.
|
|
22
4
|
|
|
5
|
+
**Documentation:** [docs.sofias.ai](https://docs.sofias.ai/) · **Developer portal:** [developers.sofias.ai](https://developers.sofias.ai/) · **Source:** [github.com/Sofias-ai/sofias-sdk-lite](https://github.com/Sofias-ai/sofias-sdk-lite)
|
|
6
|
+
|
|
23
7
|
`sofias-sdk-lite` gives you:
|
|
24
8
|
|
|
25
9
|
- **An agent graph** — LLM nodes, function nodes, delegation nodes (agent-to-agent),
|
|
@@ -31,8 +15,8 @@ Build multi-node agents on a declarative graph and run them against RabbitMQ.
|
|
|
31
15
|
- **A runner** — `AgentRunner` consumes tasks from a queue, resolves per-request
|
|
32
16
|
settings, executes your agent, and streams the response back — with graceful
|
|
33
17
|
shutdown, retries, and circuit breakers built in.
|
|
34
|
-
- **An LLM that is already wired** — LLM nodes talk to the Sofias
|
|
35
|
-
|
|
18
|
+
- **An LLM that is already wired** — LLM nodes talk to the Sofias gateway
|
|
19
|
+
(or any OpenAI-compatible endpoint) using the model, URL and key
|
|
36
20
|
from the agent's settings or the `SOFIAS_LLM_*` environment. `create_llm()`
|
|
37
21
|
builds the client when you need it explicitly; `LLMCallable` stays a protocol
|
|
38
22
|
for anything the bundled clients do not cover.
|
|
@@ -115,12 +99,11 @@ resolved at `build()`:
|
|
|
115
99
|
|
|
116
100
|
1. Under `AgentRunner`, from the per-task settings the platform sends
|
|
117
101
|
(`model_name`, `router_url`, `router_api_key` on `BaseAgentSettings`).
|
|
118
|
-
2. Otherwise from the environment: `SOFIAS_LLM_MODEL`, `SOFIAS_LLM_BASE_URL
|
|
119
|
-
(default `
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
portal-deployed agent needs no LLM configuration at all.
|
|
102
|
+
2. Otherwise from the environment: `SOFIAS_LLM_MODEL`, `SOFIAS_LLM_BASE_URL`,
|
|
103
|
+
`SOFIAS_LLM_API_KEY` and `SOFIAS_LLM_PROVIDER` (default `sofias`). The
|
|
104
|
+
Sofias platform injects them into every agent it runs, so an agent
|
|
105
|
+
deployed through the developer portal needs no LLM configuration at all.
|
|
106
|
+
There is no default URL: to run locally against a real gateway, set it.
|
|
124
107
|
3. Or explicitly: `.with_llm(create_llm(model="default", api_key=...))`.
|
|
125
108
|
|
|
126
109
|
```python
|
|
@@ -191,11 +174,21 @@ if __name__ == "__main__":
|
|
|
191
174
|
## Scope (v1)
|
|
192
175
|
|
|
193
176
|
Core agent graph, RabbitMQ messaging, the runner, and LLM clients for the
|
|
194
|
-
|
|
177
|
+
Sofias gateway / any OpenAI-compatible endpoint ship today. Memory and MCP
|
|
195
178
|
tool discovery are intentionally out of scope for v1 — the SDK ships the
|
|
196
179
|
relevant protocols (`MemoryProvider`, `ToolProvider`) so you can plug in
|
|
197
180
|
your own, and these become optional extras in a later release.
|
|
198
181
|
|
|
182
|
+
## Source and contributions
|
|
183
|
+
|
|
184
|
+
The public repository holds read-only release snapshots: each release of
|
|
185
|
+
`sofias-sdk-lite` appears there as a single commit. Development happens
|
|
186
|
+
elsewhere, so pull requests cannot be merged and we do not accept
|
|
187
|
+
contributions at the moment. For questions or to report a problem, write to
|
|
188
|
+
support@sofias.ai.
|
|
189
|
+
|
|
199
190
|
## License
|
|
200
191
|
|
|
201
|
-
|
|
192
|
+
Source-available under the [Sofias SDK Lite License](https://github.com/Sofias-ai/sofias-sdk-lite/blob/main/LICENSE):
|
|
193
|
+
you may use `sofias-sdk-lite` to develop, test and run agents for the Sofias
|
|
194
|
+
platform. The agents you build with it are yours.
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sofias-sdk-lite"
|
|
3
|
-
version = "0.1
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
description = "Build agents on the Sofias agent graph and run them over RabbitMQ."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
7
|
-
license = "
|
|
7
|
+
license = "LicenseRef-Sofias-SDK-Lite"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = [
|
|
10
|
+
"agents",
|
|
11
|
+
"ai",
|
|
12
|
+
"llm",
|
|
13
|
+
"rabbitmq",
|
|
14
|
+
"sofias",
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Software Development :: Libraries",
|
|
25
|
+
"Typing :: Typed",
|
|
26
|
+
]
|
|
8
27
|
dependencies = [
|
|
9
28
|
"pydantic>=2.0",
|
|
10
29
|
"aio-pika>=9.0.0",
|
|
@@ -13,9 +32,20 @@ dependencies = [
|
|
|
13
32
|
"httpx>=0.27.0",
|
|
14
33
|
]
|
|
15
34
|
|
|
35
|
+
[[project.authors]]
|
|
36
|
+
name = "Sofias Tech, S.L."
|
|
37
|
+
email = "support@sofias.ai"
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://sofias.ai/"
|
|
41
|
+
Documentation = "https://docs.sofias.ai/"
|
|
42
|
+
Repository = "https://github.com/Sofias-ai/sofias-sdk-lite"
|
|
43
|
+
Changelog = "https://github.com/Sofias-ai/sofias-sdk-lite/blob/main/CHANGELOG.md"
|
|
44
|
+
|
|
16
45
|
[project.optional-dependencies]
|
|
17
46
|
otel = ["opentelemetry-api>=1.20.0"]
|
|
18
47
|
docs = [
|
|
48
|
+
"mkdocs>=1.6,<2",
|
|
19
49
|
"mkdocs-material>=9.5",
|
|
20
50
|
"mkdocstrings[python]>=0.25",
|
|
21
51
|
]
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sofias-sdk-lite"
|
|
3
|
-
version = "0.1
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
description = "Build agents on the Sofias agent graph and run them over RabbitMQ."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
7
|
-
license = "
|
|
7
|
+
license = "LicenseRef-Sofias-SDK-Lite"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [{ name = "Sofias Tech, S.L.", email = "support@sofias.ai" }]
|
|
10
|
+
keywords = ["agents", "ai", "llm", "rabbitmq", "sofias"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.11",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Topic :: Software Development :: Libraries",
|
|
20
|
+
"Typing :: Typed",
|
|
21
|
+
]
|
|
8
22
|
dependencies = [
|
|
9
23
|
"pydantic>=2.0",
|
|
10
24
|
"aio-pika>=9.0.0",
|
|
@@ -13,11 +27,19 @@ dependencies = [
|
|
|
13
27
|
"httpx>=0.27.0",
|
|
14
28
|
]
|
|
15
29
|
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://sofias.ai/"
|
|
32
|
+
Documentation = "https://docs.sofias.ai/"
|
|
33
|
+
Repository = "https://github.com/Sofias-ai/sofias-sdk-lite"
|
|
34
|
+
Changelog = "https://github.com/Sofias-ai/sofias-sdk-lite/blob/main/CHANGELOG.md"
|
|
35
|
+
|
|
16
36
|
[project.optional-dependencies]
|
|
17
37
|
otel = [
|
|
18
38
|
"opentelemetry-api>=1.20.0",
|
|
19
39
|
]
|
|
20
40
|
docs = [
|
|
41
|
+
# MkDocs 2.0 drops the plugin system this site relies on.
|
|
42
|
+
"mkdocs>=1.6,<2",
|
|
21
43
|
"mkdocs-material>=9.5",
|
|
22
44
|
"mkdocstrings[python]>=0.25",
|
|
23
45
|
]
|
|
@@ -91,7 +91,7 @@ from sofias_sdk_lite.errors import (
|
|
|
91
91
|
ToolExecutionError,
|
|
92
92
|
)
|
|
93
93
|
from sofias_sdk_lite.llm import (
|
|
94
|
-
|
|
94
|
+
GatewayLLM,
|
|
95
95
|
LLMCallable,
|
|
96
96
|
LLMGatewayConfig,
|
|
97
97
|
LLMResponse,
|
|
@@ -230,7 +230,7 @@ __all__ = [
|
|
|
230
230
|
"StreamableLLMCallable",
|
|
231
231
|
"LLMResponse",
|
|
232
232
|
# LLM clients + factory
|
|
233
|
-
"
|
|
233
|
+
"GatewayLLM",
|
|
234
234
|
"OpenAICompatibleLLM",
|
|
235
235
|
"LLMGatewayConfig",
|
|
236
236
|
"create_llm",
|
|
@@ -67,12 +67,13 @@ class Agent:
|
|
|
67
67
|
to Node instances which handle their own execution.
|
|
68
68
|
|
|
69
69
|
Example:
|
|
70
|
+
```python
|
|
70
71
|
# Agent is typically built via AgentBuilder
|
|
71
72
|
agent = (
|
|
72
73
|
AgentBuilder("my_agent", version="1.0.0")
|
|
73
74
|
.with_settings_class(MySettings)
|
|
74
75
|
.with_contract(input_schema=MyInput, output_schema=MyOutput)
|
|
75
|
-
.
|
|
76
|
+
.add_llm_node("start", node_config, contract)
|
|
76
77
|
.set_entry_node("start")
|
|
77
78
|
.set_terminal("start")
|
|
78
79
|
.build()
|
|
@@ -86,6 +87,7 @@ class Agent:
|
|
|
86
87
|
)
|
|
87
88
|
)
|
|
88
89
|
assert response.status == ResponseStatus.SUCCESS
|
|
90
|
+
```
|
|
89
91
|
"""
|
|
90
92
|
|
|
91
93
|
def __init__(
|
|
@@ -64,6 +64,7 @@ class AgentBuilder:
|
|
|
64
64
|
time, catching configuration errors before runtime.
|
|
65
65
|
|
|
66
66
|
Example:
|
|
67
|
+
```python
|
|
67
68
|
agent = (
|
|
68
69
|
AgentBuilder("inbox_assist", version="1.0.0")
|
|
69
70
|
.with_description("Agent that processes incoming emails")
|
|
@@ -84,6 +85,7 @@ class AgentBuilder:
|
|
|
84
85
|
.with_circuit_breaker(CircuitBreakerConfig(failure_threshold=5))
|
|
85
86
|
.build()
|
|
86
87
|
)
|
|
88
|
+
```
|
|
87
89
|
"""
|
|
88
90
|
|
|
89
91
|
def __init__(self, name: str, *, version: str = "1.0.0") -> None:
|
|
@@ -408,6 +410,7 @@ class AgentBuilder:
|
|
|
408
410
|
Self for method chaining.
|
|
409
411
|
|
|
410
412
|
Example:
|
|
413
|
+
```python
|
|
411
414
|
builder.with_delegation_transport(my_transport).add_delegation_node(
|
|
412
415
|
name="delegate_analysis",
|
|
413
416
|
config=DelegationNodeConfig(
|
|
@@ -424,6 +427,7 @@ class AgentBuilder:
|
|
|
424
427
|
"transform_for_analyzer": lambda d: {"text": d["content"]},
|
|
425
428
|
},
|
|
426
429
|
)
|
|
430
|
+
```
|
|
427
431
|
"""
|
|
428
432
|
self._delegation_node_configs[name] = config
|
|
429
433
|
self._delegation_node_contracts[name] = contract
|
|
@@ -709,6 +713,7 @@ class AgentBuilder:
|
|
|
709
713
|
Self for method chaining.
|
|
710
714
|
|
|
711
715
|
Example:
|
|
716
|
+
```python
|
|
712
717
|
from sofias_sdk_lite.state import (
|
|
713
718
|
ConversationState,
|
|
714
719
|
InMemoryStateProvider,
|
|
@@ -717,6 +722,7 @@ class AgentBuilder:
|
|
|
717
722
|
builder.with_conversation_state(
|
|
718
723
|
ConversationState(InMemoryStateProvider())
|
|
719
724
|
)
|
|
725
|
+
```
|
|
720
726
|
"""
|
|
721
727
|
self._conversation_state = state
|
|
722
728
|
return self
|
|
@@ -47,6 +47,7 @@ class AgentConfig(BaseModel):
|
|
|
47
47
|
three-level configuration resolution: SDK > Agent > Node.
|
|
48
48
|
|
|
49
49
|
Example:
|
|
50
|
+
```python
|
|
50
51
|
config = AgentConfig(
|
|
51
52
|
name="inbox-assistant",
|
|
52
53
|
version="1.0.0",
|
|
@@ -56,6 +57,7 @@ class AgentConfig(BaseModel):
|
|
|
56
57
|
settings_class=InboxAssistantSettings,
|
|
57
58
|
llm=AgentLLMConfig(model="gpt-4o"),
|
|
58
59
|
)
|
|
60
|
+
```
|
|
59
61
|
"""
|
|
60
62
|
|
|
61
63
|
model_config = ConfigDict(frozen=True, arbitrary_types_allowed=True)
|
|
@@ -4,7 +4,8 @@ Middleware hooks are called before and after each node execution,
|
|
|
4
4
|
allowing logging, metrics, tracing, and input/output transformation
|
|
5
5
|
without modifying node code.
|
|
6
6
|
|
|
7
|
-
Example
|
|
7
|
+
Example:
|
|
8
|
+
```python
|
|
8
9
|
|
|
9
10
|
class MetricsMiddleware:
|
|
10
11
|
async def before_node(self, node_name, input_data):
|
|
@@ -24,6 +25,7 @@ Example::
|
|
|
24
25
|
.with_middleware(MetricsMiddleware())
|
|
25
26
|
.build()
|
|
26
27
|
)
|
|
28
|
+
```
|
|
27
29
|
"""
|
|
28
30
|
|
|
29
31
|
from __future__ import annotations
|
{sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/agent/response_workflow.py
RENAMED
|
@@ -21,6 +21,7 @@ This module is transport-agnostic: it has no dependency on any specific
|
|
|
21
21
|
message broker. Wire it to whatever transport your application uses.
|
|
22
22
|
|
|
23
23
|
Example:
|
|
24
|
+
```python
|
|
24
25
|
class MyRabbitMQWorkflow:
|
|
25
26
|
async def send_response(
|
|
26
27
|
self,
|
|
@@ -38,6 +39,7 @@ Example:
|
|
|
38
39
|
.with_response_workflow(MyRabbitMQWorkflow())
|
|
39
40
|
.build()
|
|
40
41
|
)
|
|
42
|
+
```
|
|
41
43
|
"""
|
|
42
44
|
|
|
43
45
|
from __future__ import annotations
|
|
@@ -99,6 +101,7 @@ class StreamingResponseWorkflow(Protocol):
|
|
|
99
101
|
send_response() is still called at the end with the complete response.
|
|
100
102
|
|
|
101
103
|
Example:
|
|
104
|
+
```python
|
|
102
105
|
class MySSEWorkflow:
|
|
103
106
|
async def on_stream_event(
|
|
104
107
|
self,
|
|
@@ -113,6 +116,7 @@ class StreamingResponseWorkflow(Protocol):
|
|
|
113
116
|
context: ExecutionContext,
|
|
114
117
|
) -> None:
|
|
115
118
|
await self._sse_channel.send_final(response.model_dump_json())
|
|
119
|
+
```
|
|
116
120
|
"""
|
|
117
121
|
|
|
118
122
|
async def on_stream_event(
|
|
@@ -162,7 +166,8 @@ class BaseDelegationResponseWorkflow:
|
|
|
162
166
|
the ``result`` string. If *None*, the entire content dict is
|
|
163
167
|
serialized as JSON. Defaults to *None*.
|
|
164
168
|
|
|
165
|
-
Example
|
|
169
|
+
Example:
|
|
170
|
+
```python
|
|
166
171
|
|
|
167
172
|
async def publish(payload: dict) -> None:
|
|
168
173
|
await my_transport.publish_reply(reply_to, correlation_id, payload)
|
|
@@ -171,6 +176,7 @@ class BaseDelegationResponseWorkflow:
|
|
|
171
176
|
publish_fn=publish,
|
|
172
177
|
output_field="report",
|
|
173
178
|
)
|
|
179
|
+
```
|
|
174
180
|
"""
|
|
175
181
|
|
|
176
182
|
def __init__(
|
{sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/agent_settings.py
RENAMED
|
@@ -55,12 +55,13 @@ class BaseAgentSettings(AgentSettings):
|
|
|
55
55
|
variables), so a ``{api_key}`` placeholder can never inline a secret. Read
|
|
56
56
|
them at the point of use with ``.get_secret_value()``.
|
|
57
57
|
|
|
58
|
-
Example
|
|
59
|
-
|
|
58
|
+
Example:
|
|
59
|
+
```python
|
|
60
60
|
class MySettings(BaseAgentSettings):
|
|
61
61
|
CREDENTIAL_FIELDS = BaseAgentSettings.CREDENTIAL_FIELDS | {"search_api_key"}
|
|
62
62
|
|
|
63
63
|
search_api_key: SecretStr = SecretStr("")
|
|
64
|
+
```
|
|
64
65
|
"""
|
|
65
66
|
|
|
66
67
|
# --- LLM gateway (canonical platform keys) ---
|
|
@@ -68,13 +69,13 @@ class BaseAgentSettings(AgentSettings):
|
|
|
68
69
|
"""Model identifier or gateway alias. Empty means "no LLM configured here"."""
|
|
69
70
|
|
|
70
71
|
router_url: str = ""
|
|
71
|
-
"""OpenAI-compatible gateway root
|
|
72
|
+
"""OpenAI-compatible gateway root, injected by the platform. Required to build an LLM."""
|
|
72
73
|
|
|
73
74
|
router_api_key: SecretStr = SecretStr("")
|
|
74
75
|
"""Gateway bearer token. Empty sends unauthenticated requests."""
|
|
75
76
|
|
|
76
77
|
router_provider: str = ""
|
|
77
|
-
"""Adapter flavour: ``"
|
|
78
|
+
"""Adapter flavour: ``"sofias"`` (default when empty) or an OpenAI-compatible label."""
|
|
78
79
|
|
|
79
80
|
@property
|
|
80
81
|
def has_llm_gateway(self) -> bool:
|
{sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/config/runtime_config.py
RENAMED
|
@@ -38,11 +38,13 @@ class AgentSettings(BaseModel):
|
|
|
38
38
|
required and optional runtime configuration variables.
|
|
39
39
|
|
|
40
40
|
Example:
|
|
41
|
+
```python
|
|
41
42
|
class MyAgentSettings(AgentSettings):
|
|
42
43
|
reasoning_model: str # required
|
|
43
44
|
fast_model: str # required
|
|
44
45
|
max_retries: int = 3 # optional with default
|
|
45
46
|
temperature: float = 0.7 # optional with default
|
|
47
|
+
```
|
|
46
48
|
"""
|
|
47
49
|
|
|
48
50
|
model_config = ConfigDict(
|
|
@@ -85,6 +87,7 @@ class SettingsResolver(Generic[SettingsT]):
|
|
|
85
87
|
graph execution without explicit parameter passing.
|
|
86
88
|
|
|
87
89
|
Example:
|
|
90
|
+
```python
|
|
88
91
|
resolver = SettingsResolver(MyAgentSettings)
|
|
89
92
|
|
|
90
93
|
# Resolve from incoming message
|
|
@@ -98,6 +101,7 @@ class SettingsResolver(Generic[SettingsT]):
|
|
|
98
101
|
|
|
99
102
|
# Clear after execution
|
|
100
103
|
resolver.clear()
|
|
104
|
+
```
|
|
101
105
|
"""
|
|
102
106
|
|
|
103
107
|
def __init__(self, settings_class: type[SettingsT]) -> None:
|
|
@@ -73,10 +73,12 @@ class SDKConfig(BaseModel):
|
|
|
73
73
|
when setting up their agent. All values have sensible defaults.
|
|
74
74
|
|
|
75
75
|
Example:
|
|
76
|
+
```python
|
|
76
77
|
config = SDKConfig(
|
|
77
78
|
llm=LLMConfig(model="gpt-4o-mini"),
|
|
78
79
|
strict_validation=True,
|
|
79
80
|
)
|
|
81
|
+
```
|
|
80
82
|
"""
|
|
81
83
|
|
|
82
84
|
model_config = ConfigDict(frozen=True)
|
|
@@ -35,11 +35,13 @@ class ConfigSource(Protocol):
|
|
|
35
35
|
return type.
|
|
36
36
|
|
|
37
37
|
Example:
|
|
38
|
+
```python
|
|
38
39
|
class DatabaseConfigSource:
|
|
39
40
|
async def fetch(
|
|
40
41
|
self, agent_name: str, conversation_id: str | None = None
|
|
41
42
|
) -> dict[str, Any]:
|
|
42
43
|
return await my_db.get_agent_config(agent_name)
|
|
44
|
+
```
|
|
43
45
|
"""
|
|
44
46
|
|
|
45
47
|
async def fetch(self, agent_name: str, conversation_id: str | None = None) -> dict[str, Any]:
|
|
@@ -66,8 +68,10 @@ class StaticConfigSource:
|
|
|
66
68
|
fixed configuration applies to every agent and conversation.
|
|
67
69
|
|
|
68
70
|
Example:
|
|
71
|
+
```python
|
|
69
72
|
source = StaticConfigSource({"model_name": "gpt-4o-mini", "api_key": "..."})
|
|
70
73
|
config = await source.fetch("my_agent")
|
|
74
|
+
```
|
|
71
75
|
"""
|
|
72
76
|
|
|
73
77
|
def __init__(self, config: dict[str, Any]) -> None:
|
|
@@ -104,8 +108,10 @@ class EnvConfigSource:
|
|
|
104
108
|
export SOFIAS_AGENT_CONFIG='{"model_name": "gpt-4o-mini", "api_key": "sk-..."}'
|
|
105
109
|
|
|
106
110
|
Example:
|
|
111
|
+
```python
|
|
107
112
|
source = EnvConfigSource() # reads SOFIAS_AGENT_CONFIG
|
|
108
113
|
config = await source.fetch("my_agent")
|
|
114
|
+
```
|
|
109
115
|
"""
|
|
110
116
|
|
|
111
117
|
def __init__(self, env_var: str = "SOFIAS_AGENT_CONFIG") -> None:
|
{sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/agent_contracts.py
RENAMED
|
@@ -8,6 +8,7 @@ strongly-typed envelopes that carry domain data plus transport metadata.
|
|
|
8
8
|
- AgentResponse wraps the validated output with execution metadata.
|
|
9
9
|
|
|
10
10
|
Example:
|
|
11
|
+
```python
|
|
11
12
|
class MyInput(InputContract):
|
|
12
13
|
query: str
|
|
13
14
|
|
|
@@ -22,6 +23,7 @@ Example:
|
|
|
22
23
|
print(response.content) # validated output dict
|
|
23
24
|
print(response.execution_path) # ["classifier", "responder"]
|
|
24
25
|
print(response.execution_time_ms) # 1234.5
|
|
26
|
+
```
|
|
25
27
|
"""
|
|
26
28
|
|
|
27
29
|
from __future__ import annotations
|
{sofias_sdk_lite-0.1.5 → sofias_sdk_lite-0.2.1}/src/sofias_sdk_lite/contracts/base_contracts.py
RENAMED
|
@@ -6,6 +6,7 @@ a common protocol so that any delegating node knows exactly what to send and
|
|
|
6
6
|
what to expect back, without needing to know the internals of the target agent.
|
|
7
7
|
|
|
8
8
|
Example:
|
|
9
|
+
```python
|
|
9
10
|
# Agent A delegates to Agent B
|
|
10
11
|
request = DelegationRequest(
|
|
11
12
|
input="Summarize this document",
|
|
@@ -18,6 +19,7 @@ Example:
|
|
|
18
19
|
result="The document discusses...",
|
|
19
20
|
extras={"word_count": 150, "confidence": 0.95},
|
|
20
21
|
)
|
|
22
|
+
```
|
|
21
23
|
"""
|
|
22
24
|
|
|
23
25
|
from __future__ import annotations
|