Skip to content

Commit

Permalink
genai: add error check to example (#227)
Browse files Browse the repository at this point in the history
Fixes #225.
  • Loading branch information
jba authored Nov 18, 2024
1 parent 30b5de5 commit f453d2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion genai/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ func ExampleGenerativeModel_CountTokens_tools() {
// ( total_tokens: 23 )

tools := []*genai.Tool{
&genai.Tool{FunctionDeclarations: []*genai.FunctionDeclaration{
{FunctionDeclarations: []*genai.FunctionDeclaration{
{Name: "add"},
{Name: "subtract"},
{Name: "multiply"},
Expand Down Expand Up @@ -1188,6 +1188,9 @@ func ExampleTool() {
"theater": "AMC16",
},
})
if err != nil {
log.Fatal(err)
}
printResponse(res)
}

Expand Down

0 comments on commit f453d2d

Please sign in to comment.