YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
GPTDevice_ParamsParser Class Reference

This class is the parameters parser for class GPTDevice. More...

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/opt-modules/yarp-devices-llm/src/devices/GPTDevice/GPTDevice_ParamsParser.h>

+ Inheritance diagram for GPTDevice_ParamsParser:

Classes

struct  parser_version_type
 

Public Member Functions

 GPTDevice_ParamsParser ()
 
 ~GPTDevice_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Public Attributes

const std::string m_device_classname = {"GPTDevice"}
 
const std::string m_device_name = {"GPTDevice"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_api_version_defaultValue = {"2023-07-01-preview"}
 
const std::string m_prompt_file_defaultValue = {""}
 
const std::string m_prompt_context_defaultValue = {"GPTDevice"}
 
const std::string m_function_file_defaultValue = {""}
 
const std::string m_json_context_defaultValue = {"GPTDevice"}
 
std::string m_api_version = {"2023-07-01-preview"}
 
std::string m_prompt_file = {}
 
std::string m_prompt_context = {"GPTDevice"}
 
std::string m_function_file = {}
 
std::string m_json_context = {"GPTDevice"}
 

Detailed Description

This class is the parameters parser for class GPTDevice.

These are the used parameters:

Group name Parameter name Type Units Default Value Required Description Notes
- api_version string - 2023-07-01-preview 0 The openAI APIs version to use -
- prompt_file string - - 0 The file containing the prompt for the LLM -
- prompt_context string - GPTDevice 0 The yarp context from which the prompt file should be loaded -
- function_file string - - 0 The file containing the definitions of the tools for the LLM -
- json_context string - GPTDevice 0 The yarp context from which the function file should be loaded -

The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):

yarpdev --device GPTDevice --api_version 2023-07-01-preview --prompt_file <optional_value> --prompt_context GPTDevice --function_file <optional_value> --json_context GPTDevice
yarpdev --device GPTDevice

Definition at line 45 of file GPTDevice_ParamsParser.h.

Constructor & Destructor Documentation

◆ GPTDevice_ParamsParser()

GPTDevice_ParamsParser::GPTDevice_ParamsParser ( )

Definition at line 23 of file GPTDevice_ParamsParser.cpp.

◆ ~GPTDevice_ParamsParser()

GPTDevice_ParamsParser::~GPTDevice_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getConfiguration()

std::string GPTDevice_ParamsParser::getConfiguration ( ) const
overridevirtual

Return the configuration of the device.

Returns
The configuration of the device, represented in a string format.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 74 of file GPTDevice_ParamsParser.cpp.

◆ getDeviceClassName()

std::string GPTDevice_ParamsParser::getDeviceClassName ( ) const
inlineoverridevirtual

Get the name of the DeviceDriver class.

Returns
A string containing the name of the class.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 77 of file GPTDevice_ParamsParser.h.

◆ getDeviceName()

std::string GPTDevice_ParamsParser::getDeviceName ( ) const
inlineoverridevirtual

Get the name of the device (i.e.

the plugin name).

Returns
A string containing the name of the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 78 of file GPTDevice_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string GPTDevice_ParamsParser::getDocumentationOfDeviceParams ( ) const
overridevirtual

Get the documentation of the DeviceDriver's parameters.

Returns
A string containing the documentation.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 193 of file GPTDevice_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > GPTDevice_ParamsParser::getListOfParams ( ) const
overridevirtual

Return a list of all params used by the device.

Returns
A vector containing the names of parameters used by the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 28 of file GPTDevice_ParamsParser.cpp.

◆ getParamValue()

bool GPTDevice_ParamsParser::getParamValue ( const std::string &  paramName,
std::string &  paramValue 
) const
overridevirtual

Return the value (represented as a string) of the requested parameter.

Returns
True if the requested parameter was succesfully retrieved.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 40 of file GPTDevice_ParamsParser.cpp.

◆ parseParams()

bool GPTDevice_ParamsParser::parseParams ( const yarp::os::Searchable config)
overridevirtual

Parse the DeviceDriver parameters.

Returns
true if the parsing is successful, false otherwise

Implements yarp::dev::IDeviceDriverParams.

Definition at line 84 of file GPTDevice_ParamsParser.cpp.

Member Data Documentation

◆ m_api_version

std::string GPTDevice_ParamsParser::m_api_version = {"2023-07-01-preview"}

Definition at line 70 of file GPTDevice_ParamsParser.h.

◆ m_api_version_defaultValue

const std::string GPTDevice_ParamsParser::m_api_version_defaultValue = {"2023-07-01-preview"}

Definition at line 64 of file GPTDevice_ParamsParser.h.

◆ m_device_classname

const std::string GPTDevice_ParamsParser::m_device_classname = {"GPTDevice"}

Definition at line 52 of file GPTDevice_ParamsParser.h.

◆ m_device_name

const std::string GPTDevice_ParamsParser::m_device_name = {"GPTDevice"}

Definition at line 53 of file GPTDevice_ParamsParser.h.

◆ m_function_file

std::string GPTDevice_ParamsParser::m_function_file = {}

Definition at line 73 of file GPTDevice_ParamsParser.h.

◆ m_function_file_defaultValue

const std::string GPTDevice_ParamsParser::m_function_file_defaultValue = {""}

Definition at line 67 of file GPTDevice_ParamsParser.h.

◆ m_json_context

std::string GPTDevice_ParamsParser::m_json_context = {"GPTDevice"}

Definition at line 74 of file GPTDevice_ParamsParser.h.

◆ m_json_context_defaultValue

const std::string GPTDevice_ParamsParser::m_json_context_defaultValue = {"GPTDevice"}

Definition at line 68 of file GPTDevice_ParamsParser.h.

◆ m_parser_is_strict

bool GPTDevice_ParamsParser::m_parser_is_strict = false

Definition at line 54 of file GPTDevice_ParamsParser.h.

◆ m_parser_version

const parser_version_type GPTDevice_ParamsParser::m_parser_version = {}

Definition at line 60 of file GPTDevice_ParamsParser.h.

◆ m_prompt_context

std::string GPTDevice_ParamsParser::m_prompt_context = {"GPTDevice"}

Definition at line 72 of file GPTDevice_ParamsParser.h.

◆ m_prompt_context_defaultValue

const std::string GPTDevice_ParamsParser::m_prompt_context_defaultValue = {"GPTDevice"}

Definition at line 66 of file GPTDevice_ParamsParser.h.

◆ m_prompt_file

std::string GPTDevice_ParamsParser::m_prompt_file = {}

Definition at line 71 of file GPTDevice_ParamsParser.h.

◆ m_prompt_file_defaultValue

const std::string GPTDevice_ParamsParser::m_prompt_file_defaultValue = {""}

Definition at line 65 of file GPTDevice_ParamsParser.h.

◆ m_provided_configuration

std::string GPTDevice_ParamsParser::m_provided_configuration

Definition at line 62 of file GPTDevice_ParamsParser.h.


The documentation for this class was generated from the following files: