veris-ai 1.10.1__py3-none-any.whl → 1.11.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/README.md +4 -4
- veris_ai/observability.py +2 -1
- veris_ai/tool_mock.py +29 -6
- {veris_ai-1.10.1.dist-info → veris_ai-1.11.0.dist-info}/METADATA +3 -19
- {veris_ai-1.10.1.dist-info → veris_ai-1.11.0.dist-info}/RECORD +7 -7
- {veris_ai-1.10.1.dist-info → veris_ai-1.11.0.dist-info}/WHEEL +0 -0
- {veris_ai-1.10.1.dist-info → veris_ai-1.11.0.dist-info}/licenses/LICENSE +0 -0
veris_ai/README.md
CHANGED
|
@@ -27,16 +27,16 @@ This module contains the core implementation of the Veris AI Python SDK. Each co
|
|
|
27
27
|
|
|
28
28
|
### Mock Flow
|
|
29
29
|
1. **Decoration**: `@veris.mock()` captures function metadata
|
|
30
|
-
2. **
|
|
31
|
-
3. **API Call**: POST to
|
|
30
|
+
2. **Session Check**: Presence of session ID determines behavior
|
|
31
|
+
3. **API Call**: POST to VERIS API endpoint `/v2/tool_mock` (auto-configured)
|
|
32
32
|
4. **Type Conversion**: Response converted using `extract_json_schema()`
|
|
33
33
|
|
|
34
34
|
**Implementation**: [`tool_mock.py:200-250`](tool_mock.py)
|
|
35
35
|
|
|
36
36
|
### Spy Flow
|
|
37
|
-
1. **Pre-execution Logging**: Call details sent to `/v2/log_tool_call`
|
|
37
|
+
1. **Pre-execution Logging**: Call details sent to `/v2/simulations/{session_id}/log_tool_call`
|
|
38
38
|
2. **Function Execution**: Original function runs normally
|
|
39
|
-
3. **Post-execution Logging**: Response sent to `/v2/log_tool_response`
|
|
39
|
+
3. **Post-execution Logging**: Response sent to `/v2/simulations/{session_id}/log_tool_response`
|
|
40
40
|
|
|
41
41
|
**Implementation**: [`tool_mock.py:250-300`](tool_mock.py)
|
|
42
42
|
|
veris_ai/observability.py
CHANGED
|
@@ -16,7 +16,7 @@ logger = getLogger(__name__)
|
|
|
16
16
|
def init_observability() -> None: # noqa: PLR0912
|
|
17
17
|
"""Initialize tracing/export and set W3C propagation.
|
|
18
18
|
|
|
19
|
-
- Initializes
|
|
19
|
+
- Initializes Traceloop if available (acts as OTel bootstrap/exporter)
|
|
20
20
|
- Sets global propagator to TraceContext + Baggage (W3C)
|
|
21
21
|
- Instruments MCP, requests, httpx if instrumentation packages are present
|
|
22
22
|
- Adds a request hook to capture outbound traceparent for debugging
|
|
@@ -35,6 +35,7 @@ def init_observability() -> None: # noqa: PLR0912
|
|
|
35
35
|
logfire.instrument_mcp()
|
|
36
36
|
|
|
37
37
|
except Exception as e:
|
|
38
|
+
# Tracing is optional; continue without Traceloop
|
|
38
39
|
msg = "Logfire not found: " + str(e)
|
|
39
40
|
raise RuntimeError(msg) from e
|
|
40
41
|
|
veris_ai/tool_mock.py
CHANGED
|
@@ -62,13 +62,14 @@ class VerisSDK:
|
|
|
62
62
|
FastApiMCP,
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
-
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
|
|
65
|
+
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token", auto_error=False)
|
|
66
66
|
|
|
67
67
|
async def authenticate_request(
|
|
68
|
-
|
|
69
|
-
token: str = Depends(oauth2_scheme),
|
|
68
|
+
request: Request, # noqa: ARG001
|
|
69
|
+
token: str | None = Depends(oauth2_scheme),
|
|
70
70
|
) -> None:
|
|
71
|
-
|
|
71
|
+
if token:
|
|
72
|
+
self.set_session_id(token)
|
|
72
73
|
|
|
73
74
|
# Create auth config with dependencies
|
|
74
75
|
auth_config = AuthConfig(
|
|
@@ -267,6 +268,17 @@ def mock_tool_call(
|
|
|
267
268
|
return_type_obj = type_hints.pop("return", Any)
|
|
268
269
|
# Get function docstring
|
|
269
270
|
docstring = inspect.getdoc(func) or ""
|
|
271
|
+
|
|
272
|
+
# Clean up parameters for V3 - just send values, not the nested dict
|
|
273
|
+
clean_params: dict[str, Any] = {}
|
|
274
|
+
for key, value in parameters.items():
|
|
275
|
+
if isinstance(value, dict) and "value" in value:
|
|
276
|
+
# Extract just the value from the nested structure
|
|
277
|
+
clean_params[key] = value["value"]
|
|
278
|
+
else:
|
|
279
|
+
# Already clean or unexpected format
|
|
280
|
+
clean_params[key] = value
|
|
281
|
+
|
|
270
282
|
# Determine response expectation
|
|
271
283
|
payload = {
|
|
272
284
|
"session_id": session_id,
|
|
@@ -274,7 +286,7 @@ def mock_tool_call(
|
|
|
274
286
|
"cache_response": bool(options.cache_response),
|
|
275
287
|
"tool_call": {
|
|
276
288
|
"function_name": func.__name__,
|
|
277
|
-
"parameters":
|
|
289
|
+
"parameters": clean_params,
|
|
278
290
|
"return_type": json.dumps(extract_json_schema(return_type_obj)),
|
|
279
291
|
"docstring": docstring,
|
|
280
292
|
},
|
|
@@ -299,9 +311,20 @@ def log_tool_call(
|
|
|
299
311
|
"""Log tool call synchronously to the VERIS logging endpoint."""
|
|
300
312
|
api_client = get_api_client()
|
|
301
313
|
endpoint = api_client.get_log_tool_call_endpoint(session_id)
|
|
314
|
+
|
|
315
|
+
# Clean up parameters for V3 - just send values, not the nested dict
|
|
316
|
+
clean_params: dict[str, Any] = {}
|
|
317
|
+
for key, value in parameters.items():
|
|
318
|
+
if isinstance(value, dict) and "value" in value:
|
|
319
|
+
# Extract just the value from the nested structure
|
|
320
|
+
clean_params[key] = value["value"]
|
|
321
|
+
else:
|
|
322
|
+
# Already clean or unexpected format
|
|
323
|
+
clean_params[key] = value
|
|
324
|
+
|
|
302
325
|
payload = {
|
|
303
326
|
"function_name": function_name,
|
|
304
|
-
"parameters":
|
|
327
|
+
"parameters": clean_params,
|
|
305
328
|
"docstring": docstring,
|
|
306
329
|
}
|
|
307
330
|
try:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: veris-ai
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.11.0
|
|
4
4
|
Summary: A Python package for Veris AI tools
|
|
5
5
|
Project-URL: Homepage, https://github.com/veris-ai/veris-python-sdk
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/veris-ai/veris-python-sdk/issues
|
|
@@ -21,28 +21,12 @@ Requires-Dist: opentelemetry-sdk>=1.34.1
|
|
|
21
21
|
Requires-Dist: pydantic>=2.0.0
|
|
22
22
|
Requires-Dist: requests>=2.31.0
|
|
23
23
|
Requires-Dist: tenacity>=9.1.2
|
|
24
|
-
Provides-Extra: agents
|
|
25
|
-
Requires-Dist: openai-agents>=0.0.1; extra == 'agents'
|
|
26
|
-
Provides-Extra: dev
|
|
27
|
-
Requires-Dist: black>=23.7.0; extra == 'dev'
|
|
28
|
-
Requires-Dist: mypy>=1.5.1; extra == 'dev'
|
|
29
|
-
Requires-Dist: openai-agents>=0.2.5; extra == 'dev'
|
|
30
|
-
Requires-Dist: pre-commit>=3.3.3; extra == 'dev'
|
|
31
|
-
Requires-Dist: pytest-asyncio>=0.21.1; extra == 'dev'
|
|
32
|
-
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
33
|
-
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
34
|
-
Requires-Dist: ruff>=0.11.4; extra == 'dev'
|
|
35
|
-
Provides-Extra: fastapi
|
|
36
|
-
Requires-Dist: fastapi; extra == 'fastapi'
|
|
37
|
-
Requires-Dist: fastapi-mcp>=0.4.0; extra == 'fastapi'
|
|
38
|
-
Provides-Extra: instrument
|
|
39
|
-
Requires-Dist: opentelemetry-api; extra == 'instrument'
|
|
40
|
-
Requires-Dist: opentelemetry-sdk; extra == 'instrument'
|
|
41
|
-
Requires-Dist: wrapt; extra == 'instrument'
|
|
42
24
|
Description-Content-Type: text/markdown
|
|
43
25
|
|
|
44
26
|
# Veris AI Python SDK
|
|
45
27
|
|
|
28
|
+
For more information visit us at https://veris.ai
|
|
29
|
+
|
|
46
30
|
A Python package for Veris AI tools with simulation capabilities and FastAPI MCP (Model Context Protocol) integration.
|
|
47
31
|
|
|
48
32
|
## Quick Reference
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
veris_ai/README.md,sha256=
|
|
1
|
+
veris_ai/README.md,sha256=Ht1abGu-2_O0ZHJoJC7eAfG5WhO2CstAuV3hXPq1yAs,3875
|
|
2
2
|
veris_ai/__init__.py,sha256=enl_gEa6BQAjWvzCtsn_hFVJVVlJZ_dMsLL--E5W3nU,1907
|
|
3
3
|
veris_ai/agents_wrapper.py,sha256=N-YZ0qvIEJ8rlFZAzVKg6eWKa7I_qIt-khlg_zL-qY8,11931
|
|
4
4
|
veris_ai/api_client.py,sha256=385u11QuKq4Qk_WkI4Z5yOxAWJcV57VCGLYU5NIfnmo,3201
|
|
5
5
|
veris_ai/models.py,sha256=xKeheSJQle2tBeJG1DsGJzMDwv24p5jECjX6RAa39n4,495
|
|
6
|
-
veris_ai/observability.py,sha256=
|
|
7
|
-
veris_ai/tool_mock.py,sha256
|
|
6
|
+
veris_ai/observability.py,sha256=eSIXmk6fpOAoWM-sDbsvzyUASh1ZwU6tRIPduy09RxY,4206
|
|
7
|
+
veris_ai/tool_mock.py,sha256=--t0ZhjplJXzBt1F--XPE57ZyMBjB9SOjO2OzuoWkbk,12861
|
|
8
8
|
veris_ai/utils.py,sha256=hJetCiN8Bubhy0nqSoS1C2awN9cdkKuHM1v7YhtwtTs,10066
|
|
9
9
|
veris_ai/jaeger_interface/README.md,sha256=kd9rKcE5xf3EyNaiHu0tjn-0oES9sfaK6Ih-OhhTyCM,2821
|
|
10
10
|
veris_ai/jaeger_interface/__init__.py,sha256=KD7NSiMYRG_2uF6dOLKkGG5lNQe4K9ptEwucwMT4_aw,1128
|
|
11
11
|
veris_ai/jaeger_interface/client.py,sha256=yJrh86wRR0Dk3Gq12DId99WogcMIVbL0QQFqVSevvlE,8772
|
|
12
12
|
veris_ai/jaeger_interface/models.py,sha256=e64VV6IvOEFuzRUgvDAMQFyOZMRb56I-PUPZLBZ3rX0,1864
|
|
13
|
-
veris_ai-1.
|
|
14
|
-
veris_ai-1.
|
|
15
|
-
veris_ai-1.
|
|
16
|
-
veris_ai-1.
|
|
13
|
+
veris_ai-1.11.0.dist-info/METADATA,sha256=4ktkFw8WMexIqWwCtuRbFriJSVgAJp3_v0uny4R8lic,15259
|
|
14
|
+
veris_ai-1.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
15
|
+
veris_ai-1.11.0.dist-info/licenses/LICENSE,sha256=2g4i20atAgtD5einaKzhQrIB-JrPhyQgD3bC0wkHcCI,1065
|
|
16
|
+
veris_ai-1.11.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|