Repository navigation
Add openai-360: a warranty claims desk on six OpenAI endpoints - #11
pierrebrunelle wants to merge 1 commit into
Conversation
A warranty claim arrives as a photo and a voice note. One computed-column chain transcribes it, runs moderation, asks the Decisions API four questions about the transcript and photo, routes the claim, and drafts and speaks a reply only for approved claims. A null prompt skips responses() and speech() for the rest. An embedding index on the transcript backs similar-claim search. seed.py generates four demo claims with image_generations() and speech(). decisions() needs pixeltable 0.7.22, and the kit holds one floor that matches each lockfile, so chat-agent and video-search move to 0.7.23 as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The seed script files claims for all stored demo inputs rather than only newly inserted ones, causing duplicate claims and repeated paid API calls on subsequent runs.
1 open issue
What changed in this PR
Adds openai-360 as the starter kit’s third single-file app: a warranty claims desk that processes photos and voice notes through six OpenAI endpoints.
Changes:
- Adds claim triage, approval-gated text and voice replies, similarity search, and HTTP routes.
- Provides synthetic demo inputs, deployment configuration, and usage documentation.
- Extends CI and structural checks to the new app and aligns Pixeltable dependencies across apps.
| File | Description |
|---|---|
video-search/uv.lock |
Updates Pixeltable and its PostgreSQL server dependency. |
video-search/pyproject.toml |
Raises the Pixeltable minimum version. |
tests/test_structure.py |
Includes the new app in structural checks. |
tests/test_schema.py |
Adds the new app’s schema import smoke check. |
tests/conftest.py |
Registers the app and its required files. |
README.md |
Introduces the claims app and quickstart. |
openai-360/seed.py |
Generates and files four synthetic demo claims. |
openai-360/README.md |
Documents processing, inspection, HTTP, and deployment. |
openai-360/pyproject.toml |
Defines dependencies and Python modules. |
openai-360/pixeltable.toml |
Declares the Pixeltable project configuration. |
openai-360/Dockerfile |
Packages schema application and foreground serving. |
openai-360/docker-compose.yml |
Configures service access, API credentials, and persistence. |
openai-360/app.py |
Defines claim processing, demo models, queries, and routes. |
openai-360/.dockerignore |
Excludes local artifacts from Docker builds. |
CONTRIBUTING.md |
Includes the app in lint commands. |
chat-agent/uv.lock |
Updates Pixeltable and its PostgreSQL server dependency. |
chat-agent/pyproject.toml |
Raises the Pixeltable minimum version. |
AGENTS.md |
Updates app layout and validation instructions. |
.github/workflows/test.yml |
Adds lint, import, and schema application checks for the app. |
Review effort: Balanced
| app.DemoInputs.insert(DEMO_CLAIMS) | ||
| demo = app.DemoInputs.select(app.DemoInputs.product, app.DemoInputs.photo, app.DemoInputs.voice_note) | ||
| app.Claims.insert(list(demo.collect())) |
pierrebrunelle
left a comment
There was a problem hiding this comment.
Reviewed 15824a3..46ef51d against installed pixeltable 0.7.23.
No blocking issues. Verified the whole API surface on the installed package rather than trusting the floor: decisions (question shapes, answers[i].probability/choice/score, the refusal type degrading through your None -> review path), moderations (results[0].flagged), transcriptions (.text), responses, speech (-> pxt.Audio), image_generations (data: list[PIL.Image], so .data[0] is a real image), embeddings.using, pxt.Column(value=pxtf.uuid.uuid7(), primary_key=True). All present with matching signatures.
The null-propagation design is correct end to end: a NULL transcript short-circuits moderations, reply_prompt returning None skips responses(), and NULL reply_text skips speech() — the "approved only" cost claim in the README is real. Dockerfile layering (--no-install-project first), the bare OPENAI_API_KEY compose pass-through, and the service run vs service update comment are all right. CI/tests/docs extended consistently.
Limits: did not run the app (no OPENAI_API_KEY); uv.lock not audited line-by-line; trusting the body's live verification for gpt-6-luna/gpt-image-2 availability.
|
|
||
| TableModel = pxt.model_base() | ||
|
|
||
| MODEL = "gpt-6-luna" |
There was a problem hiding this comment.
MODEL reads like it governs the app's model choices; it feeds only decisions(). DECISION_MODEL, or inline it like the six other calls?
| app.TableModel.bind_all(target) | ||
| app.DemoInputs.insert(DEMO_CLAIMS) | ||
| demo = app.DemoInputs.select(app.DemoInputs.product, app.DemoInputs.photo, app.DemoInputs.voice_note) | ||
| app.Claims.insert(list(demo.collect())) |
There was a problem hiding this comment.
Running seed.py twice files the four claims twice. Worth a one-line note in the docstring (demo input, not idempotent), or a count check?
| questions=QUESTIONS, | ||
| model=MODEL, | ||
| ) | ||
| damaged = triage.answers[0].probability |
There was a problem hiding this comment.
triage.answers[i] can have type == 'refusal' with no value — your columns land as NULL and route to review, which is the right degradation. A comment saying so would save the next reader the trace.

A warranty claim arrives as a photo and a voice note.
openai-360/app.pyruns six OpenAI endpoints in one table:transcriptopenai.transcriptions()flaggedopenai.moderations()triage, thendamaged,consistent,cause,severityopenai.decisions(): four questions about the transcript and photo in one requestrouteroute_claim():approve,revieworescalatereply_textopenai.responses(), approved claims onlyvoice_replyopenai.speech()transcriptopenai.embeddings(), forsimilar_claims()reply_prompt()returnsNoneunless the claim is approved, and aNoneargument skips the call, so a claim sent to review never reachesresponses()orspeech().seed.pygenerates four demo claims withimage_generations()andspeech().Version floors
decisions()needs pixeltable 0.7.22.tests/test_config.pyrequires one floor across apps that matches each lockfile, sochat-agentandvideo-searchmove to>=0.7.23too. Their relock changes onlypixeltableandpixeltable-pgserver.Verified
Live against OpenAI, in an isolated Pixeltable home:
pxt errorsreports no failed cells.pxt describe,computed,historyand the dashboard's Lineage tab show each column with its call.route_claim(),pxt recompute claims/claims route -fapproved the coffee maker and generated its reply. Restoring the gate cleared it.POST /api/claims(multipart photo and mp3),GET /api/reviewandPOST /api/similaranswered over HTTP.pytest tests/(80 passed, 1 skipped),pytest tests/test_schema.py --run-slow, andpxt schema updatethenpxt schema difffor all three apps on 0.7.23.Not covered
app-smokejob does not run this app; it would need anOPENAI_API_KEYsecret..devcontainer/cloud.shanduvx pixeltable-newdo not know this app, so it is clone only.