2
2
3
3
AgentPress is a collection of _ simple, but powerful_ utilities that serve as building blocks for creating AI agents. * Plug, play, and customize.*
4
4
5
- ## How It Works
6
-
7
- Each AI agent iteration follows a clear, modular flow:
8
-
9
- 1 . ** Message & LLM Handling**
10
- - Messages are managed in threads via ` ThreadManager `
11
- - LLM API calls are made through a unified interface (` llm.py ` )
12
- - Supports streaming responses for real-time interaction
13
-
14
- 2 . ** Response Processing**
15
- - LLM returns both content and tool calls
16
- - Content is streamed in real-time
17
- - Tool calls are parsed using either:
18
- - Standard OpenAPI function calling
19
- - XML-based tool definitions
20
- - Custom parsers (extend ` ToolParserBase ` )
21
-
22
- 3 . ** Tool Execution**
23
- - Tools are executed either:
24
- - In real-time during streaming (` execute_tools_on_stream ` )
25
- - After complete response
26
- - In parallel or sequential order
27
- - Supports both standard and XML tool formats
28
- - Extensible through ` ToolExecutorBase `
29
-
30
- 4 . ** Results Management**
31
- - Results from both content and tool executions are handled
32
- - Supports different result formats (standard/XML)
33
- - Customizable through ` ResultsAdderBase `
5
+ ![ AgentPress Flow] ( images/cover.png )
34
6
35
- This modular architecture allows you to:
36
- - Use standard OpenAPI function calling
37
- - Switch to XML-based tool definitions
38
- - Create custom processors by extending base classes
39
- - Mix and match different approaches
7
+ See [ How It Works] ( #how-it-works ) for an explanation of this flow.
40
8
41
- - ** Threads** : Simple message thread handling utilities with streaming support
42
- - ** Tools** : Flexible tool definition with both OpenAPI and XML formats
9
+ ## Core Components
10
+ - ** Threads** : Manage Messages[ ] as threads.
11
+ - ** Tools** : Register code as callable tools with definitions in both OpenAPI and XML
12
+ - ** Response Processing** : Support for both native-LLM OpenAPI and XML-based tool calling
43
13
- ** State Management** : Thread-safe JSON key-value state management
44
- - ** LLM Integration** : Provider-agnostic LLM calls via LiteLLM
45
- - ** Response Processing** : Support for both standard and XML-based tool calling
14
+ - ** LLM** : +100 LLMs using the OpenAI I/O Format powered by LiteLLM
46
15
47
16
## Installation & Setup
48
17
@@ -66,6 +35,8 @@ Check out [File Overview](#file-overview) for explanations of the generated file
66
35
- Creates a ` workspace ` directory for the agent to work in
67
36
68
37
38
+
39
+
69
40
## Quick Start
70
41
71
42
1 . Set up your environment variables in a ` .env ` file:
@@ -175,6 +146,42 @@ asyncio.run(main())
175
146
streamlit run agentpress/thread_viewer_ui.py
176
147
```
177
148
149
+ ## How It Works
150
+
151
+ Each AI agent iteration follows a clear, modular flow:
152
+
153
+ 1 . ** Message & LLM Handling**
154
+ - Messages are managed in threads via ` ThreadManager `
155
+ - LLM API calls are made through a unified interface (` llm.py ` )
156
+ - Supports streaming responses for real-time interaction
157
+
158
+ 2 . ** Response Processing**
159
+ - LLM returns both content and tool calls
160
+ - Content is streamed in real-time
161
+ - Tool calls are parsed using either:
162
+ - Standard OpenAPI function calling
163
+ - XML-based tool definitions
164
+ - Custom parsers (extend ` ToolParserBase ` )
165
+
166
+ 3 . ** Tool Execution**
167
+ - Tools are executed either:
168
+ - In real-time during streaming (` execute_tools_on_stream ` )
169
+ - After complete response
170
+ - In parallel or sequential order
171
+ - Supports both standard and XML tool formats
172
+ - Extensible through ` ToolExecutorBase `
173
+
174
+ 4 . ** Results Management**
175
+ - Results from both content and tool executions are handled
176
+ - Supports different result formats (standard/XML)
177
+ - Customizable through ` ResultsAdderBase `
178
+
179
+ This modular architecture allows you to:
180
+ - Use standard OpenAPI function calling
181
+ - Switch to XML-based tool definitions
182
+ - Create custom processors by extending base classes
183
+ - Mix and match different approaches
184
+
178
185
## File Overview
179
186
180
187
### Core Components
0 commit comments