gopenai/tool

Types

pub type DataType {
  StringType
  NumberType
  ArrayType
  BooleanType
  NullType
  ObjectType
}

Constructors

  • StringType
  • NumberType
  • ArrayType
  • BooleanType
  • NullType
  • ObjectType
pub type Function {
  Function(
    description: String,
    name: String,
    parameters: Option(FunctionParameters),
  )
}

Constructors

  • Function(
      description: String,
      name: String,
      parameters: Option(FunctionParameters),
    )
pub type FunctionCall {
  FunctionCall(name: String, arguments: String)
}

Constructors

  • FunctionCall(name: String, arguments: String)
pub type FunctionParameters {
  FunctionParameters(
    paramter_type: DataType,
    properties: dict.Dict(String, FunctionProperty),
    requiered: List(String),
  )
}

Constructors

  • FunctionParameters(
      paramter_type: DataType,
      properties: dict.Dict(String, FunctionProperty),
      requiered: List(String),
    )
pub type FunctionProperty {
  FunctionProperty(
    property_type: DataType,
    description: String,
    enum: Option(List(String)),
  )
}

Constructors

  • FunctionProperty(
      property_type: DataType,
      description: String,
      enum: Option(List(String)),
    )
pub type Tool {
  Tool(tool_type: ToolType, function: Function)
}

Constructors

  • Tool(tool_type: ToolType, function: Function)
pub type ToolCall {
  ToolCall(
    id: String,
    tool_type: ToolType,
    function: FunctionCall,
  )
}

Constructors

  • ToolCall(id: String, tool_type: ToolType, function: FunctionCall)
pub type ToolType {
  FunctionType
}

Constructors

  • FunctionType
pub type Value {
  Int
  Float
  String
}

Constructors

  • Int
  • Float
  • String

Functions

pub fn function_call_from_json(
  from data: Dynamic,
) -> Result(FunctionCall, List(DecodeError))
pub fn tool_to_json(tool: Tool) -> Json
pub fn tool_type_from_json(
  from data: Dynamic,
) -> Result(ToolType, List(DecodeError))
pub fn tools_to_json(tools: Option(List(Tool))) -> Json
pub fn validate_property(prop: FunctionProperty) -> Bool
Search Document