Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/i chat bot interface #3019

Merged
merged 12 commits into from
Sep 18, 2023
11 changes: 11 additions & 0 deletions doc/release/yarp_3_9_master/feature_device_iChatBot_interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
feature_device_iChatBot_interface {#master}
---------------

### Devices - libYARP_dev

#### `IChatBot`

* Added a `yarp` `interface` to interact with chatbots. It allows to send messages and receive answers and to manage the bot language.

* This does not features "implementation-specific" functionalities that could benefit the user but are not universally available among the various chatbot that can be found online. The idea is to open new PR in the future with new interfaces derived from `yarp::dev::IChatBot` that will model different "classes" of
chatbots (an example on how chatbots can be classified, can be found in this article: [A critical review of state-of-the-art chatbot designs and applications](https://doi.org/10.1002/widm.1434))
4 changes: 4 additions & 0 deletions src/devices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ yarp_begin_plugin_library(yarpmod
add_subdirectory(openNI2DepthCamera)
add_subdirectory(fakeDepthCamera)
add_subdirectory(fakebot)
add_subdirectory(fakeChatBotDevice)
add_subdirectory(fakeMotionControl)
add_subdirectory(fakeAnalogSensor)
add_subdirectory(fakeBattery)
Expand All @@ -46,6 +47,7 @@ yarp_begin_plugin_library(yarpmod
add_subdirectory(portaudioPlayer)
add_subdirectory(portaudioRecorder)
add_subdirectory(imuBosch_BNO055)
add_subdirectory(IChatBotMsgs)
add_subdirectory(ILLMMsgs)
add_subdirectory(IAudioGrabberMsgs)
add_subdirectory(IMap2DMsgs)
Expand All @@ -68,6 +70,8 @@ yarp_begin_plugin_library(yarpmod
add_subdirectory(SDLJoypad)
add_subdirectory(battery_nwc_yarp)
add_subdirectory(battery_nws_yarp)
add_subdirectory(chatBot_nwc_yarp)
add_subdirectory(chatBot_nws_yarp)
add_subdirectory(upowerBattery)
add_subdirectory(Rangefinder2D_nws_yarp)
add_subdirectory(Rangefinder2D_nwc_yarp)
Expand Down
24 changes: 24 additions & 0 deletions src/devices/IChatBotMsgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause

if(NOT YARP_COMPILE_DEVICE_PLUGINS)
return()
endif()

include(YarpChooseIDL)
yarp_choose_idl(ICHATBOTMSGS_THRIFT IChatBotMsgs.thrift)

add_library(IChatBotMsgs OBJECT)

target_sources(IChatBotMsgs PRIVATE ${ICHATBOTMSGS_THRIFT_GEN_FILES})

target_link_libraries(IChatBotMsgs
PRIVATE
YARP::YARP_dev
YARP::YARP_os
YARP::YARP_sig
)

target_include_directories(IChatBotMsgs PUBLIC ${ICHATBOTMSGS_THRIFT_BUILD_INTERFACE_INCLUDE_DIRS})

set_property(TARGET IChatBotMsgs PROPERTY FOLDER "Devices/Shared")
21 changes: 21 additions & 0 deletions src/devices/IChatBotMsgs/IChatBotMsgs.thrift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
* SPDX-License-Identifier: BSD-3-Clause
*/

struct return_interact{
1: bool result;
2: string messageOut;
}

struct return_getLanguage{
1: bool result;
2: string language;
}

service IChatBotMsgs {
return_interact interactRPC(1: string messageIn);
bool setLanguageRPC(1: string language);
return_getLanguage getLanguageRPC();
bool resetBotRPC();
}
Loading