YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

fakeLLMDevice : a fake device which implements the ILLM interface for testing purposes. More...

#include <fake/fakeLLMDevice/FakeLLMDevice.h>

+ Inheritance diagram for FakeLLMDevice:

Public Member Functions

 FakeLLMDevice ()
 
yarp::dev::ReturnValue setPrompt (const std::string &prompt) override
 Performs a question.
 
yarp::dev::ReturnValue readPrompt (std::string &oPromp) override
 Retrieves the provided prompt.
 
yarp::dev::ReturnValue ask (const std::string &question, yarp::dev::LLM_Message &oAnswer) override
 Performs a question.
 
yarp::dev::ReturnValue getConversation (std::vector< yarp::dev::LLM_Message > &oConversation) override
 Retrieves the whole conversation.
 
yarp::dev::ReturnValue deleteConversation () noexcept override
 Delete the conversation and clear the system context from any internally stored context.
 
yarp::dev::ReturnValue refreshConversation () noexcept override
 Refresh the conversation.
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
- Public Member Functions inherited from yarp::dev::ILLM
virtual ~ILLM ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from FakeLLMDevice_ParamsParser
 FakeLLMDevice_ParamsParser ()
 
 ~FakeLLMDevice_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.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Additional Inherited Members

- Public Attributes inherited from FakeLLMDevice_ParamsParser
const std::string m_device_classname = {"FakeLLMDevice"}
 
const std::string m_device_name = {"fakeLLMDevice"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_initial_prompt_defaultValue = {""}
 
std::string m_initial_prompt = {}
 

Detailed Description

fakeLLMDevice : a fake device which implements the ILLM interface for testing purposes.

Parameters required by this device are shown in class: FakeLLMDevice_ParamsParser

Definition at line 22 of file FakeLLMDevice.h.

Constructor & Destructor Documentation

◆ FakeLLMDevice()

FakeLLMDevice::FakeLLMDevice ( )
inline

Definition at line 28 of file FakeLLMDevice.h.

Member Function Documentation

◆ ask()

ReturnValue FakeLLMDevice::ask ( const std::string &  question,
yarp::dev::LLM_Message answer 
)
overridevirtual

Performs a question.

Parameters
questionthe text of the question provided by the user
answerthe returned answer
Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 38 of file FakeLLMDevice.cpp.

◆ close()

bool FakeLLMDevice::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 100 of file FakeLLMDevice.cpp.

◆ deleteConversation()

ReturnValue FakeLLMDevice::deleteConversation ( )
overridevirtualnoexcept

Delete the conversation and clear the system context from any internally stored context.

Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 66 of file FakeLLMDevice.cpp.

◆ getConversation()

ReturnValue FakeLLMDevice::getConversation ( std::vector< yarp::dev::LLM_Message > &  conversation)
overridevirtual

Retrieves the whole conversation.

Parameters
conversationthe conversation
Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 60 of file FakeLLMDevice.cpp.

◆ open()

bool FakeLLMDevice::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 94 of file FakeLLMDevice.cpp.

◆ readPrompt()

ReturnValue FakeLLMDevice::readPrompt ( std::string &  oPrompt)
overridevirtual

Retrieves the provided prompt.

Parameters
promptthe stored prompt
Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 24 of file FakeLLMDevice.cpp.

◆ refreshConversation()

ReturnValue FakeLLMDevice::refreshConversation ( )
overridevirtualnoexcept

Refresh the conversation.

Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 72 of file FakeLLMDevice.cpp.

◆ setPrompt()

ReturnValue FakeLLMDevice::setPrompt ( const std::string &  prompt)
overridevirtual

Performs a question.

Parameters
promptprovides a prompt to the LLM
Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 12 of file FakeLLMDevice.cpp.


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