#include <openai_driver.hpp>
|
| static std::string | trim_copy (const std::string &text) |
| |
| static size_t | count_words (const std::string &text) |
| |
| static std::vector< std::string > | split_long_segment (const std::string &segment, size_t max_words) |
| |
| static std::string | build_http_error_message (long http_code, const std::string &response_data) |
| |
| static size_t | write_callback (void *contents, size_t size, size_t nmemb, std::string *userp) |
| |
◆ OpenAISpeechDriver()
| fp_perception::OpenAISpeechDriver::OpenAISpeechDriver |
( |
| ) |
|
|
inline |
Construct a new OpenAI Speech Driver object.
◆ ~OpenAISpeechDriver()
| fp_perception::OpenAISpeechDriver::~OpenAISpeechDriver |
( |
| ) |
|
|
inlineoverride |
Destroy the OpenAI Speech Driver object.
◆ count_words()
| static size_t fp_perception::OpenAISpeechDriver::count_words |
( |
const std::string & |
text | ) |
|
|
inlinestaticprotected |
◆ deinitialize()
| void fp_perception::OpenAISpeechDriver::deinitialize |
( |
| ) |
|
|
inlineoverridevirtual |
Deinitialize the driver.
Required by DriverBase. This driver holds no long-running resources beyond cached state and the ROS node pointer.
Implements fp_perception::DriverBase.
◆ fromJson()
◆ initialize()
| void fp_perception::OpenAISpeechDriver::initialize |
( |
const rclcpp::Node::SharedPtr & |
node | ) |
|
|
inlineoverridevirtual |
Initialize the driver.
This function should be overridden in derived classes to provide specific initialization.
- Parameters
-
| node | Shared pointer to the ROS node |
Reimplemented from fp_perception::DriverBase.
◆ produce_diagnostics()
| void fp_perception::OpenAISpeechDriver::produce_diagnostics |
( |
diagnostic_updater::DiagnosticStatusWrapper & |
status | ) |
|
|
inlineprotected |
◆ resolve_instructions()
| std::string fp_perception::OpenAISpeechDriver::resolve_instructions |
( |
const text_data & |
new_text | ) |
const |
|
inlineprotected |
◆ resolve_voice()
| std::string fp_perception::OpenAISpeechDriver::resolve_voice |
( |
const text_data & |
new_text | ) |
const |
|
inlineprotected |
◆ split_long_segment()
| static std::vector< std::string > fp_perception::OpenAISpeechDriver::split_long_segment |
( |
const std::string & |
segment, |
|
|
size_t |
max_words |
|
) |
| |
|
inlinestaticprotected |
◆ split_text_into_chunks()
| std::vector< std::string > fp_perception::OpenAISpeechDriver::split_text_into_chunks |
( |
const std::string & |
text | ) |
const |
|
inlineprotected |
◆ synthesize()
◆ synthesize_chunk()
| fp_perception::RESTResponse fp_perception::OpenAISpeechDriver::synthesize_chunk |
( |
const std::string & |
chunk, |
|
|
const std::string & |
voice, |
|
|
const std::string & |
instructions |
|
) |
| |
|
inlineprotected |
◆ test()
| void fp_perception::OpenAISpeechDriver::test |
( |
| ) |
|
|
inlineoverridevirtual |
Test method for the driver.
This function can be overridden in derived classes to implement specific test logic.
Reimplemented from fp_perception::DriverBase.
◆ toJson()
Convert a prompt request to a JSON object.
This method converts the fp_perception request to a JSON object that can be sent to the fp_perception plugin. It includes the prompt text and options for the JSON object.
- Parameters
-
- Returns
- A JSON object representing the prompt request
Implements fp_perception::RestBase.
◆ trim_copy()
| static std::string fp_perception::OpenAISpeechDriver::trim_copy |
( |
const std::string & |
text | ) |
|
|
inlinestaticprotected |
◆ chunk_max_words_
| size_t fp_perception::OpenAISpeechDriver::chunk_max_words_ = 200 |
|
protected |
◆ chunk_parallel_requests_
| size_t fp_perception::OpenAISpeechDriver::chunk_parallel_requests_ = 3 |
|
protected |
◆ chunking_enabled_
| bool fp_perception::OpenAISpeechDriver::chunking_enabled_ = true |
|
protected |
◆ instructions_
| std::string fp_perception::OpenAISpeechDriver::instructions_ |
|
protected |
◆ last_audio_
| audio_data fp_perception::OpenAISpeechDriver::last_audio_ |
|
protected |
◆ model_name_
| std::string fp_perception::OpenAISpeechDriver::model_name_ |
|
protected |
◆ response_
◆ test_file_path_
| std::string fp_perception::OpenAISpeechDriver::test_file_path_ = "test_audio.wav" |
|
protected |
◆ test_text_
| std::string fp_perception::OpenAISpeechDriver::test_text_ |
|
protected |
◆ voice_
| std::string fp_perception::OpenAISpeechDriver::voice_ |
|
protected |
The documentation for this class was generated from the following file: