feat(M3-004,M3-006): add OpenRouter adapter and Ollama embedding support
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed

- M3-004: Implement OpenRouterAdapter using openai SDK with custom base URL
  (https://openrouter.ai/api/v1). Fetches model catalog on registration,
  gracefully degrades when OPENROUTER_API_KEY is absent, streams completions
  via OpenAI-compatible API.

- M3-006: Enhance OllamaAdapter with embedding model registration
  (nomic-embed-text, mxbai-embed-large) and an embed(text, model?) method
  that calls Ollama's /api/embeddings endpoint. listModels() now returns
  both completion and embedding models. Prepares for M3-009 EmbeddingService.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 16:31:36 -05:00
parent cfdd2b679c
commit ad98755014
6 changed files with 313 additions and 7 deletions

20
pnpm-lock.yaml generated
View File

@@ -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