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-basierte Übersetzung zwischen Sprachen. Sendet Quelltext
|
||||
LLM-basierte Übersetzung zwischen Sprachen (Ollama, vLLM, jeder OpenAI-kompatible Server oder Anthropic). Sendet Quelltext
|
||||
an einen konfigurierten LLM-Endpunkt mit einem
|
||||
Übersetzungs-System-Prompt und liefert die Übersetzung plus
|
||||
audit-taugliche Modell-Herkunfts-Felder.
|
||||
|
|
@ -16,7 +16,8 @@ audit-taugliche Modell-Herkunfts-Felder.
|
|||
| `text` | text | Quelltext. |
|
||||
| `target_language` | text | Zielsprache in einfachem Englisch (z.B. `German`, `French`, `ja-JP`). |
|
||||
| `source_language` | text | Optionaler Hinweis auf die Ausgangssprache. Leer = Modell erkennt selbst. |
|
||||
| `endpoint` | text | Ollama-förmiger `/api/chat`-Endpunkt. |
|
||||
| `endpoint` | text | Chat-Endpunkt passend zum gewählten `api` (Ollama `/api/chat`, OpenAI-kompatibel `/v1/chat/completions` — vLLM u. a., Anthropic `/v1/messages`). |
|
||||
| `api` | text | Optionales Wire-Format: `ollama` (Default), `openai`, `anthropic`. |
|
||||
| `model` | text | Modell-ID am Endpunkt (z.B. `qwen2.5:14b`). |
|
||||
| `api_key` | text | Optionaler Bearer-Token für Cloud-Endpunkte. |
|
||||
|
||||
|
|
@ -29,7 +30,7 @@ audit-taugliche Modell-Herkunfts-Felder.
|
|||
| `target_language` | text | Echo der Eingabe. |
|
||||
| `model_endpoint` | text | URL, gegen die übersetzt wurde. |
|
||||
| `model_name` | text | Modell-ID wie an die LLM-API gesendet. |
|
||||
| `model_digest` | text | SHA-256-Digest des bedienenden Ollama-Modells (wenn erreichbar). |
|
||||
| `model_digest` | text | SHA-256-Digest des bedienten Modells — nur bei Ollama, sonst leer. |
|
||||
|
||||
Die drei `model_*`-Ausgaben sind das Audit-Primitiv: jede
|
||||
Übersetzung im Flow-Log lässt sich auch Monate später dem exakten
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue