diff --git a/lib/src/model/chat_complete/request/chat_complete_text.dart b/lib/src/model/chat_complete/request/chat_complete_text.dart index e34dd2f..268b312 100644 --- a/lib/src/model/chat_complete/request/chat_complete_text.dart +++ b/lib/src/model/chat_complete/request/chat_complete_text.dart @@ -214,6 +214,7 @@ class ChatCompleteText { "top_logprobs": topLogprobs, "seed": seed, "tool_choice": toolChoice, + "tools": tools, }) ..removeWhere((key, value) => value == null); diff --git a/lib/src/model/chat_complete/response/message.dart b/lib/src/model/chat_complete/response/message.dart index 2342a43..bc02ed6 100644 --- a/lib/src/model/chat_complete/response/message.dart +++ b/lib/src/model/chat_complete/response/message.dart @@ -3,18 +3,23 @@ class Message { final String content; final String id = "${DateTime.now().millisecondsSinceEpoch}"; final Map? functionCall; + final List>? toolCalls; - Message({required this.role, required this.content, this.functionCall}); + Message({required this.role, required this.content, this.functionCall, this.toolCalls}); factory Message.fromJson(Map json) => Message( role: json["role"] ?? "", content: json["content"] ?? "", functionCall: json["function_call"], + toolCalls: json['tool_calls'] == null ? null : List>.from( + json["tool_calls"].map((x) => Map.from(x)), + ), ); Map toJson() => { "role": role, "content": content, "function_call": functionCall, + "tool_calls": toolCalls, }; }