magi-openai 0.1.1

OpenAI compatible API SDK for Magi AI agents
Documentation
# OpenAI Chat Completions API Changelog

This document tracks updates to the completions module to keep it in sync with the OpenAI Chat Completions API.

## [2025-12-11] - API Sync Update

Synced with OpenAI OpenAPI spec (commit 498c71d on manual_spec branch).

### request.rs

#### Added
- `ToolChoice::Required` variant - model must call one or more tools
- `FinishReason::FunctionCall` variant (deprecated) - for backwards compatibility
- `PredictionType` enum with `Content` variant for typed prediction config
- `PredictionContent` enum supporting both `Text(String)` and `Array(Vec<Value>)`
- `AudioFormat` enum with variants: `Wav`, `Aac`, `Mp3`, `Flac`, `Opus`, `Pcm16`

#### Changed
- `ReasoningEffort`: Removed `Minimal` variant (API only supports `low`, `medium`, `high`)
- `PredictionConfig`: Changed from flat structure to typed structure:
  - Old: `{ text: String, logprobs: Option<Vec<f32>> }`
  - New: `{ type: "content", content: String | Array }`
- `AudioConfig`: Changed `format` from `Option<String>` to required `AudioFormat` enum
- `ToolChoice` doc comment: Updated to reflect current API terminology (tools vs functions)

### response.rs

#### Added
- `Role::Developer` variant - for developer-provided instructions
- `Role::Function` variant (deprecated) - for backwards compatibility

#### Changed
- `ServiceTier`: Removed `Priority` variant (not in API spec)
- Added documentation for `ServiceTier` variants

### chunk.rs

No changes - already aligned with spec.

## API Reference

- https://platform.openai.com/docs/api-reference/chat/create
- https://platform.openai.com/docs/api-reference/chat/streaming
- OpenAPI spec: vendor/openai-openapi/openapi.yaml (manual_spec branch)