YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeLLMDevice.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef FAKE_LLMDEVICE_H
7#define FAKE_LLMDEVICE_H
8
9#include <yarp/dev/ILLM.h>
10#include <vector>
13
25{
26
27public:
28 FakeLLMDevice() : m_conversation{} {}
29 yarp::dev::ReturnValue setPrompt(const std::string &prompt) override;
30 yarp::dev::ReturnValue readPrompt(std::string &oPromp) override;
31 yarp::dev::ReturnValue ask(const std::string &question, yarp::dev::LLM_Message &oAnswer) override;
32 yarp::dev::ReturnValue getConversation(std::vector<yarp::dev::LLM_Message> &oConversation) override;
34 yarp::dev::ReturnValue refreshConversation() noexcept override;
35
36 bool open(yarp::os::Searchable& config) override;
37 bool close() override;
38
39private:
40 std::vector<yarp::dev::LLM_Message> m_conversation;
41};
42
43#endif
This class is the parameters parser for class FakeLLMDevice.
fakeLLMDevice : a fake device which implements the ILLM interface for testing purposes.
yarp::dev::ReturnValue getConversation(std::vector< yarp::dev::LLM_Message > &oConversation) override
Retrieves the whole conversation.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue ask(const std::string &question, yarp::dev::LLM_Message &oAnswer) override
Performs a question.
yarp::dev::ReturnValue refreshConversation() noexcept override
Refresh the conversation.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue deleteConversation() noexcept override
Delete the conversation and clear the system context from any internally stored context.
yarp::dev::ReturnValue setPrompt(const std::string &prompt) override
Performs a question.
yarp::dev::ReturnValue readPrompt(std::string &oPromp) override
Retrieves the provided prompt.
Interface implemented by all device drivers.
ILLM interface.
Definition ILLM.h:26
STL namespace.
The main, catch-all namespace for YARP.
Definition dirs.h:16