Pre-release
This release is a pre-release and may not be stable for production use.
ppx-openai
OpenAI Assistants API integration for the Preference Profile Exchange (PPX).
Install
pip install ppx-openai
Requires Python 3.11+. Published version: 0.1.0a1 (PyPI).
Alpha, tracking a draft specification. Expect breaking changes. The version is
0.1.0a1on PyPI and0.1.0-alpha.1on npm — the same release in each ecosystem's required format.
Assistants API — minimal example
from openai import OpenAI
from ppx_client import PpxClient
from ppx_openai import ppx_tool_schema, handle_run
oai = OpenAI()
ppx = PpxClient("https://api.provider.app")
assistant = oai.beta.assistants.create(
name="scent-advisor",
model="gpt-4o-mini",
instructions=(
"Recommend fragrances. Use lookup_user_preference before suggesting "
"anything opinionated — the user's PPX profile has their preferences."
),
tools=[ppx_tool_schema()],
)
thread = oai.beta.threads.create()
oai.beta.threads.messages.create(
thread_id=thread.id, role="user",
content="Suggest something for a hot, humid evening.",
)
run = oai.beta.threads.runs.create(thread_id=thread.id, assistant_id=assistant.id)
# Handler loops over requires_action → tool output → continue
final = handle_run(
thread_id=thread.id,
run=run,
openai_client=oai,
ppx_client=ppx,
grant_token=my_grant_token,
)
messages = oai.beta.threads.messages.list(thread_id=thread.id)
print(messages.data[0].content[0].text.value)
Every tool call routes through the same grant-scoped read path as the browser flow. The model can never see claims the user didn't authorize.
License
Apache-2.0.
Metadata
Release files for ppx-openai 0.1.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ppx_openai-0.1.0a4.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ppx_openai-0.1.0a4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB
Release files / ppx_openai-0.1.0a4.tar.gz
| Download URL | ppx_openai-0.1.0a4.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b61134e83fd84d5e7c278f791799e179a93ed622d704ab293f47b0d6ada5075
|
|
BLAKE2b-256 checksum How to use checksums |
7bf785d77199aeefcaaac0f21ad39086aaee9e5d21b923aa46216f8723446f08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / ppx_openai-0.1.0a4-py3-none-any.whl
| Download URL | ppx_openai-0.1.0a4-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26d9cf935346771ec0612932f953564a563223808cb5f6566f842099c83b6d68
|
|
BLAKE2b-256 checksum How to use checksums |
9dd4ae4f1d98bc75e3073cfd7092ff3ef5d8ea1a3b0f3895c6f69480b95bb85c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|