Commit 0e72363
refactor: migrate ai-groq + ai-openrouter onto @tanstack/openai-base (#543)
Adds protected `callChatCompletion`, `callChatCompletionStream`,
`extractReasoning`, and `transformStructuredOutput` hooks to
`OpenAICompatibleChatCompletionsTextAdapter` so providers with non-OpenAI
SDK shapes can reuse the shared stream accumulator, partial-JSON tool-call
buffer, RUN_ERROR taxonomy, and lifecycle gates. ai-groq drops `groq-sdk`
in favour of the OpenAI SDK pointed at api.groq.com/openai/v1; ai-openrouter
keeps `@openrouter/sdk` via hook overrides. ai-ollama remains on
BaseTextAdapter (native API has a different wire format).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 27c9aeb commit 0e72363
12 files changed
Lines changed: 644 additions & 1360 deletions
File tree
- .changeset
- packages/typescript
- ai-groq
- src
- adapters
- utils
- tests
- ai-openrouter
- src/adapters
- tests
- openai-base/src
- adapters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
57 | 56 | | |
58 | 57 | | |
0 commit comments