QueryLLM#
- Kind:
Action
- ROS type:
interfaces/action/QueryLLM- Python:
from interfaces.action import QueryLLM- C++:
#include "interfaces/action/query_llm.hpp"
Goal#
Field |
Type |
Description |
|---|---|---|
|
|
The query for the large language model, e.g. a question or an instruction. |
|
|
Instructions setting the model’s role and response style. If empty, the LLM server uses its default system prompt. |
|
|
Maximum number of tokens to generate for the reply. If 0, the LLM server uses its default limit. |
Result#
Field |
Type |
Description |
|---|---|---|
|
|
One of the values in StatusCode:
|
|
|
The LLM’s reply to the query. |
Feedback#
Field |
Type |
Description |
|---|---|---|
|
|
The reply generated so far. Each feedback message contains the whole partial reply, not just the text added since the previous one, so no text is lost if a feedback message is dropped. |
Used on#
/query_llm (action): served by Language model (
llm_node).
Definition
# Request
# The query for the large language model, e.g. a question or an instruction.
string query
# Instructions setting the model's role and response style.
# If empty, the LLM server uses its default system prompt.
string system_prompt
# Maximum number of tokens to generate for the reply.
# If 0, the LLM server uses its default limit.
uint32 max_tokens
---
# Result
# One of the values in StatusCode:
# SUCCESS: the reply is complete.
# ERROR_MALFORMED: the query is empty or does not fit in the model's context.
# ERROR_OVERFLOW: generation stopped at the token limit; the reply is truncated.
# ERROR_ABORTED: the goal was canceled; the reply contains the text generated until then.
# ERROR_UNAVAILABLE: the model failed while generating the reply.
# ERROR_IN_USE: another query is in progress; the reply is empty.
int8 status_code
# The LLM's reply to the query.
string reply
---
# Feedback
# The reply generated so far. Each feedback message contains the whole partial reply,
# not just the text added since the previous one, so no text is lost if a feedback
# message is dropped.
string partial_reply