Skip to content

Commit f453d2d

Browse files
authored
genai: add error check to example (#227)
Fixes #225.
1 parent 30b5de5 commit f453d2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

genai/example_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ func ExampleGenerativeModel_CountTokens_tools() {
586586
// ( total_tokens: 23 )
587587

588588
tools := []*genai.Tool{
589-
&genai.Tool{FunctionDeclarations: []*genai.FunctionDeclaration{
589+
{FunctionDeclarations: []*genai.FunctionDeclaration{
590590
{Name: "add"},
591591
{Name: "subtract"},
592592
{Name: "multiply"},
@@ -1188,6 +1188,9 @@ func ExampleTool() {
11881188
"theater": "AMC16",
11891189
},
11901190
})
1191+
if err != nil {
1192+
log.Fatal(err)
1193+
}
11911194
printResponse(res)
11921195
}
11931196

0 commit comments

Comments
 (0)