instead of having an openai => google translation layer, just add sister functions to the types that construct the google request just like openai's
This commit is contained in:
12
function.go
12
function.go
@@ -8,7 +8,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"github.com/sashabaranov/go-openai/jsonschema"
|
||||
|
||||
"gitea.stevedudenhoeffer.com/steve/go-llm/schema"
|
||||
)
|
||||
@@ -28,9 +27,6 @@ type Function struct {
|
||||
fn reflect.Value
|
||||
|
||||
paramType reflect.Type
|
||||
|
||||
// definition is a cache of the openaiImpl jsonschema definition
|
||||
definition *jsonschema.Definition
|
||||
}
|
||||
|
||||
func (f *Function) Execute(ctx *Context, input string) (any, error) {
|
||||
@@ -79,14 +75,6 @@ func (f *Function) toOpenAIFunction() *openai.FunctionDefinition {
|
||||
Parameters: f.Parameters,
|
||||
}
|
||||
}
|
||||
func (f *Function) toOpenAIDefinition() jsonschema.Definition {
|
||||
if f.definition == nil {
|
||||
def := f.Parameters.Definition()
|
||||
f.definition = &def
|
||||
}
|
||||
|
||||
return *f.definition
|
||||
}
|
||||
|
||||
type FunctionCall struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
|
Reference in New Issue
Block a user