feat(M3-003): implement OpenAI provider adapter for Codex gpt-5.4
Adds OpenAIAdapter implementing IProviderAdapter, replacing the legacy
registerOpenAIProvider() inline registration in ProviderService.
- Creates apps/gateway/src/agent/adapters/openai.adapter.ts with:
- register(): initialises OpenAI client, registers codex-gpt-5-4 with
Pi ModelRegistry using openai-completions API; skips gracefully when
OPENAI_API_KEY is absent
- listModels(): returns Codex gpt-5.4 ModelInfo (128k context, tools+vision)
- healthCheck(): lightweight GET /v1/models to verify API key validity
- createCompletion(): streaming completions via openai SDK
chat.completions.create({ stream: true }); maps chunks to CompletionEvent
- Installs openai SDK (^6.32.0) as a dependency in apps/gateway
- Registers OpenAIAdapter in ProviderService alongside OllamaAdapter
- Removes legacy registerOpenAIProvider() private method from ProviderService
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
20
pnpm-lock.yaml
generated
20
pnpm-lock.yaml
generated
@@ -143,6 +143,9 @@ importers:
|
||||
node-cron:
|
||||
specifier: ^4.2.1
|
||||
version: 4.2.1
|
||||
openai:
|
||||
specifier: ^6.32.0
|
||||
version: 6.32.0(ws@8.19.0)(zod@4.3.6)
|
||||
reflect-metadata:
|
||||
specifier: ^0.2.0
|
||||
version: 0.2.2
|
||||
@@ -4879,6 +4882,18 @@ packages:
|
||||
zod:
|
||||
optional: true
|
||||
|
||||
openai@6.32.0:
|
||||
resolution: {integrity: sha512-j3k+BjydAf8yQlcOI7WUQMQTbbF5GEIMAE2iZYCOzwwB3S2pCheaWYp+XZRNAch4jWVc52PMDGRRjutao3lLCg==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
ws: ^8.18.0
|
||||
zod: ^3.25 || ^4.0
|
||||
peerDependenciesMeta:
|
||||
ws:
|
||||
optional: true
|
||||
zod:
|
||||
optional: true
|
||||
|
||||
optionator@0.9.4:
|
||||
resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
@@ -10621,6 +10636,11 @@ snapshots:
|
||||
ws: 8.19.0
|
||||
zod: 4.3.6
|
||||
|
||||
openai@6.32.0(ws@8.19.0)(zod@4.3.6):
|
||||
optionalDependencies:
|
||||
ws: 8.19.0
|
||||
zod: 4.3.6
|
||||
|
||||
optionator@0.9.4:
|
||||
dependencies:
|
||||
deep-is: 0.1.4
|
||||
|
||||
Reference in New Issue
Block a user