feat: selectable wire format — ollama (default), openai (vLLM etc.), anthropic
Port the multi-API client from llm.chat (llm.rs kept in lockstep): the optional api input selects the dialect, default stays the unchanged v0.1.x Ollama behavior. openai covers vLLM, LM Studio, LiteLLM and cloud OpenAI; api-specific error hints; api_key sent as Bearer (ollama/openai) or x-api-key (anthropic). model_digest stays an Ollama-only best-effort probe and is documented as such. Proven end-to-end against a hermetic OpenAI-wire fake (request shape validated, response parsed) via a hub flow run. Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
parent
19886a7072
commit
4a04abf4f0
6 changed files with 559 additions and 90 deletions
37
module.yaml
37
module.yaml
|
|
@ -1,12 +1,12 @@
|
|||
schema_version: 3
|
||||
provider: chain
|
||||
name: text-summarize
|
||||
version: 0.1.0
|
||||
version: 0.2.0
|
||||
|
||||
# Capability provided by this module.
|
||||
provides:
|
||||
- capability: text.summarize
|
||||
version: 0.1.0
|
||||
version: 0.2.0
|
||||
|
||||
# Inputs the invoke function accepts.
|
||||
inputs:
|
||||
|
|
@ -38,8 +38,27 @@ inputs:
|
|||
endpoint:
|
||||
type: text
|
||||
description:
|
||||
en: Ollama-shaped /api/chat endpoint.
|
||||
de: Ollama-kompatibler /api/chat-Endpunkt.
|
||||
en: |
|
||||
Chat endpoint URL matching the selected api:
|
||||
ollama "http://localhost:11434/api/chat",
|
||||
openai "http://localhost:8000/v1/chat/completions"
|
||||
(vLLM etc.), anthropic "https://.../v1/messages".
|
||||
de: |
|
||||
Chat-Endpunkt-URL passend zum gewählten api:
|
||||
ollama "http://localhost:11434/api/chat",
|
||||
openai "http://localhost:8000/v1/chat/completions"
|
||||
(vLLM u. a.), anthropic "https://.../v1/messages".
|
||||
api:
|
||||
type: text
|
||||
description:
|
||||
en: |
|
||||
Optional wire format: "ollama" (default), "openai"
|
||||
(OpenAI-compatible servers such as vLLM or LM Studio),
|
||||
or "anthropic" (Messages API). Empty = ollama.
|
||||
de: |
|
||||
Optionales Wire-Format: "ollama" (Default), "openai"
|
||||
(OpenAI-kompatible Server wie vLLM oder LM Studio)
|
||||
oder "anthropic" (Messages API). Leer = ollama.
|
||||
model:
|
||||
type: text
|
||||
description:
|
||||
|
|
@ -81,8 +100,14 @@ outputs:
|
|||
model_digest:
|
||||
type: text
|
||||
description:
|
||||
en: SHA-256 digest of the served Ollama model (when reachable).
|
||||
de: SHA-256-Digest des bedienten Ollama-Modells (wenn erreichbar).
|
||||
en: |
|
||||
SHA-256 digest of the served model, best-effort probe.
|
||||
Ollama only — empty for other endpoints (OpenAI / vLLM /
|
||||
Anthropic expose no digest API).
|
||||
de: |
|
||||
SHA-256-Digest des bedienten Modells (Best-Effort-Probe).
|
||||
Nur bei Ollama — leer bei anderen Endpunkten (OpenAI /
|
||||
vLLM / Anthropic bieten keine Digest-API).
|
||||
|
||||
# Permissions required.
|
||||
permissions:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue