Skip to content

Commit

Permalink
Do not add function calls if they have no name or arguments while str…
Browse files Browse the repository at this point in the history
…eaming (#476)
  • Loading branch information
raulraja authored Oct 4, 2023
1 parent 85fa396 commit 2aa5c58
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,9 @@ internal fun OAIChatDelta.toInternal() =
ChatDelta(
role = role?.toInternal(),
content = content,
functionCall = functionCall?.let { FunctionCall(it.name, it.arguments) }
functionCall =
functionCall?.let {
if (it.nameOrNull == null || it.argumentsOrNull == null) null
else FunctionCall(it.name, it.arguments)
}
)

0 comments on commit 2aa5c58

Please sign in to comment.