|
Prompt Tools 0.3.2
|
PromptProviderBase. More...
#include <base_class.hpp>

Public Member Functions | |
| BaseClass ()=default | |
| virtual | ~BaseClass ()=default |
| virtual void | initialize (rclcpp::Node::SharedPtr node)=0 |
| Initialize the prompt pligin. | |
| virtual prompt::EmbedResponse | get_embeddings (prompt::EmbedRequest &req) |
| get_embeddings sends a text to an embedding provider using REST | |
| virtual prompt::TokenResponse | get_tokens (prompt::TokenRequest &req) |
| get_tokens sends a text to a token provider | |
| virtual prompt::PromptResponse | sendPrompt (prompt::PromptRequest &req) |
| Send a prompt to the prompt plugin. | |
| virtual prompt::PromptResponse | sendConversation (prompt::PromptRequest &latest_request, std::vector< PromptDialogue > &conversation) |
| Send a prompt to the prompt plugin. | |
Protected Member Functions | |
| virtual void | initialize_base (rclcpp::Node::SharedPtr node, std::string plugin_name="BaseClass") |
| Initialize the prompt base class. | |
Protected Attributes | |
| rclcpp::Node::SharedPtr | node_ |
| Node shared pointer. | |
| std::string | plugin_name_ |
| Plugin name. | |
PromptProviderBase.
This is the base class for prompt plugins it provides a common interface for all prompt plugins where the main functions are to send a prompt and recieve a response
|
default |
|
virtualdefault |
|
inlinevirtual |
get_embeddings sends a text to an embedding provider using REST
| req | The embed request containing the text and options. |
Reimplemented in prompt::EmbedBaseClass.
|
inlinevirtual |
get_tokens sends a text to a token provider
| req | The token request containing the text and options. |
Reimplemented in prompt::TokenizeBaseClass.
|
pure virtual |
Initialize the prompt pligin.
This method initializes the prompt plugin with parameters from the ROS parameter server.
| node | rclcpp::Node::SharedPtr ROS node |
Implemented in prompt::OllamaProvider, prompt::OpenAIEmbedding, prompt::OpenAIProvider, and prompt::OpenAITokenize.
|
inlineprotectedvirtual |
Initialize the prompt base class.
This method initializes the baseclass with parameters from the ROS parameter server.
| node | rclcpp::Node::SharedPtr ROS node |
|
inlinevirtual |
Send a prompt to the prompt plugin.
This method sends a prompt request to the prompt plugin and returns a response.
| latest_request | The prompt request containing the prompt and options. |
| conversation | The conversation history for context. |
| prompt::PromptException | if the method is not implemented in the derived class. |
Reimplemented in prompt::PromptBaseClass.
|
inlinevirtual |
Send a prompt to the prompt plugin.
This method sends a prompt request to the prompt plugin and returns a response.
| req | The prompt request containing the prompt and options. |
| prompt::PromptException | if the method is not implemented in the derived class. |
Reimplemented in prompt::PromptBaseClass.
|
protected |
Node shared pointer.
This is the shared pointer to the ROS node used by the prompt plugin.
|
protected |
Plugin name.
This is the name of the prompt plugin.