Skip to content

Commit be739be

Browse files
authored
Bt chat completions (#24)
* BT test fixed (added convertFromString to vector(string)) * clang formatter * Cleaning up headers * llama_bt: Chat Completions action node * black formatter * BT Chat Completion: string tool_choice * Llama_bt: Removed nav2 dependency * LlamaBT: Testing on chat completions node * LlamaBT: messages and tools parsed from json * LlamaBT: better convertFromString typing * Black formatter * Docker builds fixed
1 parent 0dfa1c7 commit be739be

26 files changed

+1602
-111
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.vscode
2-
__pycache__
2+
__pycache__
3+
.cache
4+
compile_commands.json

llama_bt/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(llama_bt)
33

4+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
5+
46
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
57
message(STATUS "Setting build type to Release as none was specified.")
68
set(CMAKE_BUILD_TYPE "Release" CACHE
@@ -67,18 +69,22 @@ endif()
6769
# # Find ament macros and libraries
6870
find_package(ament_cmake REQUIRED)
6971
find_package(${BT_LIB_NAME} REQUIRED)
70-
find_package(nav2_behavior_tree REQUIRED)
7172
find_package(rclcpp REQUIRED)
7273
find_package(rclcpp_action REQUIRED)
7374
find_package(rclcpp_lifecycle REQUIRED)
7475
find_package(llama_msgs REQUIRED)
76+
find_package(llama_ros REQUIRED)
77+
find_package(nlohmann_json REQUIRED)
7578

7679
# ##########
7780
# # Build ##
7881
# ##########
7982
add_library(llama_generate_response_action_bt_node SHARED src/action/generate_response_action.cpp)
8083
list(APPEND plugin_libs llama_generate_response_action_bt_node)
8184

85+
add_library(llama_generate_chat_completions_action_bt_node SHARED src/action/generate_chat_completions_action.cpp)
86+
list(APPEND plugin_libs llama_generate_chat_completions_action_bt_node)
87+
8288
foreach(bt_plugin ${plugin_libs})
8389
target_include_directories(${bt_plugin} PUBLIC
8490
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
@@ -89,8 +95,9 @@ foreach(bt_plugin ${plugin_libs})
8995
rclcpp_action::rclcpp_action
9096
rclcpp_lifecycle::rclcpp_lifecycle
9197
${llama_msgs_TARGETS}
98+
${llama_ros_TARGETS}
9299
)
93-
ament_target_dependencies(${bt_plugin} PUBLIC ${BT_LIB_NAME} nav2_behavior_tree) # TODO(ajtudela): Fix this in jazzy
100+
ament_target_dependencies(${bt_plugin} PUBLIC ${BT_LIB_NAME}) # TODO(ajtudela): Fix this in jazzy
94101
target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT)
95102
endforeach()
96103

@@ -134,11 +141,11 @@ ament_export_include_directories(include/${PROJECT_NAME})
134141
ament_export_libraries()
135142
ament_export_dependencies(
136143
${BT_LIB_NAME}
137-
nav2_behavior_tree
138144
rclcpp
139145
rclcpp_action
140146
rclcpp_lifecycle
141147
llama_msgs
148+
llama_ros
142149
)
143150
ament_export_targets()
144151
ament_package()

0 commit comments

Comments
 (0)