You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: service/assistant/functions/wikipedia.go
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,8 @@ import (
31
31
)
32
32
33
33
typeWikipediaRequeststruct {
34
-
Querystring`json:"article_name"`
34
+
Querystring`json:"article_name"`
35
+
CompleteArticlebool`json:"complete_article"`
35
36
}
36
37
37
38
typeWikipediaResponsestruct {
@@ -42,7 +43,7 @@ func init() {
42
43
registerFunction(Registration{
43
44
Definition: genai.FunctionDeclaration{
44
45
Name: "wikipedia",
45
-
Description: "Look up the content of a single named English Wikipedia page.",
46
+
Description: "Look up the content of a single named English Wikipedia page. Never say the Wikipedia page didn't have the information needed without first trying to fetch the complete article.",
46
47
Parameters: &genai.Schema{
47
48
Type: genai.TypeObject,
48
49
Nullable: false,
@@ -52,6 +53,11 @@ func init() {
52
53
Description: "The name of the English Wikipedia page to look up",
53
54
Nullable: false,
54
55
},
56
+
"complete_article": {
57
+
Type: genai.TypeBoolean,
58
+
Description: "Whether to return the complete article or just the summary. Prefer to fetch only the summary. If the summary didn't have the information you expected, you can try again with the complete article.",
addendum="\n\nThis was only the summary. If necessary, more information can be returned by repeating the query_wikipedia call with complete_article = true. You can always do this automatically, without prompting the user."
"Your name is Bobby, and you are running on a Pebble smartwatch. "+
96
96
"The text you receive is transcribed from voice input. "+
97
97
"Your knowledge cutoff is September 2024. However, you can use the wikipedia function to access the current content of specific Wikipedia pages. "+
98
-
"Always follow Wikipedia redirects immediately and silently. Never ask the user whether you should check wikipedia- if you would ask, assume that you should. Don't mention looking up articles or Wikipedia to the user. "+
98
+
"Always follow Wikipedia redirects immediately and silently. Never ask the user whether you should check wikipedia, or whether you should check the full article - if you would ask, assume that you should (but don't ever fetch full articles if you already have the answer to the question). Don't mention looking up articles or Wikipedia to the user. "+
99
99
locationString+
100
100
ps.generateTimeSentence(ctx) +
101
101
"You may call multiple functions before responding to the user, if necessary. If executing a lua script fails, try hard to fix the script using the error message, and consider alternate approaches to solve the problem. "+
0 commit comments