Skip to content

Commit

Permalink
make args nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
tanzimfh committed Jul 17, 2024
1 parent 4fbfe66 commit 37dd6be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ data class CodeExecutionResultPart(val codeExecutionResult: CodeExecutionResult)

@Serializable data class FunctionResponse(val name: String, val response: JsonObject)

@Serializable data class FunctionCall(val name: String, val args: Map<String, String?>)
@Serializable data class FunctionCall(val name: String, val args: Map<String, String?>? = null)

@Serializable data class FileDataPart(@SerialName("file_data") val fileData: FileData) : Part

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FileDataPart(val uri: String, val mimeType: String) : Part
fun Part.asFileDataPartOrNull(): FileDataPart? = this as? FileDataPart

/** Represents function call name and params received from requests. */
class FunctionCallPart(val name: String, val args: Map<String, String?>) : Part
class FunctionCallPart(val name: String, val args: Map<String, String?>?) : Part

/** Represents function call output to be returned to the model when it requests a function call */
class FunctionResponsePart(val name: String, val response: JSONObject) : Part
Expand Down

0 comments on commit 37dd6be

Please sign in to comment.