YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ILLMServerImpl.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
7#include <yarp/os/Bottle.h>
8#include <yarp/dev/ILLM.h>
10
12{
13private:
14 yarp::dev::ILLM* m_iLlm = nullptr;
15
16 // The conversation is streamed on a yarp port
18 void m_stream_conversation();
19
20public:
21
22 void setInterface(yarp::dev::ILLM* _iLlm, const std::string& streaming_port_name)
23 {
24 m_iLlm = _iLlm;
25 m_streaming_port.open(streaming_port_name);
26 }
28 {
29 m_iLlm = nullptr;
30 m_streaming_port.close();
31 }
32 // From IGPTMsgs
33 yarp::dev::ReturnValue setPrompt(const std::string& prompt) override;
35 yarp::dev::llm::return_ask ask(const std::string& question) override;
39};
void setInterface(yarp::dev::ILLM *_iLlm, const std::string &streaming_port_name)
yarp::dev::ReturnValue setPrompt(const std::string &prompt) override
yarp::dev::llm::return_ask ask(const std::string &question) override
yarp::dev::ReturnValue refreshConversation() override
yarp::dev::llm::return_getConversation getConversation() override
yarp::dev::ReturnValue deleteConversation() override
void unsetInterface()
yarp::dev::llm::return_readPrompt readPrompt() override
ILLM interface.
Definition ILLM.h:26
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.