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>
11#include <vector>
14
26{
27
28public:
29 FakeLLMDevice() : m_conversation{} {}
30 yarp::dev::ReturnValue setPrompt(const std::string &prompt) override;
31 yarp::dev::ReturnValue readPrompt(std::string &oPromp) override;
32 yarp::dev::ReturnValue ask(const std::string &question, yarp::dev::LLM_Message &oAnswer) override;
33 yarp::dev::ReturnValue getConversation(std::vector<yarp::dev::LLM_Message> &oConversation) override;
35 yarp::dev::ReturnValue refreshConversation() noexcept override;
36
37 bool open(yarp::os::Searchable& config) override;
38 bool close() override;
39
40private:
41 std::vector<yarp::dev::LLM_Message> m_conversation;
42};
43
44#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