slide-tyler 5.2.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.
- slide_tyler-5.2.2.dist-info/METADATA +526 -0
- slide_tyler-5.2.2.dist-info/RECORD +38 -0
- slide_tyler-5.2.2.dist-info/WHEEL +4 -0
- slide_tyler-5.2.2.dist-info/entry_points.txt +2 -0
- slide_tyler-5.2.2.dist-info/licenses/LICENSE +21 -0
- tyler/__init__.py +16 -0
- tyler/a2a/__init__.py +11 -0
- tyler/a2a/adapter.py +359 -0
- tyler/a2a/client.py +386 -0
- tyler/a2a/server.py +435 -0
- tyler/cli/__init__.py +1 -0
- tyler/cli/chat.py +580 -0
- tyler/cli/init.py +293 -0
- tyler/cli/main.py +44 -0
- tyler/config.py +371 -0
- tyler/eval/__init__.py +48 -0
- tyler/eval/agent_eval.py +302 -0
- tyler/eval/conversations.py +156 -0
- tyler/eval/expectations.py +122 -0
- tyler/eval/mock_tools.py +168 -0
- tyler/eval/results.py +184 -0
- tyler/eval/scorers.py +343 -0
- tyler/mcp/__init__.py +11 -0
- tyler/mcp/adapter.py +238 -0
- tyler/mcp/client.py +364 -0
- tyler/mcp/config_loader.py +287 -0
- tyler/models/__init__.py +13 -0
- tyler/models/agent.py +1841 -0
- tyler/models/completion_handler.py +275 -0
- tyler/models/execution.py +52 -0
- tyler/models/message_factory.py +239 -0
- tyler/models/tool_call.py +210 -0
- tyler/models/tool_manager.py +186 -0
- tyler/utils/__init__.py +1 -0
- tyler/utils/files.py +90 -0
- tyler/utils/logging.py +58 -0
- tyler/utils/tool_runner.py +348 -0
- tyler/utils/tool_strategies.py +341 -0
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: slide-tyler
|
|
3
|
+
Version: 5.2.2
|
|
4
|
+
Summary: Tyler: A development kit for manifesting AI agents with a complete lack of conventional limitations
|
|
5
|
+
Project-URL: Homepage, https://github.com/adamwdraper/slide
|
|
6
|
+
Project-URL: Documentation, https://github.com/adamwdraper/slide#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/adamwdraper/slide
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/adamwdraper/slide/issues
|
|
9
|
+
Author: adamwdraper
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: aiohappyeyeballs>=2.4.4
|
|
22
|
+
Requires-Dist: aiohttp>=3.11.11
|
|
23
|
+
Requires-Dist: aiosignal>=1.3.2
|
|
24
|
+
Requires-Dist: aiosqlite>=0.21.0
|
|
25
|
+
Requires-Dist: alembic>=1.14.1
|
|
26
|
+
Requires-Dist: annotated-types>=0.7.0
|
|
27
|
+
Requires-Dist: anyio>=4.7.0
|
|
28
|
+
Requires-Dist: apscheduler>=3.11.0
|
|
29
|
+
Requires-Dist: asyncpg>=0.30.0
|
|
30
|
+
Requires-Dist: attrs>=24.3.0
|
|
31
|
+
Requires-Dist: backoff>=2.2.1
|
|
32
|
+
Requires-Dist: beautifulsoup4>=4.12.0
|
|
33
|
+
Requires-Dist: blinker>=1.9.0
|
|
34
|
+
Requires-Dist: browser-use>=0.1.40
|
|
35
|
+
Requires-Dist: cachetools>=5.5.0
|
|
36
|
+
Requires-Dist: click>=8.1.8
|
|
37
|
+
Requires-Dist: distro>=1.9.0
|
|
38
|
+
Requires-Dist: docker-pycreds>=0.4.0
|
|
39
|
+
Requires-Dist: email-validator>=2.2.0
|
|
40
|
+
Requires-Dist: emoji>=2.14.0
|
|
41
|
+
Requires-Dist: filelock>=3.16.1
|
|
42
|
+
Requires-Dist: filetype>=1.2.0
|
|
43
|
+
Requires-Dist: flask>=3.1.0
|
|
44
|
+
Requires-Dist: frozenlist>=1.5.0
|
|
45
|
+
Requires-Dist: fsspec>=2024.12.0
|
|
46
|
+
Requires-Dist: gitdb>=4.0.11
|
|
47
|
+
Requires-Dist: gitpython>=3.1.43
|
|
48
|
+
Requires-Dist: gql>=3.5.0
|
|
49
|
+
Requires-Dist: graphql-core>=3.2.5
|
|
50
|
+
Requires-Dist: greenlet>=3.1.1
|
|
51
|
+
Requires-Dist: h11>=0.14.0
|
|
52
|
+
Requires-Dist: httpcore>=1.0.7
|
|
53
|
+
Requires-Dist: httpx>=0.27.2
|
|
54
|
+
Requires-Dist: huggingface-hub>=0.27.0
|
|
55
|
+
Requires-Dist: imap-tools>=1.9.0
|
|
56
|
+
Requires-Dist: importlib-metadata>=8.5.0
|
|
57
|
+
Requires-Dist: iniconfig>=2.0.0
|
|
58
|
+
Requires-Dist: itsdangerous>=2.2.0
|
|
59
|
+
Requires-Dist: jinja2>=3.1.5
|
|
60
|
+
Requires-Dist: jiter>=0.8.2
|
|
61
|
+
Requires-Dist: jsonschema-specifications>=2024.10.1
|
|
62
|
+
Requires-Dist: jsonschema>=4.23.0
|
|
63
|
+
Requires-Dist: litellm>=1.75.3
|
|
64
|
+
Requires-Dist: mako>=1.3.9
|
|
65
|
+
Requires-Dist: markdown-it-py>=3.0.0
|
|
66
|
+
Requires-Dist: markupsafe>=3.0.2
|
|
67
|
+
Requires-Dist: mcp>=1.3.0
|
|
68
|
+
Requires-Dist: mdurl>=0.1.2
|
|
69
|
+
Requires-Dist: multidict>=6.1.0
|
|
70
|
+
Requires-Dist: narwhals>=1.19.1
|
|
71
|
+
Requires-Dist: numpy>=2.2.1
|
|
72
|
+
Requires-Dist: openai>=1.99.2
|
|
73
|
+
Requires-Dist: packaging>=24.2
|
|
74
|
+
Requires-Dist: pandas>=2.2.3
|
|
75
|
+
Requires-Dist: pdf2image>=1.17.0
|
|
76
|
+
Requires-Dist: pillow>=11.0.0
|
|
77
|
+
Requires-Dist: platformdirs>=4.3.6
|
|
78
|
+
Requires-Dist: propcache>=0.2.1
|
|
79
|
+
Requires-Dist: protobuf>=5.29.2
|
|
80
|
+
Requires-Dist: psutil>=6.1.1
|
|
81
|
+
Requires-Dist: pyarrow>=18.1.0
|
|
82
|
+
Requires-Dist: pydantic-core>=2.27.2
|
|
83
|
+
Requires-Dist: pydantic>=2.10.4
|
|
84
|
+
Requires-Dist: pygments>=2.18.0
|
|
85
|
+
Requires-Dist: pypdf>=5.3.0
|
|
86
|
+
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
87
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
88
|
+
Requires-Dist: pytz>=2024.2
|
|
89
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
90
|
+
Requires-Dist: referencing>=0.35.1
|
|
91
|
+
Requires-Dist: regex>=2024.11.6
|
|
92
|
+
Requires-Dist: requests-toolbelt>=1.0.0
|
|
93
|
+
Requires-Dist: requests>=2.32.3
|
|
94
|
+
Requires-Dist: rich>=13.9.4
|
|
95
|
+
Requires-Dist: rpds-py>=0.22.3
|
|
96
|
+
Requires-Dist: sentry-sdk>=2.19.2
|
|
97
|
+
Requires-Dist: setproctitle>=1.3.4
|
|
98
|
+
Requires-Dist: six>=1.17.0
|
|
99
|
+
Requires-Dist: slack-sdk>=3.34.0
|
|
100
|
+
Requires-Dist: slide-lye>=5.2.2
|
|
101
|
+
Requires-Dist: slide-narrator>=5.2.2
|
|
102
|
+
Requires-Dist: smmap>=5.0.1
|
|
103
|
+
Requires-Dist: sniffio>=1.3.1
|
|
104
|
+
Requires-Dist: soupsieve>=2.6
|
|
105
|
+
Requires-Dist: sqlalchemy>=2.0.36
|
|
106
|
+
Requires-Dist: starlette>=0.41.3
|
|
107
|
+
Requires-Dist: tenacity>=9.0.0
|
|
108
|
+
Requires-Dist: tiktoken>=0.8.0
|
|
109
|
+
Requires-Dist: tokenizers>=0.21.0
|
|
110
|
+
Requires-Dist: toml>=0.10.2
|
|
111
|
+
Requires-Dist: tornado>=6.4.2
|
|
112
|
+
Requires-Dist: tqdm>=4.67.1
|
|
113
|
+
Requires-Dist: typing-extensions>=4.12.2
|
|
114
|
+
Requires-Dist: tzdata>=2024.2
|
|
115
|
+
Requires-Dist: urllib3>=2.3.0
|
|
116
|
+
Requires-Dist: uuid-utils>=0.10.0
|
|
117
|
+
Requires-Dist: wandb>=0.19.1
|
|
118
|
+
Requires-Dist: weave>=0.52.11
|
|
119
|
+
Requires-Dist: werkzeug>=3.1.3
|
|
120
|
+
Requires-Dist: yarl>=1.18.3
|
|
121
|
+
Requires-Dist: zipp>=3.21.0
|
|
122
|
+
Provides-Extra: dev
|
|
123
|
+
Requires-Dist: coverage>=7.6.10; extra == 'dev'
|
|
124
|
+
Requires-Dist: pip-tools>=7.4.1; extra == 'dev'
|
|
125
|
+
Requires-Dist: pipdeptree>=2.25.0; extra == 'dev'
|
|
126
|
+
Requires-Dist: pytest-asyncio>=0.25.2; extra == 'dev'
|
|
127
|
+
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
|
|
128
|
+
Requires-Dist: pytest>=8.3.4; extra == 'dev'
|
|
129
|
+
Description-Content-Type: text/markdown
|
|
130
|
+
|
|
131
|
+
# Tyler
|
|
132
|
+
|
|
133
|
+
<div align="center">
|
|
134
|
+
<img src="docs/static/img/tyler-soap.png" alt="Tyler Logo" width="200" style="border-radius: 8px;"/>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
### A development kit for manifesting AI agents with a complete lack of conventional limitations
|
|
138
|
+
|
|
139
|
+
Tyler is the core agent framework in the Slide ecosystem. It makes it easy to build effective AI agents in just a few lines of code, providing all the essential components needed for production-ready AI agents that can understand context, manage conversations, and effectively use tools.
|
|
140
|
+
|
|
141
|
+
### Key Features
|
|
142
|
+
|
|
143
|
+
- **Multimodal support**: Process and understand images, audio, PDFs, and more out of the box
|
|
144
|
+
- **Ready-to-use tools**: Comprehensive set of built-in tools via the Lye package, with easy integration of custom tools
|
|
145
|
+
- **MCP compatibility**: Seamless integration with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) compatible servers and tools
|
|
146
|
+
- **Real-time streaming**: Build interactive applications with streaming responses from both the assistant and tools
|
|
147
|
+
- **Structured data model**: Built-in support for threads, messages, and attachments to maintain conversation context
|
|
148
|
+
- **Persistent storage**: Powered by Narrator - choose between in-memory, SQLite, or PostgreSQL storage
|
|
149
|
+
- **Advanced debugging**: Integration with [W&B Weave](https://weave-docs.wandb.ai/) for powerful tracing and debugging capabilities
|
|
150
|
+
- **Flexible model support**: Use any LLM provider supported by LiteLLM (100+ providers including OpenAI, Anthropic, etc.)
|
|
151
|
+
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
<div style="display: flex; align-items: center; gap: 20px;">
|
|
157
|
+
<span style="font-size: 1em;">Sponsored by</span>
|
|
158
|
+
<a href="https://weave-docs.wandb.ai/"><img src="docs/static/img/weave_logo.png" alt="Weights & Biases Logo" height="40"/></a>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### For detailed documentation and guides, visit our [Docs](https://adamwdraper.github.io/tyler/).
|
|
164
|
+
|
|
165
|
+
While Tyler can be used as a library, it comes with two interactive interfaces:
|
|
166
|
+
1. A web-based chat interface available as a separate repository at [tyler-chat](https://github.com/adamwdraper/tyler-chat)
|
|
167
|
+
2. A built-in command-line interface (CLI) accessible via the `tyler-chat` command after installation. See the [Tyler chat CLI](https://adamwdraper.github.io/tyler/apps/tyler-chat-cli) documentation for details.
|
|
168
|
+
|
|
169
|
+
**Example configurations** for the Tyler CLI are available in this directory:
|
|
170
|
+
- `tyler-chat-config.yaml` - Basic configuration template
|
|
171
|
+
- `tyler-chat-config-wandb.yaml` - Configuration for W&B Inference with DeepSeek models
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+

|
|
177
|
+
[](https://pypi.org/project/tyler-agent/)
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
📚 **[Complete Documentation](https://slide.mintlify.app/)** | 🚀 **[Quickstart Guide](https://slide.mintlify.app/quickstart)** | 🎓 **[Your First Agent](https://slide.mintlify.app/guides/your-first-agent)**
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Overview
|
|
186
|
+
|
|
187
|
+
### Core Components
|
|
188
|
+
|
|
189
|
+
### Agent
|
|
190
|
+
|
|
191
|
+
The central component that:
|
|
192
|
+
- Manages conversations through threads
|
|
193
|
+
- Processes messages using LLMs (GPT-4.1 by default)
|
|
194
|
+
- Executes tools when needed
|
|
195
|
+
- Maintains conversation state
|
|
196
|
+
- Supports streaming responses
|
|
197
|
+
- Handles file attachments and processing
|
|
198
|
+
- Integrates with Weave for monitoring
|
|
199
|
+
|
|
200
|
+
### Thread
|
|
201
|
+
|
|
202
|
+
Manages conversations and maintains:
|
|
203
|
+
- Message history with proper sequencing
|
|
204
|
+
- System prompts
|
|
205
|
+
- Conversation metadata and analytics
|
|
206
|
+
- Source tracking (e.g., Slack, web)
|
|
207
|
+
- Token usage statistics
|
|
208
|
+
- Performance metrics
|
|
209
|
+
|
|
210
|
+
### Message
|
|
211
|
+
|
|
212
|
+
Basic units of conversation containing:
|
|
213
|
+
- Content (text or multimodal)
|
|
214
|
+
- Role (user, assistant, system, tool)
|
|
215
|
+
- Sequence number for ordering
|
|
216
|
+
- Attachments (files with automatic processing)
|
|
217
|
+
- Metrics (token usage, timing, model info)
|
|
218
|
+
- Source information
|
|
219
|
+
- Custom attributes
|
|
220
|
+
|
|
221
|
+
### Attachment
|
|
222
|
+
|
|
223
|
+
Handles files in conversations:
|
|
224
|
+
- Support for binary and base64 encoded content
|
|
225
|
+
- Automatic storage management
|
|
226
|
+
- Content processing and extraction
|
|
227
|
+
- Status tracking (pending, stored, failed)
|
|
228
|
+
- URL generation for stored files
|
|
229
|
+
- Secure backend storage integration
|
|
230
|
+
|
|
231
|
+
### Tools
|
|
232
|
+
|
|
233
|
+
Tyler's tools are provided by the `slide-lye` package. Extend agent capabilities with:
|
|
234
|
+
- Web browsing and downloads (WEB_TOOLS)
|
|
235
|
+
- Slack integration (SLACK_TOOLS)
|
|
236
|
+
- Notion integration (NOTION_TOOLS)
|
|
237
|
+
- Image processing (IMAGE_TOOLS)
|
|
238
|
+
- Audio processing (AUDIO_TOOLS)
|
|
239
|
+
- File operations (FILES_TOOLS)
|
|
240
|
+
- Shell commands (COMMAND_LINE_TOOLS)
|
|
241
|
+
- Browser automation (BROWSER_TOOLS)
|
|
242
|
+
|
|
243
|
+
### MCP
|
|
244
|
+
|
|
245
|
+
Integrates with the Model Context Protocol for:
|
|
246
|
+
- Seamless connection to MCP-compatible servers
|
|
247
|
+
- Automatic tool discovery from MCP servers
|
|
248
|
+
- Support for multiple transport protocols (WebSocket, SSE, STDIO)
|
|
249
|
+
- Server lifecycle management
|
|
250
|
+
- Dynamic tool invocation
|
|
251
|
+
- Integration with any MCP-compatible tool ecosystem
|
|
252
|
+
|
|
253
|
+
### Storage
|
|
254
|
+
|
|
255
|
+
Storage is handled by the Narrator package, providing:
|
|
256
|
+
- Thread Storage:
|
|
257
|
+
- Memory Store: Fast, in-memory storage for development
|
|
258
|
+
- Database Store: PostgreSQL/SQLite for production
|
|
259
|
+
- File Storage:
|
|
260
|
+
- Local filesystem with sharded organization
|
|
261
|
+
- Automatic content processing and extraction
|
|
262
|
+
- Configurable size limits and validation
|
|
263
|
+
|
|
264
|
+
## User Guide
|
|
265
|
+
|
|
266
|
+
### Prerequisites
|
|
267
|
+
|
|
268
|
+
- Python 3.13+
|
|
269
|
+
- uv (modern Python package manager) - recommended
|
|
270
|
+
- System dependencies for PDF and image processing
|
|
271
|
+
|
|
272
|
+
### Installation
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# Install uv if you haven't already
|
|
276
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
277
|
+
|
|
278
|
+
# Install required libraries for PDF image processing
|
|
279
|
+
# macOS:
|
|
280
|
+
brew install poppler
|
|
281
|
+
|
|
282
|
+
# Ubuntu/Debian:
|
|
283
|
+
sudo apt-get install poppler-utils
|
|
284
|
+
|
|
285
|
+
# Using uv (recommended)
|
|
286
|
+
uv add slide-tyler
|
|
287
|
+
|
|
288
|
+
# Using pip (fallback)
|
|
289
|
+
pip install slide-tyler
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
# For development installation:
|
|
293
|
+
```bash
|
|
294
|
+
uv add slide-tyler --dev
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
When you install Tyler, all required runtime dependencies will be installed automatically, including:
|
|
298
|
+
- LLM support (LiteLLM, OpenAI)
|
|
299
|
+
- Storage components (Narrator)
|
|
300
|
+
- Tools package (Lye)
|
|
301
|
+
- Monitoring and metrics (Weave, Wandb)
|
|
302
|
+
- File processing (PDF, images)
|
|
303
|
+
- All core utilities
|
|
304
|
+
|
|
305
|
+
### Basic Setup
|
|
306
|
+
|
|
307
|
+
Create a `.env` file in your project directory with the following configuration:
|
|
308
|
+
```bash
|
|
309
|
+
# Database Configuration (used by Narrator)
|
|
310
|
+
# For local development with Docker: cd packages/narrator && docker-compose up -d
|
|
311
|
+
# Then use: NARRATOR_DATABASE_URL=postgresql+asyncpg://narrator:narrator_dev@localhost:5432/narrator
|
|
312
|
+
NARRATOR_DATABASE_URL=postgresql+asyncpg://user:password@localhost/dbname
|
|
313
|
+
# Or for SQLite:
|
|
314
|
+
# NARRATOR_DATABASE_URL=sqlite+aiosqlite:///path/to/database.db
|
|
315
|
+
|
|
316
|
+
# Optional Database Settings
|
|
317
|
+
NARRATOR_DB_ECHO=false
|
|
318
|
+
NARRATOR_DB_POOL_SIZE=5
|
|
319
|
+
NARRATOR_DB_MAX_OVERFLOW=10
|
|
320
|
+
NARRATOR_DB_POOL_TIMEOUT=30
|
|
321
|
+
NARRATOR_DB_POOL_RECYCLE=300
|
|
322
|
+
|
|
323
|
+
# OpenAI Configuration
|
|
324
|
+
OPENAI_API_KEY=your-openai-api-key
|
|
325
|
+
|
|
326
|
+
# Logging Configuration
|
|
327
|
+
WANDB_API_KEY=your-wandb-api-key
|
|
328
|
+
|
|
329
|
+
# Optional Integrations (for Lye tools)
|
|
330
|
+
NOTION_TOKEN=your-notion-token
|
|
331
|
+
SLACK_BOT_TOKEN=your-slack-bot-token
|
|
332
|
+
SLACK_SIGNING_SECRET=your-slack-signing-secret
|
|
333
|
+
|
|
334
|
+
# File storage configuration
|
|
335
|
+
NARRATOR_FILE_STORAGE_PATH=/path/to/files # Optional, defaults to ~/.narrator/files
|
|
336
|
+
NARRATOR_MAX_FILE_SIZE=52428800 # 50MB default
|
|
337
|
+
NARRATOR_MAX_STORAGE_SIZE=5368709120 # 5GB default
|
|
338
|
+
|
|
339
|
+
# Other settings
|
|
340
|
+
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Only the `OPENAI_API_KEY` (or whatever LLM provider you're using) is required for core functionality. Other environment variables are required only when using specific features:
|
|
344
|
+
- For Weave monitoring: `WANDB_API_KEY` is required (You will want to use this for monitoring and debugging) [https://weave-docs.wandb.ai/](Weave Docs)
|
|
345
|
+
- For Slack integration: `SLACK_BOT_TOKEN` is required
|
|
346
|
+
- For Notion integration: `NOTION_TOKEN` is required
|
|
347
|
+
- For database storage:
|
|
348
|
+
- By default uses in-memory storage (perfect for scripts and testing)
|
|
349
|
+
- For PostgreSQL or SQLite: Set `NARRATOR_DATABASE_URL` with appropriate connection string
|
|
350
|
+
- For file storage: Defaults will be used if not specified
|
|
351
|
+
|
|
352
|
+
For more details about each setting, see the [Environment Variables](#environment-variables) section.
|
|
353
|
+
|
|
354
|
+
### LLM Provider Support
|
|
355
|
+
|
|
356
|
+
Tyler uses LiteLLM under the hood, which means you can use any of the 100+ supported LLM providers by simply configuring the appropriate environment variables. Some popular options include:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
# OpenAI
|
|
360
|
+
OPENAI_API_KEY=your-openai-api-key
|
|
361
|
+
|
|
362
|
+
# Anthropic
|
|
363
|
+
ANTHROPIC_API_KEY=your-anthropic-api-key
|
|
364
|
+
|
|
365
|
+
# Azure OpenAI
|
|
366
|
+
AZURE_API_KEY=your-azure-api-key
|
|
367
|
+
AZURE_API_BASE=your-azure-endpoint
|
|
368
|
+
AZURE_API_VERSION=2023-07-01-preview
|
|
369
|
+
|
|
370
|
+
# Google VertexAI
|
|
371
|
+
VERTEX_PROJECT=your-project-id
|
|
372
|
+
VERTEX_LOCATION=your-location
|
|
373
|
+
|
|
374
|
+
# AWS Bedrock
|
|
375
|
+
AWS_ACCESS_KEY_ID=your-access-key
|
|
376
|
+
AWS_SECRET_ACCESS_KEY=your-secret-key
|
|
377
|
+
AWS_REGION_NAME=your-region
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
When initializing an Agent, you can specify any supported model using the standard model identifier:
|
|
381
|
+
|
|
382
|
+
```python
|
|
383
|
+
# OpenAI
|
|
384
|
+
agent = Agent(model_name="gpt-4")
|
|
385
|
+
|
|
386
|
+
# Anthropic
|
|
387
|
+
agent = Agent(model_name="claude-2")
|
|
388
|
+
|
|
389
|
+
# Azure OpenAI
|
|
390
|
+
agent = Agent(model_name="azure/your-deployment-name")
|
|
391
|
+
|
|
392
|
+
# Google VertexAI
|
|
393
|
+
agent = Agent(model_name="chat-bison")
|
|
394
|
+
|
|
395
|
+
# AWS Bedrock
|
|
396
|
+
agent = Agent(model_name="anthropic.claude-v2")
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
For a complete list of supported providers and models, see the [LiteLLM documentation](https://docs.litellm.ai/).
|
|
400
|
+
|
|
401
|
+
### Quick Start
|
|
402
|
+
|
|
403
|
+
This example uses in-memory storage which is perfect for scripts and testing.
|
|
404
|
+
|
|
405
|
+
```python
|
|
406
|
+
from dotenv import load_dotenv
|
|
407
|
+
from tyler import Agent, Thread, Message
|
|
408
|
+
import asyncio
|
|
409
|
+
import os
|
|
410
|
+
|
|
411
|
+
# Load environment variables from .env file
|
|
412
|
+
load_dotenv()
|
|
413
|
+
|
|
414
|
+
# Initialize the agent (uses in-memory storage by default)
|
|
415
|
+
agent = Agent(
|
|
416
|
+
model_name="gpt-4.1",
|
|
417
|
+
purpose="To help with general questions"
|
|
418
|
+
)
|
|
419
|
+
|
|
420
|
+
async def main():
|
|
421
|
+
# Create a new thread
|
|
422
|
+
thread = Thread()
|
|
423
|
+
|
|
424
|
+
# Add a user message
|
|
425
|
+
message = Message(
|
|
426
|
+
role="user",
|
|
427
|
+
content="What can you help me with?"
|
|
428
|
+
)
|
|
429
|
+
thread.add_message(message)
|
|
430
|
+
|
|
431
|
+
# Process the thread
|
|
432
|
+
result = await agent.go(thread)
|
|
433
|
+
|
|
434
|
+
# Print the assistant's response
|
|
435
|
+
print(f"Assistant: {result.content}")
|
|
436
|
+
|
|
437
|
+
# Access additional information if needed
|
|
438
|
+
print(f"Execution time: {result.execution.duration_ms}ms")
|
|
439
|
+
print(f"Tokens used: {result.execution.total_tokens}")
|
|
440
|
+
|
|
441
|
+
if __name__ == "__main__":
|
|
442
|
+
asyncio.run(main())
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Using Config Files
|
|
446
|
+
|
|
447
|
+
Tyler supports creating agents from YAML configuration files, enabling you to share the same configuration between the CLI and Python code:
|
|
448
|
+
|
|
449
|
+
```python
|
|
450
|
+
from tyler import Agent, load_config
|
|
451
|
+
import asyncio
|
|
452
|
+
|
|
453
|
+
# Simple: Create agent from config file
|
|
454
|
+
agent = Agent.from_config("my-config.yaml")
|
|
455
|
+
|
|
456
|
+
# With overrides
|
|
457
|
+
agent = Agent.from_config(
|
|
458
|
+
"my-config.yaml",
|
|
459
|
+
temperature=0.9,
|
|
460
|
+
model_name="gpt-4o"
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
# Auto-discovery (searches ./tyler-chat-config.yaml, ~/.tyler/chat-config.yaml, etc.)
|
|
464
|
+
agent = Agent.from_config()
|
|
465
|
+
|
|
466
|
+
# Advanced: Load and modify config before creating agent
|
|
467
|
+
config = load_config("my-config.yaml")
|
|
468
|
+
config["temperature"] = 0.9
|
|
469
|
+
agent = Agent(**config)
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Example `tyler-chat-config.yaml`:
|
|
473
|
+
```yaml
|
|
474
|
+
name: "MyAgent"
|
|
475
|
+
model_name: "gpt-4.1"
|
|
476
|
+
temperature: 0.7
|
|
477
|
+
purpose: "A helpful AI assistant"
|
|
478
|
+
tools:
|
|
479
|
+
- "web"
|
|
480
|
+
- "slack"
|
|
481
|
+
mcp:
|
|
482
|
+
servers:
|
|
483
|
+
- name: "docs"
|
|
484
|
+
transport: "streamablehttp"
|
|
485
|
+
url: "https://slide.mintlify.app/mcp"
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
See `examples/003_agent_from_config.py` for complete examples and `tyler-chat-config.yaml` for a full configuration template.
|
|
489
|
+
|
|
490
|
+
## Running Examples and Tests
|
|
491
|
+
|
|
492
|
+
Tyler comes with a variety of examples in the `examples/` directory that demonstrate different features and capabilities. These examples can also be run as integration tests to ensure everything is working correctly.
|
|
493
|
+
|
|
494
|
+
### Running Examples as Tests
|
|
495
|
+
|
|
496
|
+
The examples are integrated into the test suite with special markers to allow running them separately from unit tests:
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
# Run only the example tests
|
|
500
|
+
pytest -m examples
|
|
501
|
+
|
|
502
|
+
# Run only unit tests (excluding examples)
|
|
503
|
+
pytest -k "not examples"
|
|
504
|
+
|
|
505
|
+
# Run all tests (unit tests and examples)
|
|
506
|
+
pytest
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
This separation is particularly useful during development, allowing you to run the faster unit tests while making changes, and run the full test suite including examples before committing.
|
|
510
|
+
|
|
511
|
+
### Example Categories
|
|
512
|
+
|
|
513
|
+
The examples directory includes demonstrations of:
|
|
514
|
+
|
|
515
|
+
- Basic agent conversations
|
|
516
|
+
- Using built-in and custom tools
|
|
517
|
+
- Working with file attachments
|
|
518
|
+
- Image and audio processing
|
|
519
|
+
- Streaming responses
|
|
520
|
+
- MCP (Model Context Protocol) integration
|
|
521
|
+
|
|
522
|
+
Each example is a standalone Python script that can be run directly or as part of the test suite.
|
|
523
|
+
|
|
524
|
+
## License
|
|
525
|
+
|
|
526
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
tyler/__init__.py,sha256=ifoKeLoimDN3OMyJXU23hHlQhcdz4P0mXjU9-GC6Zj4,475
|
|
2
|
+
tyler/config.py,sha256=vdh5TMK-rHQ2dnrBbGJMaQNgVf7d6CrTOvBSRYX0KIw,12714
|
|
3
|
+
tyler/a2a/__init__.py,sha256=l8LlmpYyPUlC4dqcim-EZsMJUt8hdTtfLP8z3W4PGpg,337
|
|
4
|
+
tyler/a2a/adapter.py,sha256=61aUiqvv0vxURB08N6uysHqjPEfAE1kdHNFU6bTdQfk,13513
|
|
5
|
+
tyler/a2a/client.py,sha256=VeVoJ_mGsIK0b0bgRXbOCdp0CZo8F5PsenIC9A1_Kmg,12778
|
|
6
|
+
tyler/a2a/server.py,sha256=3yCzGXPqvCcJeQ8DdaitLS6Cq5nY8b2FRU8klfdGWNE,15176
|
|
7
|
+
tyler/cli/__init__.py,sha256=9xYXuwl7Ay8e1YHAwinLXWkwUocWKeyz2YEWd_wNZqw,28
|
|
8
|
+
tyler/cli/chat.py,sha256=qRHbM6e5AwZn9mQlDO-c_V7m79yS43mgDAt-UVn9StE,23621
|
|
9
|
+
tyler/cli/init.py,sha256=h9htkPvAC5i05ova91npoE6D6v7ToX2Xzvc7VYl7ULk,7973
|
|
10
|
+
tyler/cli/main.py,sha256=G1NZdFzE6B6LjV87f3kzHktLYei6Kwsnqpvpa4OwPMo,1206
|
|
11
|
+
tyler/eval/__init__.py,sha256=Zz-Ps7azreA0VW5LhX3Uk1cwYQCQEqB_vBE4U-ZcVkA,988
|
|
12
|
+
tyler/eval/agent_eval.py,sha256=CD5BNNIKX2ndwW-fPh1Dv4gydH62Vs3YwwIML4ajwr8,11769
|
|
13
|
+
tyler/eval/conversations.py,sha256=OhE53a5_eNxlvzPeVTiBR8AlxZWt8zjOImBIrGVctPM,5403
|
|
14
|
+
tyler/eval/expectations.py,sha256=dkLXdSpJOSuPj6I-HVD-vR0vo5WO7AoaFbYetZdrQ-0,4846
|
|
15
|
+
tyler/eval/mock_tools.py,sha256=A9PsKCc0CE28WX4RpB_D5twRmJc_7jPCCzbXzruxxXg,5788
|
|
16
|
+
tyler/eval/results.py,sha256=staV0Lij8Ha5GDHerHG2omlra8EEew1K4tUe7MpjGgM,6555
|
|
17
|
+
tyler/eval/scorers.py,sha256=hISETqYYe539bDrTCNbGmDz77QoxhvOJSdg3w2S4cv8,12612
|
|
18
|
+
tyler/mcp/__init__.py,sha256=7L2jA9LESSjV4nuXCxIXtNdmtbo3wZgvq7oQNcxLk0A,333
|
|
19
|
+
tyler/mcp/adapter.py,sha256=nUKQKi9kunt0g-crhWk_B5lZZbqYu__J1bpfl-7-4Ns,9044
|
|
20
|
+
tyler/mcp/client.py,sha256=r6ZshXZO48w2ODJoVziVpkS1ZZgOl9P4_paS6qMNmV8,15551
|
|
21
|
+
tyler/mcp/config_loader.py,sha256=jgvHMwQ7m_BBMVwiOcOyEzqAtB0oHBJoB1A_K-h0wQU,9127
|
|
22
|
+
tyler/models/__init__.py,sha256=WJGZbkVYJIfhGMuUCX6Xl03bDOw_s6Oi5nNVM88pyn4,363
|
|
23
|
+
tyler/models/agent.py,sha256=boMlELHOgNHoqfUPQELF8jUf3uVh4Jg_UhJOAMJ8PUA,88832
|
|
24
|
+
tyler/models/completion_handler.py,sha256=EATez3NENvmWxL-M751h-jb3ZLKN6wj4YAM-j1J64oA,9915
|
|
25
|
+
tyler/models/execution.py,sha256=FnbDWBZ9eG6nKkLlaSCeug5uoxugTi7a9szTXKSm4X0,1944
|
|
26
|
+
tyler/models/message_factory.py,sha256=GXP1iKP1cOFFD32xYOTiKviavT0FMdfC8DNtezDKjEA,7421
|
|
27
|
+
tyler/models/tool_call.py,sha256=rMpfH813osY-jGMiV7fWvUKwPLZ-CAa7eTT7eNemzGs,7146
|
|
28
|
+
tyler/models/tool_manager.py,sha256=UKQnA7_V_A6zWQ4ZXtltFlsvCz2WM0M8ikTiaE_Z8sw,6832
|
|
29
|
+
tyler/utils/__init__.py,sha256=HvMqmfzVVxPXWYy_oCvU_cwqD9Zsda2Gz4QQQBBboQM,49
|
|
30
|
+
tyler/utils/files.py,sha256=JgAmIVMgwXFpqPiGfUMXM30j04GOZIhNoWNxh-gLxMM,3065
|
|
31
|
+
tyler/utils/logging.py,sha256=m0Hl54O7fnMANviGNnYpgEAybidwanBx7sKhUKDHG8M,1910
|
|
32
|
+
tyler/utils/tool_runner.py,sha256=Nzf4KLf2_jDMmJe8xueBUuI-Dk6HtUW-m0vt1Tghwvo,14803
|
|
33
|
+
tyler/utils/tool_strategies.py,sha256=oSx0KvGNqOTojnDEdwAPQBQ6N_s4bGa25GhPvhCa25A,11697
|
|
34
|
+
slide_tyler-5.2.2.dist-info/METADATA,sha256=VuCsGkxgO00tHNUUOi-oy9d2p3Nn6QLvASW0t5YdNhU,17092
|
|
35
|
+
slide_tyler-5.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
36
|
+
slide_tyler-5.2.2.dist-info/entry_points.txt,sha256=ILCp8XE1eX_0cT9fH_0PeVrO70uDcF4oU-m-SQzXHAI,46
|
|
37
|
+
slide_tyler-5.2.2.dist-info/licenses/LICENSE,sha256=TDAP-lB6Sq0hjz_UIWQWT49n_NnxCiY8W8ecAdQYD7E,1067
|
|
38
|
+
slide_tyler-5.2.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Adam Draper
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tyler/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Tyler - A development kit for AI agents with a complete lack of conventional limitations"""
|
|
2
|
+
|
|
3
|
+
__version__ = "5.2.2"
|
|
4
|
+
|
|
5
|
+
from tyler.utils.logging import get_logger
|
|
6
|
+
from tyler.models.agent import Agent
|
|
7
|
+
from tyler.config import load_config
|
|
8
|
+
from tyler.models.execution import (
|
|
9
|
+
AgentResult,
|
|
10
|
+
ExecutionEvent,
|
|
11
|
+
EventType
|
|
12
|
+
)
|
|
13
|
+
from narrator import Thread, Message, ThreadStore, FileStore, Attachment
|
|
14
|
+
|
|
15
|
+
# Configure logging when package is imported
|
|
16
|
+
logger = get_logger(__name__)
|
tyler/a2a/__init__.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Tyler A2A (Agent-to-Agent) integration module.
|
|
2
|
+
|
|
3
|
+
This module provides support for the A2A (Agent2Agent) protocol,
|
|
4
|
+
enabling Tyler agents to communicate with other agents across platforms.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .adapter import A2AAdapter
|
|
8
|
+
from .client import A2AClient
|
|
9
|
+
from .server import A2AServer
|
|
10
|
+
|
|
11
|
+
__all__ = ["A2AAdapter", "A2AClient", "A2AServer"]
|