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
47db969564
commit
c54c14b28a
6 changed files with 567 additions and 93 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# text.translate
|
||||
|
||||
Ollama-backed translation between languages. Sends source text
|
||||
LLM-backed translation between languages (Ollama, vLLM, any OpenAI-compatible server, or Anthropic). Sends source text
|
||||
to a configured LLM endpoint with a translation system prompt
|
||||
and emits the translated text plus audit-grade
|
||||
model-provenance fields.
|
||||
|
|
@ -16,7 +16,8 @@ model-provenance fields.
|
|||
| `text` | text | Source text to translate. |
|
||||
| `target_language` | text | Target language in plain English (e.g. `German`, `French`, `ja-JP`). |
|
||||
| `source_language` | text | Optional source-language hint. Empty = let the model auto-detect. |
|
||||
| `endpoint` | text | Ollama-shaped `/api/chat` endpoint URL. |
|
||||
| `endpoint` | text | Chat endpoint URL matching the selected `api` (Ollama `/api/chat`, OpenAI-compatible `/v1/chat/completions` — vLLM etc., Anthropic `/v1/messages`). |
|
||||
| `api` | text | Optional wire format: `ollama` (default), `openai`, `anthropic`. |
|
||||
| `model` | text | Model identifier the endpoint serves (e.g. `qwen2.5:14b`). |
|
||||
| `api_key` | text | Optional bearer token for cloud-hosted endpoints. |
|
||||
|
||||
|
|
@ -29,7 +30,7 @@ model-provenance fields.
|
|||
| `target_language` | text | Echo of the input value. |
|
||||
| `model_endpoint` | text | URL the translation was generated against. |
|
||||
| `model_name` | text | Model identifier as supplied to the LLM API. |
|
||||
| `model_digest` | text | SHA-256 digest of the served Ollama model (when reachable). |
|
||||
| `model_digest` | text | SHA-256 digest of the served model — Ollama only, empty elsewhere. |
|
||||
|
||||
The three `model_*` outputs are the audit primitive: every
|
||||
translation in the flow log can be matched to the exact model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue