wizelit-sdk 0.1.30__tar.gz → 0.1.32__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.
Files changed (35) hide show
  1. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/Makefile +6 -6
  2. wizelit_sdk-0.1.32/PKG-INFO +222 -0
  3. wizelit_sdk-0.1.32/QUICKSTART.md +342 -0
  4. wizelit_sdk-0.1.32/README.md +200 -0
  5. wizelit_sdk-0.1.32/dzun-local/Create-CLI-Tool +339 -0
  6. wizelit_sdk-0.1.32/dzun-local/examples/cli_demo.py +58 -0
  7. wizelit_sdk-0.1.32/dzun-local/examples/run_cli-demo.sh +27 -0
  8. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/pyproject.toml +5 -1
  9. wizelit_sdk-0.1.32/setup.py +13 -0
  10. wizelit_sdk-0.1.32/src/wizelit_sdk/__init__.py +47 -0
  11. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/agent_wrapper/agent_wrapper.py +7 -1
  12. wizelit_sdk-0.1.32/src/wizelit_sdk/cli.py +337 -0
  13. wizelit_sdk-0.1.32/src/wizelit_sdk/exceptions.py +206 -0
  14. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/uv.lock +3 -1
  15. wizelit_sdk-0.1.30/PKG-INFO +0 -124
  16. wizelit_sdk-0.1.30/README.md +0 -103
  17. wizelit_sdk-0.1.30/src/wizelit_sdk/__init__.py +0 -11
  18. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/.editorconfig +0 -0
  19. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/.env.template +0 -0
  20. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/.gitignore +0 -0
  21. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/CHANGELOG.md +0 -0
  22. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/INITIALIZATION_INSTRUCTION.MD +0 -0
  23. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/activate.sh +0 -0
  24. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/pyrightconfig.json +0 -0
  25. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/__init__.py +0 -0
  26. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/agent_wrapper/__init__.py +0 -0
  27. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/agent_wrapper/job.py +0 -0
  28. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/agent_wrapper/signature_validation.py +0 -0
  29. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/agent_wrapper/streaming.py +0 -0
  30. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/database.py +0 -0
  31. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/models/__init__.py +0 -0
  32. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/models/base.py +0 -0
  33. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/src/wizelit_sdk/models/job.py +0 -0
  34. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/tests/test_agent_wrapper_import.py +0 -0
  35. {wizelit_sdk-0.1.30 → wizelit_sdk-0.1.32}/tests/test_utils.py +0 -0
@@ -57,20 +57,20 @@ install-dev:
57
57
  # Run tests
58
58
  test:
59
59
  @echo "Running tests..."
60
- uv run pytest tests/ -v
60
+ uv run --with pytest pytest tests/ -v
61
61
 
62
62
  # Run code linting
63
63
  lint:
64
64
  @echo "Running linting checks..."
65
- uv run ruff check src/
65
+ uv run --with ruff ruff check src/
66
66
  @echo "Running type checks..."
67
- -uv run mypy src/ 2>/dev/null || echo "mypy not installed, skipping type checks"
67
+ -uv run --with mypy mypy src/ 2>/dev/null || echo "mypy not installed, skipping type checks"
68
68
 
69
69
  # Format code
70
70
  format:
71
71
  @echo "Formatting code..."
72
- uv run black src/ tests/
73
- uv run ruff check --fix src/
72
+ uv run --with black black src/ tests/
73
+ uv run --with ruff ruff check --fix src/
74
74
 
75
75
  # Run all checks
76
76
  check: test lint
@@ -91,7 +91,7 @@ clean:
91
91
  # Build package
92
92
  build: clean
93
93
  @echo "Building package..."
94
- uv run python -m build
94
+ uv run --with build python -m build
95
95
  @echo "Build complete! Files in dist/"
96
96
 
97
97
  # Check if VERSION is provided
@@ -0,0 +1,222 @@
1
+ Metadata-Version: 2.4
2
+ Name: wizelit-sdk
3
+ Version: 0.1.32
4
+ Summary: Wizelit Agent Wrapper - Internal utility package
5
+ Author-email: Your Name <your.email@company.com>
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: asyncpg>=0.26.0
8
+ Requires-Dist: click>=8.1.0
9
+ Requires-Dist: fastmcp>=0.1.0
10
+ Requires-Dist: redis>=4.5.0
11
+ Requires-Dist: sqlalchemy>=1.4
12
+ Requires-Dist: typeguard>=4.3.0
13
+ Requires-Dist: typing-extensions>=4.0.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: black>=22.0.0; extra == 'dev'
16
+ Requires-Dist: build>=1.0.0; extra == 'dev'
17
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
18
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
19
+ Provides-Extra: streaming
20
+ Requires-Dist: redis>=4.5.0; extra == 'streaming'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # wizelit-sdk
24
+
25
+ Internal utility package for Wizelit Agent operations.
26
+
27
+ > **New to Wizelit?** Start with the [**Quick Start Guide**](./QUICKSTART.md) to build your first agent in under 30 minutes!
28
+
29
+ ## Installation
30
+
31
+ ### Install from PyPI
32
+
33
+ ```bash
34
+ uv pip install wizelit-sdk
35
+ ```
36
+
37
+ ### Add to pyproject.toml
38
+
39
+ ```toml
40
+ [project]
41
+ dependencies = [
42
+ "wizelit-sdk"
43
+ ]
44
+ ```
45
+
46
+ ## Quickstart
47
+
48
+ 1. Install the package (see above).
49
+ 2. Configure environment variables (see Configuration).
50
+ 3. Import and use the SDK from your app.
51
+
52
+ ### CLI
53
+
54
+ The package also installs a small command-line tool named `wizelit-sdk` which helps scaffold and manage agent projects.
55
+
56
+ Install and run the CLI:
57
+
58
+ ```bash
59
+ # Install package (global or in virtualenv)
60
+ pip install wizelit-sdk
61
+
62
+ # Create a new project using a template (fast|slow|hybrid)
63
+ wizelit-sdk init "My Agent" --template hybrid
64
+
65
+ # Alternative (without wrapper):
66
+ python -m wizelit_sdk.cli init "My Agent" --template hybrid
67
+ ```
68
+
69
+ Useful commands:
70
+
71
+ - `wizelit-sdk init <name> [--template fast|slow|hybrid]` — scaffold a new agent project
72
+ - `wizelit-sdk scaffold <name>` — basic scaffold (older command)
73
+ - `wizelit-sdk validate [path]` — validate project structure
74
+ - `wizelit-sdk list-tools [path]` — list functions decorated with `@mcp.ingest`
75
+
76
+ If you are developing locally, install editable and use the wrapper from your virtualenv:
77
+
78
+ ```bash
79
+ # from repo root
80
+ pip install -e .
81
+ source .venv/bin/activate
82
+ wizelit-sdk init "My Agent"
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ```python
88
+ from wizelit_agent_wrapper import your_module
89
+
90
+ # Use the wrapper
91
+ result = your_module.function()
92
+ ```
93
+
94
+ ## SDK Guide
95
+
96
+ ### Basic import patterns
97
+
98
+ ```python
99
+ from wizelit_sdk import database, exceptions
100
+ from wizelit_sdk.agent_wrapper import agent_wrapper
101
+ ```
102
+
103
+ ### Initialize and call
104
+
105
+ ```python
106
+ # Example: create a wrapper and call a method
107
+ wrapper = agent_wrapper.WizelitAgentWrapper()
108
+ result = wrapper.run()
109
+ ```
110
+
111
+ ### Error handling
112
+
113
+ ```python
114
+ from wizelit_sdk.exceptions import WizelitError
115
+
116
+ try:
117
+ wrapper.run()
118
+ except WizelitError as exc:
119
+ # handle SDK-specific errors
120
+ print(exc)
121
+ ```
122
+
123
+ ## Configuration
124
+
125
+ The SDK reads database configuration from the hosting application's environment. Provide these variables in the consuming project (e.g., via your app's .env or deployment secrets):
126
+
127
+ - POSTGRES_USER
128
+ - POSTGRES_PASSWORD
129
+ - POSTGRES_HOST
130
+ - POSTGRES_PORT
131
+ - POSTGRES_DB
132
+
133
+ You can also supply a full connection string via `DATABASE_URL` (overrides the individual fields). If using streaming/logging with Redis, set `REDIS_HOST`, `REDIS_PORT`, and optionally `REDIS_PASSWORD`.
134
+
135
+ ## Development
136
+
137
+ ### Setup Development Environment
138
+
139
+ ```bash
140
+ # Clone repository
141
+ git clone https://github.com/your-org/wizelit-sdk.git
142
+ cd wizelit-sdk
143
+
144
+ # Set up environment
145
+ make setup
146
+
147
+ # Activate virtual environment
148
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
149
+
150
+ # Install in development mode
151
+ make install-dev
152
+ ```
153
+
154
+ ### Available Make Commands
155
+
156
+ ```bash
157
+ make setup # Set up development environment
158
+ make install # Install package (production mode)
159
+ make install-dev # Install in development mode
160
+ make test # Run tests
161
+ make lint # Run code linting
162
+ make format # Format code with black
163
+ make check # Run tests and linting
164
+ make clean # Clean build artifacts
165
+ make build # Build package
166
+ make release x.x.x # Create new release (updates version, tags, pushes)
167
+ make tag VERSION=x.x.x # Create and push git tag
168
+ make push # Push code and tags to remote
169
+ make publish # Publish package (run checks, build, push to remote)
170
+ make publish-pypi # Publish package to public PyPI
171
+ make publish-artifactory # Publish package to private Artifactory/PyPI
172
+ make version # Show current version
173
+ make versions # List all available versions
174
+ ```
175
+
176
+ ### Deploy to PyPI
177
+
178
+ Use the built-in Makefile target (recommended):
179
+
180
+ ```bash
181
+ make publish-pypi
182
+ ```
183
+
184
+ This target will:
185
+
186
+ 1. Verify the git working tree is clean.
187
+ 2. Run tests and linting (`make check`).
188
+ 3. Build the package (`make build`).
189
+ 4. Upload the artifacts in `dist/` to PyPI via `twine`.
190
+
191
+ Optional release/tag flow (before publishing):
192
+
193
+ ```bash
194
+ # Interactive release flow (updates version, tags, pushes)
195
+ make release x.x.x
196
+
197
+ # Or tag a specific version
198
+ make tag VERSION=x.x.x
199
+ ```
200
+
201
+ Notes:
202
+
203
+ - Ensure your PyPI credentials are configured locally (e.g., via $HOME/.pypirc or your preferred environment variables).
204
+ - The package version must be unique on PyPI; if a version already exists, bump it and rebuild.
205
+
206
+ ## Contributing
207
+
208
+ 1. Create a feature branch
209
+ 2. Make your changes
210
+ 3. Run tests and linting: `make check`
211
+ 4. Commit your changes
212
+ 5. Push and create a pull request
213
+
214
+ ## Versioning
215
+
216
+ We use [Semantic Versioning](https://semver.org/):
217
+
218
+ - **MAJOR** version for incompatible API changes
219
+ - **MINOR** version for new functionality (backward compatible)
220
+ - **PATCH** version for bug fixes
221
+
222
+ See [CHANGELOG.md](CHANGELOG.md) for version history.
@@ -0,0 +1,342 @@
1
+ # Wizelit SDK Quick Start Guide
2
+
3
+ Get your first Wizelit agent running in **under 30 minutes**. This guide takes approximately **5 minutes to read** and covers everything you need to build and deploy your first agent.
4
+
5
+ ---
6
+
7
+ ## What You'll Build
8
+
9
+ By the end of this guide, you'll have a working agent that:
10
+
11
+ - ✅ Exposes a reusable tool via REST API
12
+ - ✅ Runs locally or in a container
13
+ - ✅ Integrates with LLMs and other services
14
+
15
+ ---
16
+
17
+ ## Prerequisites
18
+
19
+ - Python 3.8+
20
+ - `pip` (Python package manager)
21
+ - A terminal/command line
22
+ - ~20 MB of disk space
23
+
24
+ ---
25
+
26
+ ## Step 1: Install the SDK
27
+
28
+ ### Option A: Install from PyPI (Recommended)
29
+
30
+ ```bash
31
+ pip install wizelit-sdk
32
+ ```
33
+
34
+ ### Option B: Install from Source (for development)
35
+
36
+ ```bash
37
+ git clone https://github.com/wizelit/wizelit-sdk.git
38
+ cd wizelit-sdk
39
+ pip install -e .
40
+ ```
41
+
42
+ **Verify installation:**
43
+
44
+ ```bash
45
+ wizelit --version
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Step 2: Create Your First Agent
51
+
52
+ Use the CLI to scaffold a new agent project:
53
+
54
+ ```bash
55
+ wizelit init my-first-agent
56
+ ```
57
+
58
+ This creates a directory with:
59
+
60
+ ```
61
+ my-first-agent/
62
+ ├── main.py # Your agent code
63
+ ├── requirements.txt # Dependencies
64
+ ├── README.md # Project docs
65
+ └── .env.example # Environment template
66
+ ```
67
+
68
+ **What just happened:** The `init` command generated a "fast" agent template (default). This is a lightweight, synchronous agent perfect for quick APIs.
69
+
70
+ ---
71
+
72
+ ## Step 3: Install Dependencies
73
+
74
+ Navigate to your project and install dependencies:
75
+
76
+ ```bash
77
+ cd my-first-agent
78
+ pip install -r requirements.txt
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Step 4: Run Your Agent
84
+
85
+ Start the agent server:
86
+
87
+ ```bash
88
+ python main.py
89
+ ```
90
+
91
+ You should see output like:
92
+
93
+ ```
94
+ INFO: Uvicorn running on http://0.0.0.0:8080
95
+ ```
96
+
97
+ 🎉 **Your agent is now running!**
98
+
99
+ ---
100
+
101
+ ## Step 5: Test Your Agent
102
+
103
+ Open a **new terminal** while the agent is running.
104
+
105
+ ### Test with curl:
106
+
107
+ ```bash
108
+ curl -X POST http://localhost:8080/invoke \
109
+ -H "Content-Type: application/json" \
110
+ -d '{"text": "Hello, Wizelit!"}'
111
+ ```
112
+
113
+ **Expected response:**
114
+
115
+ ```json
116
+ { "echo": "Hello, Wizelit!" }
117
+ ```
118
+
119
+ ### Test with Python:
120
+
121
+ ```python
122
+ import requests
123
+
124
+ response = requests.post(
125
+ "http://localhost:8080/invoke",
126
+ json={"text": "Hello, Wizelit!"}
127
+ )
128
+ print(response.json())
129
+ # Output: {"echo": "Hello, Wizelit!"}
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Step 6: Customize Your Agent
135
+
136
+ Edit `main.py` to add your own tools. Here's a simple example:
137
+
138
+ ### Example: Text Analysis Tool
139
+
140
+ Replace the `example_tool` function with:
141
+
142
+ ```python
143
+ @mcp.ingest(
144
+ is_long_running=False,
145
+ description="Analyze text sentiment and return statistics",
146
+ response_handling={"mode": "json"},
147
+ )
148
+ def analyze_text(text: str) -> dict:
149
+ """Analyze text and return word count and character count."""
150
+ words = len(text.split())
151
+ chars = len(text)
152
+ return {
153
+ "word_count": words,
154
+ "char_count": chars,
155
+ "avg_word_length": round(chars / words, 2) if words > 0 else 0
156
+ }
157
+ ```
158
+
159
+ ### Restart and Test:
160
+
161
+ 1. Stop your agent (Ctrl+C)
162
+ 2. Restart:
163
+ ```bash
164
+ python main.py
165
+ ```
166
+ 3. Test the new tool:
167
+
168
+ ```bash
169
+ curl -X POST http://localhost:8080/invoke \
170
+ -H "Content-Type: application/json" \
171
+ -d '{"text": "The quick brown fox jumps over the lazy dog"}'
172
+ ```
173
+
174
+ **Response:**
175
+
176
+ ```json
177
+ {
178
+ "word_count": 9,
179
+ "char_count": 44,
180
+ "avg_word_length": 4.89
181
+ }
182
+ ```
183
+
184
+ ---
185
+
186
+ ## Step 7: Explore Templates
187
+
188
+ Wizelit provides three agent templates:
189
+
190
+ ### Fast Agent (Default)
191
+
192
+ - **Use case:** Simple, synchronous operations
193
+ - **Example:** Text processing, API proxying
194
+ - **Command:** `wizelit init my-agent --template fast`
195
+
196
+ ### Slow Agent
197
+
198
+ - **Use case:** Long-running async tasks
199
+ - **Example:** File processing, ML inference, batch jobs
200
+ - **Includes:** Redis for job queuing
201
+ - **Command:** `wizelit init my-agent --template slow`
202
+
203
+ Example slow agent function:
204
+
205
+ ```python
206
+ @mcp.ingest(is_long_running=True, description="Process large file")
207
+ async def process_file(filepath: str, job: Job) -> dict:
208
+ job.logger.info(f"Starting to process {filepath}")
209
+ # Your long-running work here
210
+ return {"status": "complete"}
211
+ ```
212
+
213
+ ### Hybrid Agent
214
+
215
+ - **Use case:** Both fast and slow operations
216
+ - **Example:** API with background jobs
217
+ - **Command:** `wizelit init my-agent --template hybrid`
218
+
219
+ ---
220
+
221
+ ## Step 8: Validate Your Project
222
+
223
+ Ensure your agent has all required files:
224
+
225
+ ```bash
226
+ wizelit validate
227
+ ```
228
+
229
+ Output:
230
+
231
+ ```
232
+ ✅ Project looks valid
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Step 9: List Your Tools
238
+
239
+ See all tools available in your agent:
240
+
241
+ ```bash
242
+ wizelit list-tools
243
+ ```
244
+
245
+ Output:
246
+
247
+ ```
248
+ - analyze_text (in main.py)
249
+ ```
250
+
251
+ ---
252
+
253
+ ## Next Steps
254
+
255
+ ### 1. **Add Environment Configuration**
256
+
257
+ Create a `.env` file from the template:
258
+
259
+ ```bash
260
+ cp .env.example .env
261
+ ```
262
+
263
+ For slow/hybrid agents with Redis:
264
+
265
+ ```bash
266
+ REDIS_URL=redis://localhost:6379
267
+ ENABLE_LOG_STREAMING=true
268
+ ```
269
+
270
+ ### 2. **Deploy to Production**
271
+
272
+ - **Docker:** Add a `Dockerfile` (template coming soon)
273
+ - **Cloud:** Deploy to AWS Lambda, Google Cloud Run, etc.
274
+ - **MCP Server:** Use as a Model Context Protocol server
275
+
276
+ ### 3. **Integrate with LLMs**
277
+
278
+ Register your agent with Claude, GPT, or other LLMs to use your tools.
279
+
280
+ ### 4. **Advanced Features**
281
+
282
+ - Job tracking and streaming
283
+ - Multiple tool signatures
284
+ - Custom transport protocols
285
+ - Database integration
286
+
287
+ ---
288
+
289
+ ## Troubleshooting
290
+
291
+ ### "ModuleNotFoundError: No module named 'wizelit_sdk'"
292
+
293
+ ```bash
294
+ # Reinstall the SDK
295
+ pip install --force-reinstall wizelit-sdk
296
+ ```
297
+
298
+ ### "Address already in use" (Port 8080)
299
+
300
+ ```bash
301
+ # Use a different port
302
+ python main.py --port 8090
303
+ ```
304
+
305
+ ### Agent not responding
306
+
307
+ 1. Check that the server is still running
308
+ 2. Verify the endpoint URL is correct
309
+ 3. Check logs for errors
310
+
311
+ ---
312
+
313
+ ## Examples & Resources
314
+
315
+ - **Example Agents:** See `dzun-local/examples/` in the repo
316
+ - **API Documentation:** See [API_DOCS.md](./API_DOCS.md)
317
+ - **Architecture Guide:** See [ARCHITECTURE.md](./ARCHITECTURE.md)
318
+ - **GitHub:** [wizelit/wizelit-sdk](https://github.com/wizelit/wizelit-sdk)
319
+
320
+ ---
321
+
322
+ ## Summary
323
+
324
+ You now know how to:
325
+
326
+ - ✅ Install Wizelit SDK
327
+ - ✅ Create agents with templates
328
+ - ✅ Run and test your agents locally
329
+ - ✅ Add custom tools
330
+ - ✅ Choose the right template for your use case
331
+
332
+ **Estimated time to get here: ~20-25 minutes** 🚀
333
+
334
+ ---
335
+
336
+ ## Questions?
337
+
338
+ - Check the [README.md](./README.md) for detailed docs
339
+ - Review [INITIALIZATION_INSTRUCTION.MD](./INITIALIZATION_INSTRUCTION.MD) for advanced setup
340
+ - Open an issue on GitHub
341
+
342
+ Happy building! 🎉