Skip to content

Commit

Permalink
adapt new version lite_agent_core_dart
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan committed Sep 2, 2024
1 parent 09e9da7 commit 437d703
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions example/client_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ Future<List<OpenSpecDto>> _buildOpenSpecList() async {
String jsonPath = "$openAPIFolder${Platform.pathSeparator}$openAPIFileName";
File file = File(jsonPath);
String jsonString = await file.readAsString();
OpenSpecDto openSpecDto =
OpenSpecDto(openSpec: jsonString, protocol: Protocol.jsonrpcHttp);
OpenSpecDto openSpecDto = OpenSpecDto(openSpec: jsonString, protocol: Protocol.JSONRPCHTTP);
OpenSpecDtoList.add(openSpecDto);
}

Expand All @@ -246,7 +245,7 @@ Future<List<OpenSpecDto>> _buildOpenSpecList() async {
// File file = File(jsonPath);
// String jsonString = await file.readAsString();
// OpenSpecDto openSpecDto =
// OpenSpecDto(openSpec: jsonString, protocol: Protocol.openmodbus);
// OpenSpecDto(openSpec: jsonString, protocol: Protocol.OPENMODBUS);
// OpenSpecDtoList.add(openSpecDto);
// }

Expand Down
2 changes: 1 addition & 1 deletion example/mock/mock_client_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Future<List<OpenSpecDto>> _buildOpenSpecList() async {
File file = File(jsonPath);
String jsonString = await file.readAsString();
OpenSpecDto openSpecDto =
OpenSpecDto(openSpec: jsonString, protocol: Protocol.openapi);
OpenSpecDto(openSpec: jsonString, protocol: Protocol.OPENAPI);
OpenSpecDtoList.add(openSpecDto);
}

Expand Down
5 changes: 3 additions & 2 deletions lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class AgentController {
detail: "baseUrl: ${capabilityDto.llmConfig.baseUrl}, " +
"model: ${capabilityDto.llmConfig.model}, " +
"systemMessageLength: ${capabilityDto.systemPrompt.length}," +
"openSpecListLength: ${capabilityDto.openSpecList==null?"null": capabilityDto.openSpecList!.length}"
"openSpecListLength: ${capabilityDto.openSpecList == null ?"null": capabilityDto.openSpecList!.length}," +
"sessionListLength: ${capabilityDto.sessionList == null ?"null": capabilityDto.sessionList!.length}"
);

SessionDto sessionDto = await agentService.initChat(capabilityDto, listen);
Expand Down Expand Up @@ -142,7 +143,7 @@ class AgentController {

void listen(String sessionId, AgentMessage agentMessage) {
WebSocketChannel? webSocketChannel = webSocketSessions[sessionId];
AgentMessageDto agentMessageDto = AgentMessageDto.fromModel(sessionId, agentMessage);
AgentMessageDto agentMessageDto = AgentMessageDto.fromModel(agentMessage);
logger.log(LogModule.ws, "Send message", detail: jsonEncode(agentMessageDto.toJson()));
webSocketChannel?.sink.add(jsonEncode(agentMessageDto.toJson()));
}
Expand Down

0 comments on commit 437d703

Please sign in to comment.