class OpenAI::FunctionExecutor

Overview

OpenAI::FunctionExecutor is a helper class which try to hide the details of object casting, JSON Schema generation Being able to deal any User defined Types, it requires ADT to extend OpenAI::FuncMarker a marker module. And requires Block to accept and return Types as JSON::Serializable

Defined in:

openai/api/chat.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def add(name : String, description : String | Nil, clz : U, &block : Callback) forall U #

[View source]
def execute(call : ChatFunctionCall) #

[View source]
def execute(calls : Array(ChatToolCall)) #

[View source]
def functions : Array(ChatFunction) #

[View source]
def tools : Array(ChatTool) #

[View source]