agently 4.0.7__py3-none-any.whl → 4.0.7.2__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.
Files changed (37) hide show
  1. agently/_default_init.py +4 -0
  2. agently/_default_settings.yaml +3 -1
  3. agently/base.py +19 -1
  4. agently/builtins/agent_extensions/ChatSessionExtension.py +2 -2
  5. agently/builtins/agent_extensions/SessionExtension.py +294 -0
  6. agently/builtins/agent_extensions/__init__.py +1 -0
  7. agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py +57 -17
  8. agently/builtins/plugins/Session/AgentlyMemoSession.py +652 -0
  9. agently/builtins/tools/Browse.py +11 -3
  10. agently/builtins/tools/Cmd.py +112 -0
  11. agently/builtins/tools/Search.py +28 -2
  12. agently/builtins/tools/__init__.py +1 -0
  13. agently/core/Agent.py +7 -7
  14. agently/core/ModelRequest.py +6 -5
  15. agently/core/Prompt.py +1 -1
  16. agently/core/Session.py +85 -0
  17. agently/core/TriggerFlow/TriggerFlow.py +1 -1
  18. agently/core/TriggerFlow/process/BaseProcess.py +8 -4
  19. agently/integrations/chromadb.py +4 -4
  20. agently/types/data/__init__.py +2 -0
  21. agently/types/data/prompt.py +6 -1
  22. agently/types/data/tool.py +9 -0
  23. agently/types/plugins/BuiltInTool.py +22 -0
  24. agently/types/plugins/Session.py +159 -0
  25. agently/types/plugins/__init__.py +21 -0
  26. agently/types/plugins/base.py +1 -1
  27. agently/utils/AGENT_UTILS_GUIDE.md +175 -0
  28. agently/utils/DataFormatter.py +14 -4
  29. agently/utils/DataLocator.py +108 -31
  30. agently/utils/FunctionShifter.py +3 -2
  31. agently/utils/TimeInfo.py +22 -0
  32. agently/utils/__init__.py +1 -0
  33. agently-4.0.7.2.dist-info/METADATA +433 -0
  34. {agently-4.0.7.dist-info → agently-4.0.7.2.dist-info}/RECORD +36 -28
  35. {agently-4.0.7.dist-info → agently-4.0.7.2.dist-info}/WHEEL +1 -1
  36. agently-4.0.7.dist-info/METADATA +0 -194
  37. {agently-4.0.7.dist-info → agently-4.0.7.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,194 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: agently
3
- Version: 4.0.7
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
- [![license](https://img.shields.io/badge/license-Apache2.0-blue.svg?style=flat-square)](https://github.com/AgentEra/Agently/blob/main/LICENSE)
38
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/agently?style=flat-square)](https://pypistats.org/packages/agently)
39
- [![GitHub star chart](https://img.shields.io/github/stars/agentera/agently?style=flat-square)](https://star-history.com/#agentera/agently)
40
- [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/AgentlyTech.svg?style=social&label=Follow%20%40AgentlyTech)](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>