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

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

+ Inheritance diagram for GPTDevice:

Public Member Functions

 GPTDevice ()
 
 GPTDevice (const GPTDevice &)=delete
 
 GPTDevice (GPTDevice &&) noexcept=delete
 
GPTDeviceoperator= (const GPTDevice &)=delete
 
GPTDeviceoperator= (GPTDevice &&) noexcept=delete
 
 ~GPTDevice () override=default
 
bool setPrompt (const std::string &prompt) override
 Performs a question.
 
bool readPrompt (std::string &oPrompt) override
 Retrieves the provided prompt.
 
bool ask (const std::string &question, yarp::dev::LLM_Message &oAnswer) override
 Performs a question.
 
bool getConversation (std::vector< yarp::dev::LLM_Message > &oConversation) override
 Retrieves the whole conversation.
 
bool deleteConversation () noexcept override
 Delete the conversation and clear the system context from any internally stored context.
 
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.
 

Detailed Description

Definition at line 23 of file GPTDevice.h.

Constructor & Destructor Documentation

◆ GPTDevice() [1/3]

GPTDevice::GPTDevice ( )
inline

Definition at line 27 of file GPTDevice.h.

◆ GPTDevice() [2/3]

GPTDevice::GPTDevice ( const GPTDevice )
delete

◆ GPTDevice() [3/3]

GPTDevice::GPTDevice ( GPTDevice &&  )
deletenoexcept

◆ ~GPTDevice()

GPTDevice::~GPTDevice ( )
overridedefault

Member Function Documentation

◆ ask()

bool GPTDevice::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 85 of file GPTDevice.cpp.

◆ close()

bool GPTDevice::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 228 of file GPTDevice.cpp.

◆ deleteConversation()

bool GPTDevice::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 219 of file GPTDevice.cpp.

◆ getConversation()

bool GPTDevice::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 187 of file GPTDevice.cpp.

◆ open()

bool GPTDevice::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 14 of file GPTDevice.cpp.

◆ operator=() [1/2]

GPTDevice & GPTDevice::operator= ( const GPTDevice )
delete

◆ operator=() [2/2]

GPTDevice & GPTDevice::operator= ( GPTDevice &&  )
deletenoexcept

◆ readPrompt()

bool GPTDevice::readPrompt ( std::string &  oPrompt)
overridevirtual

Retrieves the provided prompt.

Parameters
promptthe stored prompt
Returns
true/false

Implements yarp::dev::ILLM.

Definition at line 172 of file GPTDevice.cpp.

◆ setPrompt()

bool GPTDevice::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 148 of file GPTDevice.cpp.


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