feat: add AI endpoint manager plugin with configuration and routing capabilities
Some checks failed
Some checks failed
- Introduced `ai_endpoint_mgr` plugin to manage multiple AI provider endpoints. - Added configuration reference documentation for `config.toml`. - Implemented endpoint loading, active endpoint switching, and model mutation. - Included error handling for missing endpoints and configuration failures. - Developed unit tests covering various scenarios including error paths and concurrency.
This commit is contained in:
@@ -145,6 +145,8 @@ target_compile_definitions(dstalk_anthropic_plugin_test
|
||||
BOOST_ALL_NO_LIB
|
||||
)
|
||||
|
||||
find_package(Boost REQUIRED CONFIG)
|
||||
|
||||
target_link_libraries(dstalk_anthropic_plugin_test
|
||||
PRIVATE
|
||||
dstalk
|
||||
@@ -174,6 +176,8 @@ target_compile_definitions(dstalk_openai_plugin_test
|
||||
BOOST_ALL_NO_LIB
|
||||
)
|
||||
|
||||
find_package(Boost REQUIRED CONFIG)
|
||||
|
||||
target_link_libraries(dstalk_openai_plugin_test
|
||||
PRIVATE
|
||||
dstalk
|
||||
@@ -183,6 +187,37 @@ target_link_libraries(dstalk_openai_plugin_test
|
||||
|
||||
add_test(NAME dstalk_openai_plugin_test COMMAND dstalk_openai_plugin_test)
|
||||
|
||||
# ============================================================
|
||||
# dstalk_endpoint_mgr_plugin_test — AI endpoint manager 插件单元测试
|
||||
# 覆盖: endpoint 加载/列表脱敏/active/model 修改/路由
|
||||
# ============================================================
|
||||
|
||||
add_executable(dstalk_endpoint_mgr_plugin_test
|
||||
endpoint_mgr_plugin_test.cpp
|
||||
)
|
||||
|
||||
target_include_directories(dstalk_endpoint_mgr_plugin_test
|
||||
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk_core/include
|
||||
PRIVATE ${CMAKE_SOURCE_DIR}/plugins_upper/ai_common/include
|
||||
)
|
||||
|
||||
target_compile_definitions(dstalk_endpoint_mgr_plugin_test
|
||||
PRIVATE
|
||||
BOOST_JSON_HEADER_ONLY
|
||||
BOOST_ALL_NO_LIB
|
||||
)
|
||||
|
||||
find_package(Boost REQUIRED CONFIG)
|
||||
|
||||
target_link_libraries(dstalk_endpoint_mgr_plugin_test
|
||||
PRIVATE
|
||||
dstalk
|
||||
ai_common
|
||||
boost::boost
|
||||
)
|
||||
|
||||
add_test(NAME dstalk_endpoint_mgr_plugin_test COMMAND dstalk_endpoint_mgr_plugin_test)
|
||||
|
||||
# ============================================================
|
||||
# dstalk_network_plugin_test — Network 插件单元测试
|
||||
# W22.2 (qa-xu): 通过 #include source 访问 static 函数
|
||||
@@ -203,6 +238,8 @@ target_compile_definitions(dstalk_network_plugin_test
|
||||
BOOST_ALL_NO_LIB
|
||||
)
|
||||
|
||||
find_package(Boost REQUIRED CONFIG)
|
||||
|
||||
target_link_libraries(dstalk_network_plugin_test
|
||||
PRIVATE
|
||||
dstalk
|
||||
@@ -238,6 +275,8 @@ target_compile_features(dstalk_lsp_plugin_test
|
||||
PRIVATE cxx_std_17
|
||||
)
|
||||
|
||||
find_package(Boost REQUIRED CONFIG)
|
||||
|
||||
target_link_libraries(dstalk_lsp_plugin_test
|
||||
PRIVATE
|
||||
dstalk
|
||||
|
||||
Reference in New Issue
Block a user