Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ai-openai-batch-nullable-fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/ai-openai": patch
---

Fix Batch API decode failures when OpenAI returns `null` for `model`, `output_file_id`, or `error_file_id`. The OpenAPI spec marks these fields as optional but not nullable, while OpenAI returns `null` (e.g. `model: null` on a freshly created batch that hasn't been validated yet, `output_file_id: null` until the batch completes). Patched the codegen spec to mark all three nullable.
5 changes: 5 additions & 0 deletions .changeset/ai-openai-files-status-details-null.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/ai-openai": patch
---

Fix Files API decode failure when OpenAI returns `status_details: null`. The OpenAPI spec marks `OpenAIFile.status_details` as optional but not nullable, while OpenAI actually returns `null`, so `createFile` / `retrieveFile` / `listFiles` failed with `SchemaError(Expected string, got null at ["status_details"])`. Patched the codegen spec to mark the field nullable.
4 changes: 4 additions & 0 deletions packages/ai/openai/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ patches:
- '[{"op":"add","path":"/components/schemas/ModelResponseProperties/properties/safety_identifier/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/ModelResponseProperties/properties/prompt_cache_key/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Response/allOf/2/properties/usage/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/OpenAIFile/properties/status_details/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Batch/properties/model/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Batch/properties/output_file_id/nullable","value":true}]'
- '[{"op":"add","path":"/components/schemas/Batch/properties/error_file_id/nullable","value":true}]'
- '[{"op":"remove","path":"/components/schemas/ResponseFunctionCallArgumentsDoneEvent/required/2"}]'
- '[{"op":"remove","path":"/components/schemas/WebSearchActionSearch/required/1"}]'
- '[{"op":"add","path":"/components/schemas/ModelResponseProperties/properties/prompt_cache_retention/anyOf/0/enum/1","value":"in_memory"}]'
Expand Down
Loading