3#include <prompt_msgs/msg/model_option.hpp>
4#include <prompt_msgs/msg/embed.hpp>
5#include <prompt_msgs/msg/embed_response.hpp>
6#include <prompt_msgs/msg/prompt.hpp>
7#include <prompt_msgs/msg/prompt_response.hpp>
8#include <prompt_msgs/msg/token.hpp>
9#include <prompt_msgs/msg/token_response.hpp>
31 for (
const auto& option :
prompt.options)
49 result.
text = input.text;
52 for (
const auto& option : input.options)
70 result.
text = input.text;
71 result.
tokens = input.tokens;
72 result.
encode = input.encode;
75 for (
const auto& option : input.options)
92 prompt_msgs::msg::PromptResponse result;
98 result.risk = res.
risk;
111 prompt_msgs::msg::EmbedResponse result;
115 prompt_msgs::msg::Embedding embedding_msg;
118 embedding_msg.float_embedding = emb.float_embedding;
122 embedding_msg.base64_embedding = emb.base64_embedding;
124 embedding_msg.is_float = emb.is_float;
125 embedding_msg.index = emb.index;
126 result.embeddings.push_back(embedding_msg);
130 result.error = res.
error;
131 result.model = res.
model;
147 prompt_msgs::msg::TokenResponse result;
148 result.tokens = res.
tokens;
149 result.text = res.
text;
151 result.error = res.
error;
Definition base_class.hpp:8
static const prompt::PromptRequest fromMsg(const prompt_msgs::msg::Prompt &prompt)
Converts prompt_msgs::msg::Prompt into prompt::PromptRequest which is used internally in prompt tools...
Definition conversions.hpp:21
static const prompt_msgs::msg::PromptResponse toMsg(const prompt::PromptResponse &res)
Converts prompt::PromptResponse into prompt_msgs::msg::PromptResponse which is used in ros2 eco syste...
Definition conversions.hpp:90
Definition structs.hpp:46
std::string model_family
Definition structs.hpp:48
std::vector< PromptOption > options
Definition structs.hpp:49
std::string text
Definition structs.hpp:47
Definition structs.hpp:61
bool success
Definition structs.hpp:63
std::vector< Embedding > embeddings
Definition structs.hpp:62
std::string model
Definition structs.hpp:65
int prompt_tokens
Definition structs.hpp:66
int total_tokens
Definition structs.hpp:67
std::string error
Definition structs.hpp:64
std::string key
Definition structs.hpp:10
Definition structs.hpp:24
bool use_chat_mode
Definition structs.hpp:28
std::string prompt
Definition structs.hpp:25
bool flush_cache
Definition structs.hpp:27
bool use_cache
Definition structs.hpp:26
std::string model_family
Definition structs.hpp:29
std::vector< PromptOption > options
Definition structs.hpp:30
Definition structs.hpp:35
bool success
Definition structs.hpp:39
double accuracy
Definition structs.hpp:40
bool buffered
Definition structs.hpp:37
std::string response
Definition structs.hpp:36
double risk
Definition structs.hpp:42
double confidence
Definition structs.hpp:41
Definition structs.hpp:71
std::string text
Definition structs.hpp:72
std::vector< PromptOption > options
Definition structs.hpp:76
std::string model_family
Definition structs.hpp:75
bool encode
Definition structs.hpp:74
std::vector< int > tokens
Definition structs.hpp:73
Definition structs.hpp:80
std::vector< int > tokens
Definition structs.hpp:81
bool success
Definition structs.hpp:83
std::string error
Definition structs.hpp:84
std::string text
Definition structs.hpp:82