Skip to content

Commit

Permalink
Merge pull request #30 from otiai10/develop
Browse files Browse the repository at this point in the history
Fix API test
  • Loading branch information
otiai10 committed Sep 12, 2023
2 parents 8661b0c + c251a3c commit 1c82fbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions functioncall/invoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ type Invocation interface {
}

func (funcs Funcs) Call(invocation Invocation) string {
b, err := json.Marshal(funcs.Invoke(invocation))
b, err := json.Marshal(funcs.invoke(invocation))
if err != nil {
return err.Error()
}
return string(b)
}

func (funcs Funcs) Invoke(invocation Invocation) any {
func (funcs Funcs) invoke(invocation Invocation) any {
f, ok := funcs[invocation.Name()]
if !ok {
return fmt.Sprintf("function not found: %s", invocation.Name())
Expand Down
4 changes: 2 additions & 2 deletions testapp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ var (
funcs := fc.Funcs{
"GetDate": fc.Func{GetDate, "A function to get date today", fc.Params{}},
"GetWeather": fc.Func{GetWeather, "A function to get weather information", fc.Params{
{"location", "string", "location of the wather", true},
{"date", "integer", "date MMDD as number", true},
{"location", "string", "location of the wather", true, nil},
{"date", "integer", "date MMDD as number", true, nil},
}},
}
client := openaigo.NewClient(OPENAI_API_KEY)
Expand Down

0 comments on commit 1c82fbb

Please sign in to comment.