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

query

string

The query for the large language model, e.g. a question or an instruction.

system_prompt

string

Instructions setting the model’s role and response style. If empty, the LLM server uses its default system prompt.

max_tokens

uint32

Maximum number of tokens to generate for the reply. If 0, the LLM server uses its default limit.

Result#

Field

Type

Description

status_code

int8

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.

reply

string

The LLM’s reply to the query.

Feedback#

Field

Type

Description

partial_reply

string

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#

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