You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main service interface for sending prompts and receiving responses is prompt/prompt, using the Prompt.srv definition. prompt_bridge can load multiple prompt providers concurrently and dispatch each request by model_family.
True if the response is buffered (not final, e.g., when caching).
success
bool
True if the prompt was processed successfully.
accuracy
float64
(Optional) Accuracy metric (if provided by model).
confidence
float64
(Optional) Confidence metric.
risk
float64
(Optional) Risk metric.
How to Use the Service
1. Single prompt (stateless)
Set uuid to empty string.
Set use_cache and use_chat_mode to false in the prompt.
The response is processed immediately.
The returned uuid is empty.
2. Chat mode (multi-turn conversation)
Set use_chat_mode to true in the prompt.
For a new conversation, set uuid to empty string. The response will include a new uuid for the session.
For follow-up prompts, set uuid to the previous response's uuid to continue the conversation.
When use_cache is false, each request is sent immediately and both user and assistant turns are appended to the stored conversation.
3. Prompt caching
In chat mode, use_cache=true and flush_cache=false buffers the prompt and returns response.buffered=true with a uuid.
In chat mode, use_cache=true and flush_cache=true sends the current prompt together with the stored conversation and returns the same uuid.
In non-chat mode, use_cache=true and flush_cache=false aggregates user text under a generated uuid.
In non-chat mode, use_cache=true and flush_cache=true processes the aggregated cache and intentionally clears the returned uuid because the request is treated as a one-shot prompt after flush.
4. Model selection and options
Set model_family to select the provider/plugin (e.g., openai, ollama).
Use the options array to specify model-specific parameters (see plugin_parameters.md).
Example Request (YAML)
uuid: ""prompt:
prompt: "What is the capital of France?"use_cache: falseflush_cache: falseuse_chat_mode: falsemodel_family: "openai"options:
- key: modelvalue: gpt-5type: str
Extending
To add a new Online Prompt provider, implement a plugin inheriting from prompt::PromptBaseClass and register it. Add its configuration to your YAML file and list it in prompt_family_names and prompt_family_plugins.
Notes
The service is designed to support both stateless and conversational (chat) interactions.
Use the uuid field to manage sessions for chat or caching.
response.buffered is set by prompt_bridge to indicate whether the request was buffered instead of sent to the provider.
New chat conversations always receive a generated uuid, even when the first request is processed immediately.