Skip to content

Commit

Permalink
added some kdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Motsonashvili committed Mar 12, 2024
1 parent 571308f commit b752cda
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ abstract class FunctionDeclaration(val name: String, val description: String) {
abstract suspend fun execute(part: FunctionCallPart): JSONObject
}

/**
* Represents a parameter for a declared function
*
* @property name: The name of the parameter
* @property description: The description of what the parameter should contain or represent
* @property format: format information for the parameter, this can include bitlength in the case of
* int/float or keywords like "enum" for the string type
* @property enum: contains the enum values for a string enum
* @property type: contains the type info and parser
*/
class ParameterDeclaration<T>(
val name: String,
val description: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

package com.google.ai.client.generativeai.type


class FunctionParameter<T>(val name: String, val description: String, val type: FunctionType<T>) {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonArray
import org.json.JSONObject

/**
* Represents and passes the type information for an automated function call.
*
* @property name: the enum name of the type
* @property parse: the deserialization function
* @property T: the type of the object that this maps to in code.
*/
class FunctionType<T>(val name: String, val parse: (String?) -> T?) {
companion object {
val STRING = FunctionType<String>("STRING") { it }
Expand Down

0 comments on commit b752cda

Please sign in to comment.