vouch-openai 0.1.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.
@@ -0,0 +1,15 @@
1
+ """Sign OpenAI agent tool calls with Vouch Credentials.
2
+
3
+ Thin re-export of :mod:`vouch.integrations.openai` so the integration installs
4
+ as a standalone package that pulls in both ``vouch-protocol`` and ``openai``.
5
+ """
6
+
7
+ from vouch.integrations.openai import (
8
+ protect,
9
+ sign_tool_call,
10
+ signed_tool,
11
+ verify_tool_call,
12
+ )
13
+
14
+ __all__ = ["protect", "signed_tool", "sign_tool_call", "verify_tool_call"]
15
+ __version__ = "0.1.0"
@@ -0,0 +1,76 @@
1
+ Metadata-Version: 2.4
2
+ Name: vouch-openai
3
+ Version: 0.1.0
4
+ Summary: Sign OpenAI agent tool calls with Vouch Credentials.
5
+ Author: Ramprasad Gaddam
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://vouch-protocol.com
8
+ Project-URL: Source, https://github.com/vouch-protocol/vouch
9
+ Keywords: openai,vouch,ai-agents,verifiable-credentials,identity
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: vouch-protocol>=1.6.0
13
+ Requires-Dist: openai>=1.0.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7.0; extra == "dev"
16
+
17
+ # vouch-openai
18
+
19
+ Sign the tool (function) calls an OpenAI agent makes with Vouch Protocol Credentials, so every action an OpenAI-driven agent takes carries a verifiable identity and a non-repudiable record.
20
+
21
+ It works with the OpenAI Python SDK function calling (Chat Completions and the Responses API) and with the OpenAI Agents SDK, because all of them dispatch to Python tool callables and expose a tool call as a name plus JSON arguments.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install vouch-openai
27
+ ```
28
+
29
+ ## Configure an identity
30
+
31
+ ```bash
32
+ export VOUCH_DID='did:web:your-agent.example.com'
33
+ export VOUCH_PRIVATE_KEY='{"kty":"OKP","crv":"Ed25519",...}'
34
+ ```
35
+
36
+ Generate one with `vouch init --domain your-agent.example.com --env`, or pass a `Signer` explicitly.
37
+
38
+ ## Sign the model's requested tool call
39
+
40
+ ```python
41
+ from openai import OpenAI
42
+ from vouch.integrations.openai import sign_tool_call
43
+
44
+ client = OpenAI()
45
+ response = client.chat.completions.create(model="gpt-4o", messages=messages, tools=tools)
46
+
47
+ for call in response.choices[0].message.tool_calls:
48
+ credential = sign_tool_call(call) # binds the action and its arguments
49
+ result = dispatch(call) # run your tool
50
+ ```
51
+
52
+ ## Sign the tool callables
53
+
54
+ ```python
55
+ from vouch.integrations.openai import signed_tool, protect
56
+
57
+ @signed_tool
58
+ def get_weather(city: str) -> str:
59
+ ...
60
+
61
+ tools = protect([get_weather, send_email]) # every invocation is signed
62
+ ```
63
+
64
+ ## Verify
65
+
66
+ ```python
67
+ from vouch.integrations.openai import verify_tool_call
68
+
69
+ ok, passport = verify_tool_call(credential)
70
+ ```
71
+
72
+ A tool runs whether or not an identity is resolved; when none is configured, signing is skipped and the call proceeds unsigned.
73
+
74
+ ## License
75
+
76
+ Apache-2.0. Part of [Vouch Protocol](https://vouch-protocol.com).
@@ -0,0 +1,5 @@
1
+ vouch_openai/__init__.py,sha256=tPOVYMmr3XzvarDTFA4NtPSYoCuvdbpTImztX1rygc4,431
2
+ vouch_openai-0.1.0.dist-info/METADATA,sha256=Lw6Ba5m89_MmFr3UW8SvYM29Vdl2-p-eQZ64lQmeOtE,2273
3
+ vouch_openai-0.1.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
4
+ vouch_openai-0.1.0.dist-info/top_level.txt,sha256=zzmXt_gM_jJbk4EnsFIo-bTqQWR4yz931YILdM9g-es,13
5
+ vouch_openai-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ vouch_openai