veris-ai 1.0.0__py3-none-any.whl → 1.2.0__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.
Potentially problematic release.
This version of veris-ai might be problematic. Click here for more details.
- veris_ai/__init__.py +36 -1
- veris_ai/braintrust_tracing.py +282 -0
- veris_ai/jaeger_interface/README.md +137 -0
- veris_ai/jaeger_interface/__init__.py +39 -0
- veris_ai/jaeger_interface/client.py +233 -0
- veris_ai/jaeger_interface/models.py +79 -0
- veris_ai/models.py +11 -0
- veris_ai/tool_mock.py +162 -64
- veris_ai/utils.py +201 -1
- veris_ai-1.2.0.dist-info/METADATA +457 -0
- veris_ai-1.2.0.dist-info/RECORD +13 -0
- veris_ai-1.0.0.dist-info/METADATA +0 -239
- veris_ai-1.0.0.dist-info/RECORD +0 -7
- {veris_ai-1.0.0.dist-info → veris_ai-1.2.0.dist-info}/WHEEL +0 -0
- {veris_ai-1.0.0.dist-info → veris_ai-1.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: veris-ai
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: A Python package for Veris AI tools
|
|
5
|
-
Project-URL: Homepage, https://github.com/veris-ai/veris-python-sdk
|
|
6
|
-
Project-URL: Bug Tracker, https://github.com/veris-ai/veris-python-sdk/issues
|
|
7
|
-
Author-email: Mehdi Jamei <mehdi@veris.ai>
|
|
8
|
-
License-Expression: MIT
|
|
9
|
-
License-File: LICENSE
|
|
10
|
-
Requires-Python: >=3.11
|
|
11
|
-
Requires-Dist: httpx>=0.24.0
|
|
12
|
-
Provides-Extra: dev
|
|
13
|
-
Requires-Dist: black>=23.7.0; extra == 'dev'
|
|
14
|
-
Requires-Dist: mypy>=1.5.1; extra == 'dev'
|
|
15
|
-
Requires-Dist: pre-commit>=3.3.3; extra == 'dev'
|
|
16
|
-
Requires-Dist: pytest-asyncio>=0.21.1; extra == 'dev'
|
|
17
|
-
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
18
|
-
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
19
|
-
Requires-Dist: ruff>=0.11.4; extra == 'dev'
|
|
20
|
-
Provides-Extra: fastapi
|
|
21
|
-
Requires-Dist: fastapi; extra == 'fastapi'
|
|
22
|
-
Requires-Dist: fastapi-mcp; extra == 'fastapi'
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
|
|
25
|
-
# Veris AI Python SDK
|
|
26
|
-
|
|
27
|
-
A Python package for Veris AI tools with simulation capabilities and FastAPI MCP (Model Context Protocol) integration.
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
|
|
31
|
-
You can install the package using `uv`:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Install the package
|
|
35
|
-
uv add veris-ai
|
|
36
|
-
|
|
37
|
-
# Install with development dependencies
|
|
38
|
-
uv add "veris-ai[dev]"
|
|
39
|
-
|
|
40
|
-
# Install with FastAPI MCP integration
|
|
41
|
-
uv add "veris-ai[fastapi]"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Environment Setup
|
|
45
|
-
|
|
46
|
-
The package requires the following environment variables:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
# Required: URL for the mock endpoint
|
|
50
|
-
VERIS_MOCK_ENDPOINT_URL=http://your-mock-endpoint.com
|
|
51
|
-
|
|
52
|
-
# Optional: Timeout in seconds (default: 30.0)
|
|
53
|
-
VERIS_MOCK_TIMEOUT=30.0
|
|
54
|
-
|
|
55
|
-
# Optional: Set to "simulation" to enable mock mode
|
|
56
|
-
ENV=simulation
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Python Version
|
|
60
|
-
|
|
61
|
-
This project requires Python 3.11 or higher. We use [pyenv](https://github.com/pyenv/pyenv) for Python version management.
|
|
62
|
-
|
|
63
|
-
To set up the correct Python version:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# Install Python 3.11.0 using pyenv
|
|
67
|
-
pyenv install 3.11.0
|
|
68
|
-
|
|
69
|
-
# Set the local Python version for this project
|
|
70
|
-
pyenv local 3.11.0
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Usage
|
|
74
|
-
|
|
75
|
-
```python
|
|
76
|
-
from veris_ai import veris
|
|
77
|
-
|
|
78
|
-
@veris.mock()
|
|
79
|
-
async def your_function(param1: str, param2: int) -> dict:
|
|
80
|
-
"""
|
|
81
|
-
Your function documentation here.
|
|
82
|
-
|
|
83
|
-
Args:
|
|
84
|
-
param1: Description of param1
|
|
85
|
-
param2: Description of param2
|
|
86
|
-
|
|
87
|
-
Returns:
|
|
88
|
-
A dictionary containing the results
|
|
89
|
-
"""
|
|
90
|
-
# Your implementation here
|
|
91
|
-
return {"result": "actual implementation"}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
When `ENV=simulation` is set, the decorator will:
|
|
95
|
-
1. Capture the function signature, type hints, and docstring
|
|
96
|
-
2. Send this information to the mock endpoint
|
|
97
|
-
3. Convert the mock response to the expected return type
|
|
98
|
-
4. Return the mock result
|
|
99
|
-
|
|
100
|
-
When not in simulation mode, the original function will be executed normally.
|
|
101
|
-
|
|
102
|
-
## FastAPI MCP Integration
|
|
103
|
-
|
|
104
|
-
The SDK provides integration with FastAPI applications through the Model Context Protocol (MCP). This allows your FastAPI endpoints to be exposed as MCP tools that can be used by AI agents.
|
|
105
|
-
|
|
106
|
-
```python
|
|
107
|
-
from fastapi import FastAPI
|
|
108
|
-
from veris_ai import veris
|
|
109
|
-
|
|
110
|
-
app = FastAPI()
|
|
111
|
-
|
|
112
|
-
# Set up FastAPI MCP with automatic session handling
|
|
113
|
-
veris.set_fastapi_mcp(
|
|
114
|
-
fastapi=app,
|
|
115
|
-
name="My API Server",
|
|
116
|
-
description="My FastAPI application exposed as MCP tools",
|
|
117
|
-
describe_all_responses=True,
|
|
118
|
-
include_operations=["get_users", "create_user"],
|
|
119
|
-
exclude_tags=["internal"]
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
# The MCP server is now available at veris.fastapi_mcp
|
|
123
|
-
mcp_server = veris.fastapi_mcp
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Configuration Options
|
|
127
|
-
|
|
128
|
-
The `set_fastapi_mcp()` method accepts the following parameters:
|
|
129
|
-
|
|
130
|
-
- **fastapi** (required): Your FastAPI application instance
|
|
131
|
-
- **name**: Custom name for the MCP server (defaults to app.title)
|
|
132
|
-
- **description**: Custom description (defaults to app.description)
|
|
133
|
-
- **describe_all_responses**: Whether to include all response schemas in tool descriptions
|
|
134
|
-
- **describe_full_response_schema**: Whether to include full JSON schema for responses
|
|
135
|
-
- **http_client**: Optional custom httpx.AsyncClient instance
|
|
136
|
-
- **include_operations**: List of operation IDs to include as MCP tools
|
|
137
|
-
- **exclude_operations**: List of operation IDs to exclude (can't use with include_operations)
|
|
138
|
-
- **include_tags**: List of tags to include as MCP tools
|
|
139
|
-
- **exclude_tags**: List of tags to exclude (can't use with include_tags)
|
|
140
|
-
- **auth_config**: Optional FastAPI MCP AuthConfig for custom authentication
|
|
141
|
-
|
|
142
|
-
### Session Management
|
|
143
|
-
|
|
144
|
-
The SDK automatically handles session management through OAuth2 authentication:
|
|
145
|
-
- Session IDs are extracted from bearer tokens
|
|
146
|
-
- Context is maintained across API calls
|
|
147
|
-
- Sessions can be managed programmatically:
|
|
148
|
-
|
|
149
|
-
```python
|
|
150
|
-
# Get current session ID
|
|
151
|
-
session_id = veris.session_id
|
|
152
|
-
|
|
153
|
-
# Set a new session ID
|
|
154
|
-
veris.set_session_id("new-session-123")
|
|
155
|
-
|
|
156
|
-
# Clear the session
|
|
157
|
-
veris.clear_session_id()
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Project Structure
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
src/veris_ai/
|
|
164
|
-
├── __init__.py # Main entry point, exports the veris instance
|
|
165
|
-
├── tool_mock.py # VerisSDK class with @veris.mock() decorator
|
|
166
|
-
└── utils.py # Type conversion utilities
|
|
167
|
-
|
|
168
|
-
tests/
|
|
169
|
-
├── conftest.py # Pytest fixtures
|
|
170
|
-
├── test_tool_mock.py # Tests for VerisSDK functionality
|
|
171
|
-
└── test_utils.py # Tests for type conversion utilities
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## Development
|
|
175
|
-
|
|
176
|
-
This project uses `pyproject.toml` for dependency management and `uv` for package installation.
|
|
177
|
-
|
|
178
|
-
### Development Dependencies
|
|
179
|
-
|
|
180
|
-
To install the package with development dependencies:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
uv add "veris-ai[dev]"
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
This will install the following development tools:
|
|
187
|
-
- **Ruff**: Fast Python linter
|
|
188
|
-
- **pytest**: Testing framework
|
|
189
|
-
- **pytest-asyncio**: Async support for pytest
|
|
190
|
-
- **pytest-cov**: Coverage reporting for pytest
|
|
191
|
-
- **black**: Code formatter
|
|
192
|
-
- **mypy**: Static type checker
|
|
193
|
-
- **pre-commit**: Git hooks for code quality
|
|
194
|
-
|
|
195
|
-
### Code Quality
|
|
196
|
-
|
|
197
|
-
This project uses [Ruff](https://github.com/charliermarsh/ruff) for linting and code quality checks. Ruff is a fast Python linter written in Rust.
|
|
198
|
-
|
|
199
|
-
To run Ruff:
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
# Lint code
|
|
203
|
-
ruff check .
|
|
204
|
-
|
|
205
|
-
# Auto-fix linting issues
|
|
206
|
-
ruff check --fix .
|
|
207
|
-
|
|
208
|
-
# Format code
|
|
209
|
-
ruff format .
|
|
210
|
-
|
|
211
|
-
# Check formatting only
|
|
212
|
-
ruff format --check .
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
The Ruff configuration is defined in `pyproject.toml` under the `[tool.ruff]` section.
|
|
216
|
-
|
|
217
|
-
### Running Tests
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
# Run all tests with coverage
|
|
221
|
-
pytest tests/ --cov=veris_ai --cov-report=xml --cov-report=term-missing
|
|
222
|
-
|
|
223
|
-
# Run specific test file
|
|
224
|
-
pytest tests/test_tool_mock.py
|
|
225
|
-
|
|
226
|
-
# Run tests with verbose output
|
|
227
|
-
pytest -v tests/
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Type Checking
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
# Run static type checking
|
|
234
|
-
mypy src/veris_ai tests
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
## License
|
|
238
|
-
|
|
239
|
-
This project is licensed under the MIT License - see the LICENSE file for details.
|
veris_ai-1.0.0.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
veris_ai/__init__.py,sha256=7mEfVmqxQCn5FZN_1ua3iykCB1NUeJ4RfVXaAzdp4Hw,101
|
|
2
|
-
veris_ai/tool_mock.py,sha256=Yr702kl9ggdRUnR_iL37UXFjz-drvQqVpp7JdT_qlb4,5665
|
|
3
|
-
veris_ai/utils.py,sha256=-r4FZajHfrcjB0rhluQl2KDS68ER9pqHp8g_pmB1qAE,2322
|
|
4
|
-
veris_ai-1.0.0.dist-info/METADATA,sha256=mnB4E-ZMjyfrxiVVM2BQ27Ie7SDd-AZK-LuVjHj0cjo,6503
|
|
5
|
-
veris_ai-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
6
|
-
veris_ai-1.0.0.dist-info/licenses/LICENSE,sha256=2g4i20atAgtD5einaKzhQrIB-JrPhyQgD3bC0wkHcCI,1065
|
|
7
|
-
veris_ai-1.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|