feat(openai-auth): add OpenAI Max device-code authentication and unified prompt caching helpers
This commit is contained in:
@@ -10,6 +10,7 @@ The package is a **provider registry** built on the Vercel AI SDK (`ai` v6). The
|
||||
- Providers: anthropic, openai, google, groq, mistral, xai, perplexity, ollama
|
||||
- Anthropic prompt caching via `wrapLanguageModel` middleware (enabled by default)
|
||||
- Custom Ollama provider implementing `LanguageModelV3` directly (for think, num_ctx support)
|
||||
- OpenAI ChatGPT/Max device-code auth in `smartai.auth.openai.ts`; `openAiMaxAuth` routes OpenAI models to the ChatGPT Codex backend
|
||||
|
||||
### Subpath Exports
|
||||
- `@push.rocks/smartai/vision` — `analyzeImage()` using `generateText` with image content
|
||||
@@ -43,6 +44,7 @@ The package is a **provider registry** built on the Vercel AI SDK (`ai` v6). The
|
||||
- `qenv.getEnvVarOnDemand()` returns a Promise — must be awaited in tests
|
||||
- OpenAI reasoning options belong in AI SDK `providerOptions`, not model construction options
|
||||
- SmartAI accepts OpenAI model IDs as plain strings, including `gpt-5.5`
|
||||
- ChatGPT-authenticated OpenAI model calls use `https://chatgpt.com/backend-api/codex` plus bearer access token and `ChatGPT-Account-ID`, not `https://api.openai.com/v1`
|
||||
|
||||
## Testing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user