agently 4.0.7.1__py3-none-any.whl → 4.0.7.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agently/_default_init.py +4 -0
- agently/_default_settings.yaml +1 -0
- agently/base.py +2 -0
- agently/builtins/agent_extensions/ChatSessionExtension.py +2 -2
- agently/builtins/agent_extensions/SessionExtension.py +300 -0
- agently/builtins/agent_extensions/__init__.py +1 -0
- agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py +36 -12
- agently/builtins/plugins/Session/AgentlyMemoSession.py +652 -0
- agently/builtins/tools/Browse.py +11 -3
- agently/builtins/tools/Cmd.py +112 -0
- agently/builtins/tools/Search.py +27 -1
- agently/builtins/tools/__init__.py +1 -0
- agently/core/Agent.py +7 -7
- agently/core/ModelRequest.py +0 -4
- agently/core/Prompt.py +1 -1
- agently/core/Session.py +218 -0
- agently/core/__init__.py +1 -0
- agently/integrations/chromadb.py +4 -4
- agently/types/data/__init__.py +2 -0
- agently/types/data/prompt.py +6 -1
- agently/types/data/tool.py +9 -0
- agently/types/plugins/BuiltInTool.py +22 -0
- agently/types/plugins/Session.py +169 -0
- agently/types/plugins/__init__.py +21 -0
- agently/types/plugins/base.py +1 -1
- agently/utils/AGENT_UTILS_GUIDE.md +175 -0
- agently/utils/DataFormatter.py +6 -2
- agently/utils/FunctionShifter.py +3 -2
- agently/utils/TimeInfo.py +22 -0
- agently/utils/__init__.py +1 -0
- agently-4.0.7.3.dist-info/METADATA +351 -0
- {agently-4.0.7.1.dist-info → agently-4.0.7.3.dist-info}/RECORD +34 -26
- {agently-4.0.7.1.dist-info → agently-4.0.7.3.dist-info}/WHEEL +1 -1
- agently-4.0.7.1.dist-info/METADATA +0 -194
- {agently-4.0.7.1.dist-info → agently-4.0.7.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agently
|
|
3
|
+
Version: 4.0.7.3
|
|
4
|
+
Summary:
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Author: Agently Team
|
|
8
|
+
Author-email: developer@agently.tech
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Dist: greenlet (>=3.2.3,<4.0.0)
|
|
18
|
+
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
19
|
+
Requires-Dist: httpx-sse (>=0.4.1,<0.5.0)
|
|
20
|
+
Requires-Dist: json5 (>=0.12.0,<0.13.0)
|
|
21
|
+
Requires-Dist: packaging (>=25.0,<26.0)
|
|
22
|
+
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
|
|
23
|
+
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
|
|
24
|
+
Requires-Dist: stamina (>=25.1.0,<26.0.0)
|
|
25
|
+
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
<img width="640" alt="image" src="https://github.com/user-attachments/assets/c645d031-c8b0-4dba-a515-9d7a4b0a6881" />
|
|
29
|
+
|
|
30
|
+
# Agently 4 🚀
|
|
31
|
+
|
|
32
|
+
> **Build production‑grade AI apps faster, with stable outputs and maintainable workflows.**
|
|
33
|
+
|
|
34
|
+
[English Introduction](https://github.com/AgentEra/Agently/blob/main/README.md) | [中文介绍](https://github.com/AgentEra/Agently/blob/main/README_CN.md)
|
|
35
|
+
|
|
36
|
+
[](https://github.com/AgentEra/Agently/blob/main/LICENSE)
|
|
37
|
+
[](https://pypi.org/project/agently/)
|
|
38
|
+
[](https://pypistats.org/packages/agently)
|
|
39
|
+
[](https://github.com/AgentEra/Agently/stargazers)
|
|
40
|
+
[](https://x.com/AgentlyTech)
|
|
41
|
+
<a href="https://doc.weixin.qq.com/forms/AIoA8gcHAFMAScAhgZQABIlW6tV3l7QQf">
|
|
42
|
+
<img alt="WeChat" src="https://img.shields.io/badge/WeChat%20Group-Join-brightgreen?logo=wechat&style=flat-square">
|
|
43
|
+
</a>
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<a href="https://github.com/AgentEra/Agently/discussions"><img src="https://img.shields.io/badge/💬_Community-Join-blueviolet?style=for-the-badge"></a>
|
|
47
|
+
<a href="https://agently.tech"><img src="https://img.shields.io/badge/🌐_Website-Docs-brightgreen?style=for-the-badge"></a>
|
|
48
|
+
<a href="https://github.com/AgentEra/Agently/issues"><img src="https://img.shields.io/badge/🐛_Issues-Report-red?style=for-the-badge"></a>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<p align="center">
|
|
54
|
+
<b>🔥 <a href="https://agently.tech/docs">Latest Docs</a> | 🚀 <a href="#quickstart">5‑minute Quickstart</a> | 💡 <a href="#-core-features">Core Features</a></b>
|
|
55
|
+
</p>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 📚 Quick Links
|
|
60
|
+
|
|
61
|
+
- **Docs (EN)**: https://agently.tech/docs
|
|
62
|
+
- **Docs (中文)**: https://agently.cn/docs
|
|
63
|
+
- **Agent Systems Playbook (EN)**: https://agently.tech/docs/en/agent-systems/overview.html
|
|
64
|
+
- **Agent Systems Playbook (中文)**: https://agently.cn/docs/agent-systems/overview.html
|
|
65
|
+
- **Coding Agent Guide (EN)**: https://agently.tech/docs/en/agent-docs.html
|
|
66
|
+
- **Coding Agent Guide (中文)**: https://agently.cn/docs/agent-docs.html
|
|
67
|
+
- **Agent Docs Pack**: https://agently.cn/docs/agent_docs.zip
|
|
68
|
+
|
|
69
|
+
## 🤔 Why Agently?
|
|
70
|
+
|
|
71
|
+
Many GenAI POCs fail in production not because models are weak, but because **engineering control is missing**:
|
|
72
|
+
|
|
73
|
+
| Common challenge | How Agently helps |
|
|
74
|
+
|:--|:--|
|
|
75
|
+
| Output schema drifts, JSON parsing fails | **Contract‑first output control** with `output()` + `ensure_keys` |
|
|
76
|
+
| Workflows get complex and hard to maintain | **TriggerFlow orchestration** with `to` / `if` / `match` / `batch` / `for_each` |
|
|
77
|
+
| Multi‑turn state becomes unstable | **Session & Memo** with memory, summaries, and persistence strategies |
|
|
78
|
+
| Tool calls are hard to audit | **Tool logs** via `extra.tool_logs` |
|
|
79
|
+
| Switching models is expensive | **OpenAICompatible** unified model settings |
|
|
80
|
+
|
|
81
|
+
**Agently turns LLM uncertainty into a stable, testable, maintainable engineering system.**
|
|
82
|
+
|
|
83
|
+
## ✨ Core Features
|
|
84
|
+
|
|
85
|
+
### 1) 📝 Contract‑first Output Control
|
|
86
|
+
Define the structure with `output()`, enforce critical keys with `ensure_keys`.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
result = (
|
|
90
|
+
agent
|
|
91
|
+
.input("Analyze user feedback")
|
|
92
|
+
.output({
|
|
93
|
+
"sentiment": (str, "positive/neutral/negative"),
|
|
94
|
+
"key_issues": [(str, "issue summary")],
|
|
95
|
+
"priority": (int, "1-5, 5 is highest")
|
|
96
|
+
})
|
|
97
|
+
.start(ensure_keys=["sentiment", "key_issues[*]"])
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 2) ⚡ Structured Streaming (Instant)
|
|
102
|
+
Consume structured fields as they are generated.
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
response = (
|
|
106
|
+
agent
|
|
107
|
+
.input("Explain recursion and give 2 tips")
|
|
108
|
+
.output({"definition": (str, "one sentence"), "tips": [(str, "tip")]})
|
|
109
|
+
.get_response()
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
for msg in response.get_generator(type="instant"):
|
|
113
|
+
if msg.path == "definition" and msg.delta:
|
|
114
|
+
ui.update_definition(msg.delta)
|
|
115
|
+
if msg.wildcard_path == "tips[*]" and msg.delta:
|
|
116
|
+
ui.add_tip(msg.delta)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 3) 🧩 TriggerFlow Orchestration
|
|
120
|
+
Readable, testable workflows with branching and concurrency.
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
(
|
|
124
|
+
flow.to(handle_request)
|
|
125
|
+
.if_condition(lambda d: d.value["type"] == "query")
|
|
126
|
+
.to(handle_query)
|
|
127
|
+
.elif_condition(lambda d: d.value["type"] == "order")
|
|
128
|
+
.to(check_inventory)
|
|
129
|
+
.to(create_order)
|
|
130
|
+
.end_condition()
|
|
131
|
+
)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 4) 🧠 Session & Memo (Multi‑turn Memory)
|
|
135
|
+
Quick / Lite / Memo modes with summaries and persistence strategies.
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from agently import Agently
|
|
139
|
+
from agently.core import Session
|
|
140
|
+
|
|
141
|
+
agent = Agently.create_agent()
|
|
142
|
+
session = Session(agent=agent).configure(
|
|
143
|
+
mode="memo",
|
|
144
|
+
limit={"chars": 6000, "messages": 12},
|
|
145
|
+
every_n_turns=2,
|
|
146
|
+
)
|
|
147
|
+
agent.attach_session(session)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 5) 🔧 Tool Calls + Logs
|
|
151
|
+
Tool selection and usage are logged in `extra.tool_logs`.
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
@agent.tool_func
|
|
155
|
+
def add(a: int, b: int) -> int:
|
|
156
|
+
return a + b
|
|
157
|
+
|
|
158
|
+
response = agent.input("12+34=?").use_tool(add).get_response()
|
|
159
|
+
full = response.get_data(type="all")
|
|
160
|
+
print(full["extra"]["tool_logs"])
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 6) 🌐 Unified Model Settings (OpenAICompatible)
|
|
164
|
+
One config for multiple providers and local models.
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
from agently import Agently
|
|
168
|
+
|
|
169
|
+
Agently.set_settings(
|
|
170
|
+
"OpenAICompatible",
|
|
171
|
+
{
|
|
172
|
+
"base_url": "https://api.deepseek.com/v1",
|
|
173
|
+
"model": "deepseek-chat",
|
|
174
|
+
"auth": "DEEPSEEK_API_KEY",
|
|
175
|
+
},
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## 🚀 Quickstart
|
|
180
|
+
|
|
181
|
+
### Install
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
pip install -U agently
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
*Requirements: Python >= 3.10, recommended Agently >= 4.0.7.2*
|
|
188
|
+
|
|
189
|
+
### 5‑minute example
|
|
190
|
+
|
|
191
|
+
**1. Structured output**
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from agently import Agently
|
|
195
|
+
|
|
196
|
+
agent = Agently.create_agent()
|
|
197
|
+
|
|
198
|
+
result = (
|
|
199
|
+
agent.input("Introduce Python in one sentence and list 2 advantages")
|
|
200
|
+
.output({
|
|
201
|
+
"introduction": (str, "one sentence"),
|
|
202
|
+
"advantages": [(str, "advantage")]
|
|
203
|
+
})
|
|
204
|
+
.start(ensure_keys=["introduction", "advantages[*]"])
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
print(result)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**2. Workflow routing**
|
|
211
|
+
|
|
212
|
+
```python
|
|
213
|
+
from agently import TriggerFlow, TriggerFlowEventData
|
|
214
|
+
|
|
215
|
+
flow = TriggerFlow()
|
|
216
|
+
|
|
217
|
+
@flow.chunk
|
|
218
|
+
def classify_intent(data: TriggerFlowEventData):
|
|
219
|
+
text = data.value
|
|
220
|
+
if "price" in text:
|
|
221
|
+
return "price_query"
|
|
222
|
+
if "feature" in text:
|
|
223
|
+
return "feature_query"
|
|
224
|
+
if "buy" in text:
|
|
225
|
+
return "purchase"
|
|
226
|
+
return "other"
|
|
227
|
+
|
|
228
|
+
@flow.chunk
|
|
229
|
+
def handle_price(_: TriggerFlowEventData):
|
|
230
|
+
return {"response": "Pricing depends on the plan..."}
|
|
231
|
+
|
|
232
|
+
@flow.chunk
|
|
233
|
+
def handle_feature(_: TriggerFlowEventData):
|
|
234
|
+
return {"response": "Our product supports..."}
|
|
235
|
+
|
|
236
|
+
(
|
|
237
|
+
flow.to(classify_intent)
|
|
238
|
+
.match()
|
|
239
|
+
.case("price_query")
|
|
240
|
+
.to(handle_price)
|
|
241
|
+
.case("feature_query")
|
|
242
|
+
.to(handle_feature)
|
|
243
|
+
.case_else()
|
|
244
|
+
.to(lambda d: {"response": "What would you like to know?"})
|
|
245
|
+
.end_match()
|
|
246
|
+
.end()
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
print(flow.start("How much does it cost?"))
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## ✅ Is Your App Production‑Ready? — Release Readiness Checklist
|
|
253
|
+
|
|
254
|
+
Based on teams shipping real projects with Agently, this **production readiness checklist** helps reduce common risks before release.
|
|
255
|
+
|
|
256
|
+
| Area | Check | Recommended Practice |
|
|
257
|
+
| :--- | :--- | :--- |
|
|
258
|
+
| **📝 Output Stability** | Are key interfaces stable? | Define schemas with `output()` and lock critical fields with `ensure_keys`. |
|
|
259
|
+
| **⚡ Real‑time UX** | Need updates while generating? | Consume `type="instant"` structured streaming events. |
|
|
260
|
+
| **🔍 Observability** | Tool calls auditable? | Inspect `extra.tool_logs` for full arguments and results. |
|
|
261
|
+
| **🧩 Workflow Robustness** | Complex flows fully tested? | Unit test each TriggerFlow branch and concurrency limit with expected outputs. |
|
|
262
|
+
| **🧠 Memory & Context** | Multi‑turn experience consistent? | Define Session/Memo summary, trimming, and persistence policies. |
|
|
263
|
+
| **📄 Prompt Management** | Can logic evolve safely? | Version and configure prompts to keep changes traceable. |
|
|
264
|
+
| **🌐 Model Strategy** | Can you switch or downgrade models? | Centralize settings with `OpenAICompatible` for fast provider switching. |
|
|
265
|
+
| **🚀 Performance & Scale** | Can it handle concurrency? | Validate async performance in real web‑service scenarios. |
|
|
266
|
+
| **🧪 Quality Assurance** | Regression tests complete? | Create fixed inputs with expected outputs for core scenarios. |
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
## 📈 Who Uses Agently to Solve Real Problems?
|
|
270
|
+
|
|
271
|
+
> "Agently helped us turn evaluation rules into executable workflows and keep key scoring accuracy at 75%+, significantly improving bid‑evaluation efficiency." — Project lead at a large energy SOE
|
|
272
|
+
|
|
273
|
+
> "Agently enabled a closed loop from clarification to query planning to rendering, reaching 90%+ first‑response accuracy and stable production performance." — Data lead at a large energy group
|
|
274
|
+
|
|
275
|
+
> "Agently’s orchestration and session capabilities let us ship a teaching assistant for course management and Q&A quickly, with continuous iteration." — Project lead at a university teaching‑assistant initiative
|
|
276
|
+
|
|
277
|
+
**Your project can be next.**
|
|
278
|
+
📢 [Share your case on GitHub Discussions →](https://github.com/AgentEra/Agently/discussions/categories/show-and-tell)
|
|
279
|
+
## ❓ FAQ
|
|
280
|
+
|
|
281
|
+
**Q: How is Agently different from LangChain or LlamaIndex?**
|
|
282
|
+
**A:** Agently is **built for production**. It focuses on stable interfaces (contract‑first outputs), readable/testable orchestration (TriggerFlow), and observable tool calls (`tool_logs`). It’s a better fit for teams that need reliability and maintainability after launch.
|
|
283
|
+
|
|
284
|
+
**Q: Which models are supported? Is switching expensive?**
|
|
285
|
+
**A:** With `OpenAICompatible`, you can connect OpenAI, Claude, DeepSeek, Qwen and most OpenAI‑compatible endpoints, plus local models like Llama/Qwen. **The same business code can switch models without rewrites**, reducing vendor lock‑in.
|
|
286
|
+
|
|
287
|
+
**Q: What’s the learning curve? Where should I start?**
|
|
288
|
+
**A:** The core API is straightforward—**you can run your first agent in minutes**. Start with [Quickstart](https://agently.tech/docs/en/quickstart.html), then dive into [Output Control](https://agently.tech/docs/en/output-control/overview.html) and [TriggerFlow](https://agently.tech/docs/en/triggerflow/overview.html).
|
|
289
|
+
|
|
290
|
+
**Q: How do I deploy an Agently‑based service?**
|
|
291
|
+
**A:** Agently doesn’t lock you into a specific deployment path. It provides async APIs and FastAPI examples. The [FastAPI integration example](https://github.com/AgentEra/Agently/tree/main/examples/step_by_step/13-auto_loop_fastapi) covers SSE, WebSocket, and standard POST.
|
|
292
|
+
|
|
293
|
+
**Q: Do you offer enterprise support?**
|
|
294
|
+
**A:** The core framework is open‑source under **Apache 2.0**. For enterprise support, training, or deep collaboration, contact us via the [community](https://doc.weixin.qq.com/forms/AIoA8gcHAFMAScAhgZQABIlW6tV3l7QQf).
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
## 🧭 Docs Guide (Key Paths)
|
|
298
|
+
|
|
299
|
+
- **Getting Started**
|
|
300
|
+
- Quickstart: https://agently.tech/docs/en/quickstart.html
|
|
301
|
+
- Model Settings: https://agently.tech/docs/en/model-settings.html
|
|
302
|
+
- Coding Agent Guide: https://agently.tech/docs/en/agent-docs.html
|
|
303
|
+
- **Output Control (Structured Output)**
|
|
304
|
+
- Overview: https://agently.tech/docs/en/output-control/overview.html
|
|
305
|
+
- Output Format: https://agently.tech/docs/en/output-control/format.html
|
|
306
|
+
- ensure_keys: https://agently.tech/docs/en/output-control/ensure-keys.html
|
|
307
|
+
- Instant Streaming: https://agently.tech/docs/en/output-control/instant-streaming.html
|
|
308
|
+
- **Result & Streaming Events**
|
|
309
|
+
- Result Data: https://agently.tech/docs/en/model-response/result-data.html
|
|
310
|
+
- Streaming Events: https://agently.tech/docs/en/model-response/streaming.html
|
|
311
|
+
- **Session & Memo**
|
|
312
|
+
- Overview: https://agently.tech/docs/en/agent-extensions/session-memo/
|
|
313
|
+
- Quickstart: https://agently.tech/docs/en/agent-extensions/session-memo/quickstart.html
|
|
314
|
+
- **TriggerFlow Orchestration**
|
|
315
|
+
- Overview: https://agently.tech/docs/en/triggerflow/overview.html
|
|
316
|
+
- when Branch: https://agently.tech/docs/en/triggerflow/when-branch.html
|
|
317
|
+
- if / elif / else: https://agently.tech/docs/en/triggerflow/if-branch.html
|
|
318
|
+
- match / case: https://agently.tech/docs/en/triggerflow/match-branch.html
|
|
319
|
+
- batch: https://agently.tech/docs/en/triggerflow/batch.html
|
|
320
|
+
- for_each: https://agently.tech/docs/en/triggerflow/for-each.html
|
|
321
|
+
- Runtime Stream: https://agently.tech/docs/en/triggerflow/runtime-stream.html
|
|
322
|
+
- **Tools & Extensions**
|
|
323
|
+
- Tools: https://agently.tech/docs/en/agent-extensions/tools.html
|
|
324
|
+
- MCP: https://agently.tech/docs/en/agent-extensions/mcp.html
|
|
325
|
+
- auto_func: https://agently.tech/docs/en/agent-extensions/auto-func.html
|
|
326
|
+
- KeyWaiter: https://agently.tech/docs/en/agent-extensions/key-waiter.html
|
|
327
|
+
- **Prompt Management**: https://agently.tech/docs/en/prompt-management/overview.html
|
|
328
|
+
- **Async & Settings**: https://agently.tech/docs/en/async-support.html / https://agently.tech/docs/en/settings.html
|
|
329
|
+
- **Playbook**: https://agently.tech/docs/en/agent-systems/overview.html
|
|
330
|
+
|
|
331
|
+
## 🤝 Community
|
|
332
|
+
|
|
333
|
+
- Discussions: https://github.com/AgentEra/Agently/discussions
|
|
334
|
+
- Issues: https://github.com/AgentEra/Agently/issues
|
|
335
|
+
- WeChat Group: https://doc.weixin.qq.com/forms/AIoA8gcHAFMAScAhgZQABIlW6tV3l7QQf
|
|
336
|
+
|
|
337
|
+
## 📄 License
|
|
338
|
+
|
|
339
|
+
Agently is licensed under [Apache 2.0](LICENSE).
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
<p align="center">
|
|
344
|
+
<b>Start building your production‑ready AI apps →</b><br>
|
|
345
|
+
<code>pip install -U agently</code>
|
|
346
|
+
</p>
|
|
347
|
+
|
|
348
|
+
<p align="center">
|
|
349
|
+
<sub>Questions? Read the <a href="https://agently.tech/docs">docs</a> or join the <a href="https://doc.weixin.qq.com/forms/AIoA8gcHAFMAScAhgZQABIlW6tV3l7QQf">community</a>.</sub>
|
|
350
|
+
</p>
|
|
351
|
+
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
agently/__init__.py,sha256=Gf0LL7Czqeuf6hfvHfEGlACLg0d0osQupyMATB0EBlc,884
|
|
2
|
-
agently/_default_init.py,sha256=
|
|
3
|
-
agently/_default_settings.yaml,sha256=
|
|
4
|
-
agently/base.py,sha256=
|
|
2
|
+
agently/_default_init.py,sha256=3Xjm0qPXgRW9rd7Rz_lo0VxPuI8_qTR7QTizPH8I_4M,2205
|
|
3
|
+
agently/_default_settings.yaml,sha256=D0zVVkC67LfJzK1xGOED_KdOG1iA_4L_4EnYG9919_0,1413
|
|
4
|
+
agently/base.py,sha256=8ZTzwuC9z1tQwh_0a2AMjwIHFg6qyPYPmNdqhXhODdg,5587
|
|
5
5
|
agently/builtins/agent_extensions/AutoFuncExtension.py,sha256=TmwMazwPzb5WXfDqfedY5yZOOMTFIHqaB9Bte29adUc,2433
|
|
6
|
-
agently/builtins/agent_extensions/ChatSessionExtension.py,sha256=
|
|
6
|
+
agently/builtins/agent_extensions/ChatSessionExtension.py,sha256=Bbrc9cn3m-uOY0i8EGq1Cvp71nNpEORrrXTiy_JuCCQ,12048
|
|
7
7
|
agently/builtins/agent_extensions/ConfigurePromptExtension.py,sha256=9wy2zHIDVHbUlj5sI0A03SscUWSzZNc9hNJSEdXFXd0,11390
|
|
8
8
|
agently/builtins/agent_extensions/KeyWaiterExtension.py,sha256=Rf8dB8Yt3_9IJifpiE-Rn6lLIXqZjaNp94lnX6Betgw,5555
|
|
9
|
+
agently/builtins/agent_extensions/SessionExtension.py,sha256=WpPyVoM2iwvyjerJuoikilgdI-iH7BBecnzP8UALRDg,12166
|
|
9
10
|
agently/builtins/agent_extensions/ToolExtension.py,sha256=S3jjumHiauEQ-m46Zkh-1I9ih02kKoj8sBEU82woz1E,6886
|
|
10
|
-
agently/builtins/agent_extensions/__init__.py,sha256=
|
|
11
|
+
agently/builtins/agent_extensions/__init__.py,sha256=rWD8hzJ0ymxxpjxJCdB0x1L5AnhYQnAJUeIAD_MTQ5I,899
|
|
11
12
|
agently/builtins/hookers/ConsoleHooker.py,sha256=aJdDj_nG8CiwyelA505zvtpzBSwD52nFIkBRDJGgq3Y,8099
|
|
12
13
|
agently/builtins/hookers/PureLoggerHooker.py,sha256=fzN0OfhQzgns4KeCNH-qcdm-BdQT0W2kqEmt3Zp2pYI,1906
|
|
13
14
|
agently/builtins/hookers/SystemMessageHooker.py,sha256=1nh1FY70PYyZOAQGfQiGnwIvo4ZF3NSAjeghI3sInn4,7207
|
|
14
15
|
agently/builtins/plugins/ModelRequester/OpenAICompatible.py,sha256=CFTMZHENOi6qsrUfWtgq19P6Ec7H-8vRybVVr4RZfJQ,26773
|
|
15
|
-
agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py,sha256=
|
|
16
|
+
agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py,sha256=8zV-c22Wc2s-590u3o2xgL8EVpP-pvUHh6qVIma2gQw,32840
|
|
16
17
|
agently/builtins/plugins/ResponseParser/AgentlyResponseParser.py,sha256=5iF6NLoMjTtEC3hc-DmatFmSWZK2nKkoiyqHK7Q3Yj4,17847
|
|
18
|
+
agently/builtins/plugins/Session/AgentlyMemoSession.py,sha256=2aDTd1unnoOH6urZdcDCjFCirrWaE1ECp-Atoo7yQ6I,25514
|
|
17
19
|
agently/builtins/plugins/ToolManager/AgentlyToolManager.py,sha256=oaqte5LAryZQMD6vuEbKhe6kOLUyZTRZswC1MDFiYxw,9138
|
|
18
20
|
agently/builtins/plugins/__init__.py,sha256=wj4_U9TTekc2CmjppbXKUREDFRXFX1y0ySOW-CxQuok,801
|
|
19
|
-
agently/builtins/tools/Browse.py,sha256=
|
|
20
|
-
agently/builtins/tools/
|
|
21
|
-
agently/builtins/tools/
|
|
22
|
-
agently/
|
|
21
|
+
agently/builtins/tools/Browse.py,sha256=HA6XQPiyqMs2ZpvF2Qbex8BDij0GloNzXTbRMtgqbqw,3782
|
|
22
|
+
agently/builtins/tools/Cmd.py,sha256=TkI3r4WdVVcDSkJJnadaPDf7fyQZux3y7vxbAawhPbY,3759
|
|
23
|
+
agently/builtins/tools/Search.py,sha256=JQq3QVkmPOiiWufT6xQNScnjoMB7OhqAy4BP1Fufkbw,8350
|
|
24
|
+
agently/builtins/tools/__init__.py,sha256=YVjJOOGLacn6dhybOlszp2aK2PPc3SRH5L8M8p7t-no,668
|
|
25
|
+
agently/core/Agent.py,sha256=as4AISWRxSNQ4McyK6rZFDz-PkR_eRE0o6ZF3hehjhA,10279
|
|
23
26
|
agently/core/EventCenter.py,sha256=sknU5w9MpGDQgMOF9c5k4PfM4SNT5X_LrpYte2HaFNM,10861
|
|
24
27
|
agently/core/ExtensionHandlers.py,sha256=88iSAW50bgMshB56cTgKg30eOjZQyXiJY1en4w7afWY,2076
|
|
25
|
-
agently/core/ModelRequest.py,sha256=
|
|
28
|
+
agently/core/ModelRequest.py,sha256=hroVb-U-knygXMZ1CCy84pJlP1GHSBNZPI809jEgQak,24350
|
|
26
29
|
agently/core/PluginManager.py,sha256=fwRxvqPMgXYIrclhRHtkaPsyvn6SaeBFqvL7tTzYwck,4410
|
|
27
|
-
agently/core/Prompt.py,sha256=
|
|
30
|
+
agently/core/Prompt.py,sha256=vCi_64A-ITiJ-6ZL2PduRdTXoHp8xpKJa2z0ejCJ4uQ,6899
|
|
31
|
+
agently/core/Session.py,sha256=uVofUOVLnDGgMr6Bj6K3dZgap7mLILNcN1fxYTsBx6Y,7063
|
|
28
32
|
agently/core/Tool.py,sha256=PNYf_BwVefr8IOqf5asLaVq2fU7hQaFJwJVj3S4fq84,1871
|
|
29
33
|
agently/core/TriggerFlow/BluePrint.py,sha256=H_TYymWOci-ZvQzqyRxpkHjO77zlzXLukLUUctX4ftM,4887
|
|
30
34
|
agently/core/TriggerFlow/Chunk.py,sha256=xPWr_ofpl-iG4jHIJfB5mPanmn70pq7x8GCcz3G8NPc,1583
|
|
@@ -36,29 +40,32 @@ agently/core/TriggerFlow/process/BaseProcess.py,sha256=tBAMCI2Yd8Ylfi5CpkhlSVLH5
|
|
|
36
40
|
agently/core/TriggerFlow/process/ForEachProcess.py,sha256=DD4frz9mTsKgnPXnHJD53hL6uiiU6h338p7ipud8zMU,4897
|
|
37
41
|
agently/core/TriggerFlow/process/MatchCaseProcess.py,sha256=MKY5Yh66JiMABhCzamRl8UZOBjbD75TFp84Jw6o_t68,7900
|
|
38
42
|
agently/core/TriggerFlow/process/__init__.py,sha256=BP5bAr9LRVVD83KFqXeprgTmXA1iCSOSsD509BtoX_E,753
|
|
39
|
-
agently/core/__init__.py,sha256=
|
|
40
|
-
agently/integrations/chromadb.py,sha256=
|
|
43
|
+
agently/core/__init__.py,sha256=7QJdqGWgmiGvyXVxvRang9eQkbyNAzJu7RissUtzvcw,1243
|
|
44
|
+
agently/integrations/chromadb.py,sha256=oGc-eZRK4pXo5QPbjpC1_RoRzhv2Hqadp80TPEEvw8c,10374
|
|
41
45
|
agently/types/__init__.py,sha256=xb8GMY-ULncO_PY9rfRUsyi12wAQQJx8gAAnoM30uZA,592
|
|
42
|
-
agently/types/data/__init__.py,sha256=
|
|
46
|
+
agently/types/data/__init__.py,sha256=ulo2p9SBV-v75zPZWcTczDnAcYO_IlDe3JMGNOZa4vM,1662
|
|
43
47
|
agently/types/data/event.py,sha256=LFQW7MN_QGOis3XV-8K6jNXWsLvT7tYxo4BZbUBCpfI,1790
|
|
44
|
-
agently/types/data/prompt.py,sha256=
|
|
48
|
+
agently/types/data/prompt.py,sha256=QAY7LJcFJKttD79cfp91dEbgstqZNwwer6_8UoTmF4s,5398
|
|
45
49
|
agently/types/data/request.py,sha256=Do-9g5QxZRMYjaoHCZYwHbj28r-t4noAAtOebw764P4,1924
|
|
46
50
|
agently/types/data/response.py,sha256=QYrrZXh_fXsHRltKtd6FKIfmJlgV-stsg6B0AIXueto,3774
|
|
47
51
|
agently/types/data/serializable.py,sha256=v2KlyKNOKp4L6J_Ueupb-gCyrnngvBskFUwNPSJQgnA,844
|
|
48
|
-
agently/types/data/tool.py,sha256=
|
|
52
|
+
agently/types/data/tool.py,sha256=KJ1-w3qp_x7uN_wJkIrJWMe_4Y8UopWBRe01QTisRLE,1705
|
|
53
|
+
agently/types/plugins/BuiltInTool.py,sha256=OYBOHTc6VG3YFaYQl_ZlFEUCzoSB5mBIoFN1RaL1JBI,728
|
|
49
54
|
agently/types/plugins/EventHooker.py,sha256=kb80-baVc3fVlrddW5syv9uSD8a2Mcw8Fd3I2HQhY_Y,1030
|
|
50
55
|
agently/types/plugins/ModelRequester.py,sha256=urG1zFX0b4U6ZKSO50IbW5IHK3ydmRgUom7O7Niqk8s,3875
|
|
51
56
|
agently/types/plugins/PromptGenerator.py,sha256=V8kqT0Eeq09AQqfGA-SZ5mNKeit1UrmqlDQCquSMzUU,4752
|
|
52
57
|
agently/types/plugins/ResponseParser.py,sha256=6dCVWz61gaHOxsX9e5sYFqcWRZ5hBnNXAarT0-9uCUY,4566
|
|
58
|
+
agently/types/plugins/Session.py,sha256=WO_V2hW8jWh1bs-cHEIKgLDy6-zj22DjCgFzhdp1VdY,5485
|
|
53
59
|
agently/types/plugins/ToolManager.py,sha256=q1Y3G_tzh1AU3s13H-zTDZIkR4W1mjh9E6AKudFOvyg,2421
|
|
54
|
-
agently/types/plugins/__init__.py,sha256=
|
|
55
|
-
agently/types/plugins/base.py,sha256=
|
|
60
|
+
agently/types/plugins/__init__.py,sha256=CtSeuBvC9EiS3uX2FWFLLKBkdP6EAdakO-T7LX9TWII,1361
|
|
61
|
+
agently/types/plugins/base.py,sha256=O3dskXxoc7E1_qd8nTfJr7sP42jbJlPYijXKDX-cM2E,1178
|
|
56
62
|
agently/types/trigger_flow/__init__.py,sha256=Gj31SmWBC4qtrOqQedyGsnCfeSkUf3XvZNFrJ2QbMNw,777
|
|
57
63
|
agently/types/trigger_flow/trigger_flow.py,sha256=6lvhDwizIV5p3h61l1GsmJU_9Tw8v3u-SnHuygkSJdo,3799
|
|
58
|
-
agently/utils/
|
|
64
|
+
agently/utils/AGENT_UTILS_GUIDE.md,sha256=7BKewBgRMOXJKox8u8IE9EjVHWJlAQeVJNuN7cfPzTM,7510
|
|
65
|
+
agently/utils/DataFormatter.py,sha256=hl1VyAiOSKk9nAEa15yCIVD7wWm3c0GQZLtHPFMVlNM,12539
|
|
59
66
|
agently/utils/DataLocator.py,sha256=0TSMONLPYQVvdJftoXcW4BMhwGFl2JrovAGH3LTthn4,8652
|
|
60
67
|
agently/utils/DataPathBuilder.py,sha256=sEzE1i2EWn7NMkCCXDT50gR6_qMzcZ0y0YGkYbXdB3s,10007
|
|
61
|
-
agently/utils/FunctionShifter.py,sha256=
|
|
68
|
+
agently/utils/FunctionShifter.py,sha256=kf4zBp3dDkb87GaH6YvnL6Smf8p8slPvovfDV4-OQOI,5920
|
|
62
69
|
agently/utils/GeneratorConsumer.py,sha256=EXpz2XGnv6rPdz8bPetJu3LpWIVhMvIi8GLG1Bpe7Ys,7459
|
|
63
70
|
agently/utils/LazyImport.py,sha256=PfXc2iILXb7WVj6UD45_3qInow6z0cvhFlDqxTK-HfY,9120
|
|
64
71
|
agently/utils/Logger.py,sha256=reIj6a7mNtLYDx3brLKEf0I8LbNkhXmL8Yc-DXnnsCU,2967
|
|
@@ -70,8 +77,9 @@ agently/utils/Settings.py,sha256=0vWNhVBKZLRKwuIKoXn-tYNZMajMQHLHdqrGhBA2S3Q,585
|
|
|
70
77
|
agently/utils/Storage.py,sha256=E7QyNJ9T0yOUafPgdP90La698hgLMSGjhJ7qCEHzxxw,9438
|
|
71
78
|
agently/utils/StreamingJSONCompleter.py,sha256=aZ9zuGUTQlP-QKbXHUZCf6EtVuG49MKn8xdhw0VhDEA,4292
|
|
72
79
|
agently/utils/StreamingJSONParser.py,sha256=sPPJOtj5OYvsrukRErcoxRl4yuV1zDuf7pQ_pvw_Zow,21116
|
|
73
|
-
agently/utils/
|
|
74
|
-
agently
|
|
75
|
-
agently-4.0.7.
|
|
76
|
-
agently-4.0.7.
|
|
77
|
-
agently-4.0.7.
|
|
80
|
+
agently/utils/TimeInfo.py,sha256=lgdeXpTJQOqw0czvrsMcxNeY84wuvCF7kWpY4W8nhDY,750
|
|
81
|
+
agently/utils/__init__.py,sha256=A2EXx-TVU3Ca1s3fMlWM0se0BgI-ZRCXZgl4Hue-lco,1352
|
|
82
|
+
agently-4.0.7.3.dist-info/METADATA,sha256=z3ncC9OPCMAcF9kccQ6pK8rzgVCk4vlJMd-KL4J6AMM,14447
|
|
83
|
+
agently-4.0.7.3.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
84
|
+
agently-4.0.7.3.dist-info/licenses/LICENSE,sha256=Y5ZgAdYgMFigPT8dhN18dTLRtBshOSfWhTDRO1t0Cq4,11360
|
|
85
|
+
agently-4.0.7.3.dist-info/RECORD,,
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: agently
|
|
3
|
-
Version: 4.0.7.1
|
|
4
|
-
Summary:
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Author: Agently Team
|
|
8
|
-
Author-email: developer@agently.tech
|
|
9
|
-
Requires-Python: >=3.10
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
-
Requires-Dist: greenlet (>=3.2.3,<4.0.0)
|
|
18
|
-
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
19
|
-
Requires-Dist: httpx-sse (>=0.4.1,<0.5.0)
|
|
20
|
-
Requires-Dist: json5 (>=0.12.0,<0.13.0)
|
|
21
|
-
Requires-Dist: packaging (>=25.0,<26.0)
|
|
22
|
-
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
|
|
23
|
-
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
|
|
24
|
-
Requires-Dist: stamina (>=25.1.0,<26.0.0)
|
|
25
|
-
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
|
|
28
|
-
<img width="640" alt="image" src="https://github.com/user-attachments/assets/c645d031-c8b0-4dba-a515-9d7a4b0a6881" />
|
|
29
|
-
|
|
30
|
-
# Agently 4
|
|
31
|
-
|
|
32
|
-
[English Introduction](https://github.com/AgentEra/Agently/blob/main/README.md) | [中文介绍](https://github.com/AgentEra/Agently/blob/main/README_CN.md)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
> *Speed Up Your GenAI Application Development*
|
|
36
|
-
|
|
37
|
-
[](https://github.com/AgentEra/Agently/blob/main/LICENSE)
|
|
38
|
-
[](https://pypistats.org/packages/agently)
|
|
39
|
-
[](https://star-history.com/#agentera/agently)
|
|
40
|
-
[](https://x.com/AgentlyTech)
|
|
41
|
-
<a href="https://doc.weixin.qq.com/forms/AIoA8gcHAFMAScAhgZQABIlW6tV3l7QQf">
|
|
42
|
-
<img alt="WeChat" src="https://img.shields.io/badge/WeChat%20Group-Apply-brightgreen?logo=wechat&style=flat-square">
|
|
43
|
-
</a>
|
|
44
|
-
|
|
45
|
-
<p>
|
|
46
|
-
<a href="https://github.com/AgentEra/Agently/discussions/categories/general">
|
|
47
|
-
<img alt="Discussions" src="https://img.shields.io/badge/Agently%20General%20Discussions-JOIN-brightgreen.svg?style=for-the-badge" />
|
|
48
|
-
</a>
|
|
49
|
-
<a href="https://github.com/AgentEra/Agently/discussions/categories/contribute-to-agently-4">
|
|
50
|
-
<img alt="Contribute" src="https://img.shields.io/badge/Contribute%20to%20Agently%204%20-Join-blueviolet.svg?style=for-the-badge">
|
|
51
|
-
</a>
|
|
52
|
-
<a href="https://github.com/AgentEra/Agently/issues">
|
|
53
|
-
<img alt="Issues" src="https://img.shields.io/badge/Report%20Issues-Report-red.svg?style=for-the-badge">
|
|
54
|
-
</a>
|
|
55
|
-
</p>
|
|
56
|
-
|
|
57
|
-
<hr />
|
|
58
|
-
|
|
59
|
-
<p align="center">
|
|
60
|
-
<b><a href = "https://github.com/AgentEra/Agently/discussions">💬 Official Github Discussion Forum</a> - Welcome to Share Anything about Agently with Us</b>
|
|
61
|
-
</p>
|
|
62
|
-
|
|
63
|
-
<hr />
|
|
64
|
-
|
|
65
|
-
## Getting Started
|
|
66
|
-
|
|
67
|
-
Agently is a Python-based framework for building GenAI applications. You can install it via pip and import features using `from agently import Agently`.
|
|
68
|
-
|
|
69
|
-
Install the latest version via pip:
|
|
70
|
-
|
|
71
|
-
```shell
|
|
72
|
-
pip install -U agently
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
> ℹ️ If you're looking for Agently v3's code and documents, please visit branch [`v3-final`](https://github.com/AgentEra/Agently/tree/v3-final)
|
|
76
|
-
|
|
77
|
-
Clone the repository and install locally:
|
|
78
|
-
|
|
79
|
-
```shell
|
|
80
|
-
git clone git@github.com:AgentEra/Agently.git
|
|
81
|
-
cd Agently
|
|
82
|
-
pip install -e .
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## What is Agently?
|
|
86
|
-
|
|
87
|
-
Agently aims to provide an intuitive, efficient, and developer-friendly framework for GenAI application development. By deeply understanding the runtime control needs of model outputs, Agently bridges the gap between large language models and real-world applications.
|
|
88
|
-
|
|
89
|
-
Agently abstracts away the complexities of:
|
|
90
|
-
- Varying model parameters
|
|
91
|
-
- Output formatting
|
|
92
|
-
- Communication between engineering modules and GenAI logic
|
|
93
|
-
|
|
94
|
-
...while giving developers full control over business logic and integration with existing systems.
|
|
95
|
-
|
|
96
|
-
We believe GenAI is not a generational replacement for current systems but a powerful extension. Engineers and tools are key to turning GenAI's possibilities into reality.
|
|
97
|
-
|
|
98
|
-
Our mission is to build the best developer experience (DX) for GenAI application engineers.
|
|
99
|
-
|
|
100
|
-
## Core Features Overview
|
|
101
|
-
|
|
102
|
-
### Structured and Streamed Output Control for LLMs
|
|
103
|
-
|
|
104
|
-
Agently allows you to control and consume model outputs using a developer-centric pattern:
|
|
105
|
-
|
|
106
|
-
```python
|
|
107
|
-
from agently import Agently
|
|
108
|
-
|
|
109
|
-
agent = Agently.create_agent()
|
|
110
|
-
|
|
111
|
-
(
|
|
112
|
-
agent
|
|
113
|
-
.input("What time is it now?", always=True)
|
|
114
|
-
.info({
|
|
115
|
-
"default_timezone": "",
|
|
116
|
-
"tool_list": [{
|
|
117
|
-
"name": "get_current_time",
|
|
118
|
-
"desc": "Get current time by time zone provided",
|
|
119
|
-
"kwargs": {
|
|
120
|
-
"timezone_str": (str, "time zone string in ZoneInfo()"),
|
|
121
|
-
},
|
|
122
|
-
}]
|
|
123
|
-
})
|
|
124
|
-
.output({
|
|
125
|
-
"first_time_response": (str, ),
|
|
126
|
-
"tool_using_judgement": (bool, ),
|
|
127
|
-
"tool_using_command": (
|
|
128
|
-
{
|
|
129
|
-
"name": (str, "Decide which tool to use by tool name:{tool_list.[].name}"),
|
|
130
|
-
"kwargs": (dict, "According {tool_list.[].args} to output kwargs dictionary"),
|
|
131
|
-
},
|
|
132
|
-
"If {tool_using_judgement}==False, just output {}",
|
|
133
|
-
),
|
|
134
|
-
})
|
|
135
|
-
)
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Then, consume the model response:
|
|
139
|
-
|
|
140
|
-
```python
|
|
141
|
-
response = agent.get_response()
|
|
142
|
-
|
|
143
|
-
# Get raw output
|
|
144
|
-
response_text = response.get_text()
|
|
145
|
-
|
|
146
|
-
# Get parsed structured result
|
|
147
|
-
response_dict = response.get_result()
|
|
148
|
-
|
|
149
|
-
# Streamed output
|
|
150
|
-
for delta in response.get_generator(content="delta"):
|
|
151
|
-
print(delta, end="", flush=True)
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Or use the instant parsing mode:
|
|
155
|
-
|
|
156
|
-
```python
|
|
157
|
-
instant_response_generator = response.get_generator(content="instant")
|
|
158
|
-
|
|
159
|
-
use_tool = False
|
|
160
|
-
|
|
161
|
-
for instant_message in instant_response_generator:
|
|
162
|
-
if instant_message.path == "first_time_response":
|
|
163
|
-
if instant_message.delta is not None:
|
|
164
|
-
print(instant_message.delta, end="", flush=True)
|
|
165
|
-
elif instant_message.path == "tool_using_judgement":
|
|
166
|
-
use_tool = instant_message.value
|
|
167
|
-
print()
|
|
168
|
-
if use_tool:
|
|
169
|
-
print("[USE TOOL!]")
|
|
170
|
-
else:
|
|
171
|
-
print("[NO NEED TO USE TOOL!]")
|
|
172
|
-
if use_tool:
|
|
173
|
-
if instant_message.path == "tool_using_command.name" and instant_message.is_complete:
|
|
174
|
-
print(f"I want to use: '{ instant_message.value }'")
|
|
175
|
-
elif instant_message.path == "tool_using_command":
|
|
176
|
-
print(f"call: { instant_message.value }")
|
|
177
|
-
print(f"kwargs: { instant_message.value }")
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
```shell
|
|
181
|
-
I can check the current time for you. Please specify a timezone (e.g., 'America/New_York') so I can provide the accurate time.
|
|
182
|
-
[NO NEED TO USE TOOL!]
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
## [More documentation coming soon...]
|
|
186
|
-
|
|
187
|
-
## 💬 WeChat Group (Join Us)
|
|
188
|
-
|
|
189
|
-
> [Click Here to Apply](https://doc.weixin.qq.com/forms/AIoA8gcHAFMAScAhgZQABIlW6tV3l7QQf)
|
|
190
|
-
> or Scan the QR Code Below:
|
|
191
|
-
|
|
192
|
-
<p align="center">
|
|
193
|
-
<img width="120" alt="WeChat QR" src="https://github.com/AgentEra/Agently/assets/4413155/7f4bc9bf-a125-4a1e-a0a4-0170b718c1a6">
|
|
194
|
-
</p>
|
|
File without changes
|