Skip to content

Commit

Permalink
Merge pull request #9 from vyfor/dev
Browse files Browse the repository at this point in the history
fix: Parse the `tool_calls` & `function_call` fields when using a tool/function
  • Loading branch information
vyfor authored Nov 10, 2024
2 parents 8d2acc2 + a94432a commit cabf813
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ data class ChatCompletionChoice(
*
* @property role The role of the message sender, e.g., `assistant`.
* @property content The content of the message.
* @property toolCalls The tool calls generated by the model.
* @property functionCall The function call generated by the model.
*/
@Serializable
data class ChatCompletionMessage(
val role: String,
val content: String,
val toolCalls: List<CompletionToolCall>?,
val functionCall: CompletionFunctionCall?,
)

/**
Expand All @@ -93,11 +97,15 @@ data class StreamingChatCompletionChoice(
*
* @property role Optional role of the message sender, which may not be present in every delta.
* @property content The content of the message, streamed incrementally.
* @property toolCalls The tool calls generated by the model.
* @property functionCall The function call generated by the model.
*/
@Serializable
data class ChatCompletionDelta(
val role: String?,
val content: String?,
val toolCalls: List<CompletionToolCall>?,
val functionCall: CompletionFunctionCall?,
)

/**
Expand Down

0 comments on commit cabf813

Please sign in to comment.