diff --git a/CHANGELOG.md b/CHANGELOG.md index 52cae5c..209f37c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.0 + +- add multi agent supported + ## 0.3.1 - Add Dockerfile diff --git a/README-zh_CN.md b/README-zh_CN.md index 080ff2e..f9927da 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -59,45 +59,46 @@ - 请求参数: - 大模型设置:大模型的链接、key、模型名称 - 预置提示词:角色、能力、目标描述 - - 能力细节描述:openapi、openmodbus文档描述。其中apiKey根据实际需要可选填写 + - 能力细节描述:(可选)openapi、openrpc、openmodbus文档描述。其中apiKey根据实际需要可选填写 + - Session列表:(可选)对多Agent做支持。先初始化其他Agent,获得SessionId后,传入这个字段。 - 超时时间:默认3600秒,停止交互后,超过时间则清空上下文 - - 请求样例 - ```json - { - "llmConfig": { - "baseUrl": "<大模型厂商的api入口,例如:https://api.openai.com/v1>", - "apiKey": "<大模型厂商的api的Key,例如:sk-xxxxxxxxxx>", - "model": "<厂商支持的大模型名称,例如:gpt-3.5-turbo,下方的temperature、maxTokens、topP可选传入,下方为默认值>", - "temperature": 0, - "maxTokens": 4096, - "topP": 1 +- 请求样例 + ```json + { + "llmConfig": { + "baseUrl": "<大模型厂商的api入口,例如:https://api.openai.com/v1>", + "apiKey": "<大模型厂商的api的Key,例如:sk-xxxxxxxxxx>", + "model": "<厂商支持的大模型名称,例如:gpt-3.5-turbo,下方的temperature、maxTokens、topP可选传入,下方为默认值>", + "temperature": 0, + "maxTokens": 4096, + "topP": 1 + }, + "systemPrompt": "<预置的系统提示词,例如扮演什么角色,具有什么能力,需要帮助用户解决哪一类的问题>", + "openSpecList": [ + { + "openSpec": "<(可选)spec的json描述文本,目前支持的类型是openapi、openmodbus、openrpc>", + "apiKey": { + "type": "", + "apiKey": "<第三方服务的apiKey>" }, - "systemPrompt": "<预置的系统提示词,例如扮演什么角色,具有什么能力,需要帮助用户解决哪一类的问题>", - "openSpecList": [ - { - "openSpec": "<(可选)spec的json描述文本,目前支持的类型是openapi、openmodbus、openrpc>", - "apiKey": { - "type": "", - "apiKey": "<第三方服务的apiKey>" - }, - "protocol": "目前支持openapi、openmodbus、jsonrpcHttp" - }, - { - "openSpec": "<(可选)另一段spec的json描述,可以不同类型混用>", - "protocol": "目前支持openapi、openmodbus、jsonrpcHttp" - } - ], - "sessionList": [ - { - "id": "" - }, - { - "id": "" - } - ], - "timeoutSeconds": 3600 - } - ``` + "protocol": "目前支持openapi、openmodbus、jsonrpcHttp" + }, + { + "openSpec": "<(可选)另一段spec的json描述,可以不同类型混用>", + "protocol": "目前支持openapi、openmodbus、jsonrpcHttp" + } + ], + "sessionList": [ + { + "id": "" + }, + { + "id": "" + } + ], + "timeoutSeconds": 3600 + } + ``` - 返回: - sessionId,用以后续对于该session的消息订阅、stop、clear操作 diff --git a/README.md b/README.md index 9c1035d..5e04d18 100644 --- a/README.md +++ b/README.md @@ -59,45 +59,46 @@ LLM `AI Agent` multi session HTTP/WebSocket service - Request body: - LLM config: baseUrl, apiKey, model - System Prompt: Agent character, ToDo/NotToDo description - - Tools Description: openapi、openmodbus Spec. According to third APIs in Spec to set `apiKey` or net + - Tools Description: (Optional) openapi, openrpc, openmodbus Spec. According to third APIs in Spec to set `apiKey` or net + - Session List: (Optional) for multi agents supported. Init other agents, and add their sessionIds in this field. - Timeout:3600 seconds in default. When agent stopped, massages context will be clear - - Sample: - ```json - { - "llmConfig": { - "baseUrl": "", - "apiKey": "", - "model": "", - "temperature": 0, - "maxTokens": 4096, - "topP": 1 - }, - "systemPrompt": "", - "openSpecList": [ - { - "openSpec": "<(Optional) tool spec json string, support openapi、openmodbus、openrpc>", - "apiKey": { - "type": "", - "apiKey": "" - }, - "protocol": "Support openapi, openmodbus, jsonrpcHttp" - }, - { - "openSpec": "<(Optional) Another spec json string, can be another protocol>", - "protocol": "Support openapi, openmodbus, jsonrpcHttp" - } - ], - "sessionList": [ - { - "id": "" - }, - { - "id": "" - } - ], - "timeoutSeconds": 3600 - } - ``` + - Sample: + ```json + { + "llmConfig": { + "baseUrl": "", + "apiKey": "", + "model": "", + "temperature": 0, + "maxTokens": 4096, + "topP": 1 + }, + "systemPrompt": "", + "openSpecList": [ + { + "openSpec": "<(Optional) tool spec json string, support openapi、openmodbus、openrpc>", + "apiKey": { + "type": "", + "apiKey": "" + }, + "protocol": "Support openapi, openmodbus, jsonrpcHttp" + }, + { + "openSpec": "<(Optional) Another spec json string, can be another protocol>", + "protocol": "Support openapi, openmodbus, jsonrpcHttp" + } + ], + "sessionList": [ + { + "id": "" + }, + { + "id": "" + } + ], + "timeoutSeconds": 3600 + } + ``` - Response body: - sessionId, will be used as session websocket subscribe, stop and clear operations. diff --git a/example/multi_agent_example.dart b/example/multi_agent_example.dart index 6d85601..ef793c4 100644 --- a/example/multi_agent_example.dart +++ b/example/multi_agent_example.dart @@ -33,11 +33,11 @@ Future main() async { return; } - CapabilityDto capabilityDto = CapabilityDto(llmConfig: llmConfig, systemPrompt: systemPrompt, - sessionList: [sessionDto1, sessionDto2] - ); + CapabilityDto capabilityDto = CapabilityDto(llmConfig: llmConfig, systemPrompt: systemPrompt, + sessionList: [sessionDto1, sessionDto2] + ); - SessionDto? sessionDto = await initChat(capabilityDto); + SessionDto? sessionDto = await initChat(capabilityDto); if (sessionDto != null) { print("[sessionDto] " + sessionDto.toJson().toString()); diff --git a/pubspec.yaml b/pubspec.yaml index ee69d92..ba878e8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: lite_agent_core_dart_server description: HTTP Server using `Lite Agent core for Dart` -version: 0.3.1 +version: 0.4.0 repository: https://github.com/LiteVar/lite_agent_core_dart_server environment: @@ -13,7 +13,7 @@ dependencies: web_socket_channel: ^3.0.0 logging: ^1.2.0 json_annotation: ^4.9.0 - lite_agent_core_dart: ^0.3.0 + lite_agent_core_dart: ^0.4.0 dev_dependencies: opentool_dart: ^0.2.0