Skip to content

Commit d405ab6

Browse files
committed
Update dependencies.
In particular, update google.golang.org/genai from v0 to v1. Signed-off-by: Katharine Berry <[email protected]>
1 parent 9d6da14 commit d405ab6

File tree

14 files changed

+148
-131
lines changed

14 files changed

+148
-131
lines changed

service/assistant/functions/alarms.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ type DeleteTimerInput struct {
5555
type Empty struct{}
5656

5757
func init() {
58+
f := false
59+
t := true
5860
params := genai.Schema{
5961
Type: genai.TypeObject,
60-
Nullable: false,
62+
Nullable: &f,
6163
Properties: map[string]*genai.Schema{
6264
"time": {
6365
Type: genai.TypeString,
6466
Description: "The time to schedule the alarm for in ISO 8601 format, e.g. '2023-07-12T00:00:00-07:00'. Must always be in the future.",
65-
Nullable: true,
67+
Nullable: &t,
6668
},
6769
},
6870
}
@@ -85,7 +87,7 @@ func init() {
8587
paramsWithNames.Properties["name"] = &genai.Schema{
8688
Type: genai.TypeString,
8789
Description: "Only if explicitly specified by the user, the name of the alarm. Use title case. If the user didn't ask to name the alarm, just leave it empty.",
88-
Nullable: true,
90+
Nullable: &t,
8991
}
9092
// This registration is for new watch apps that support named alarms. The capability prevents the option for
9193
// naming being presented to the model for older apps.
@@ -118,12 +120,12 @@ func init() {
118120
Description: "Delete a specific alarm by its expiration time.",
119121
Parameters: &genai.Schema{
120122
Type: genai.TypeObject,
121-
Nullable: false,
123+
Nullable: &f,
122124
Properties: map[string]*genai.Schema{
123125
"time": {
124126
Type: genai.TypeString,
125127
Description: "The time of the alarm to delete in ISO 8601 format, e.g. '2023-07-12T00:00:00-07:00'.",
126-
Nullable: false,
128+
Nullable: &t,
127129
},
128130
},
129131
},
@@ -134,12 +136,12 @@ func init() {
134136
})
135137
timerParams := genai.Schema{
136138
Type: genai.TypeObject,
137-
Nullable: false,
139+
Nullable: &f,
138140
Properties: map[string]*genai.Schema{
139141
"duration_seconds": {
140142
Type: genai.TypeInteger,
141143
Description: "The number of seconds to set the timer for.",
142-
Nullable: true,
144+
Nullable: &t,
143145
Format: "int32",
144146
},
145147
},
@@ -162,7 +164,7 @@ func init() {
162164
timerParamsWithNames.Properties["name"] = &genai.Schema{
163165
Type: genai.TypeString,
164166
Description: "Only if explicitly specified by the user, the name of the timer. Use title case. If the user didn't ask to name the timer, just leave it empty.",
165-
Nullable: true,
167+
Nullable: &t,
166168
}
167169
registerFunction(Registration{
168170
Definition: genai.FunctionDeclaration{
@@ -193,12 +195,12 @@ func init() {
193195
Description: "Delete a specific timer by its expiration time.",
194196
Parameters: &genai.Schema{
195197
Type: genai.TypeObject,
196-
Nullable: false,
198+
Nullable: &f,
197199
Properties: map[string]*genai.Schema{
198200
"time": {
199201
Type: genai.TypeString,
200202
Description: "The time of the alarm to delete in ISO 8601 format, e.g. '2023-07-12T00:00:00-07:00'.",
201-
Nullable: false,
203+
Nullable: &f,
202204
},
203205
},
204206
},

service/assistant/functions/currency.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,25 @@ type CurrencyConversionResponse struct {
3838
}
3939

4040
func init() {
41+
f := false
4142
registerFunction(Registration{
4243
Definition: genai.FunctionDeclaration{
4344
Name: "convert_currency",
4445
Description: "Convert an amount of one (real, non-crypto) currency to another. *Always* call this function to get exchange rates when doing currency conversion - never use memorised rates.",
4546
Parameters: &genai.Schema{
4647
Type: genai.TypeObject,
47-
Nullable: false,
48+
Nullable: &f,
4849
Properties: map[string]*genai.Schema{
4950
"amount": {
5051
Type: genai.TypeNumber,
5152
Format: "double",
5253
Description: "The amount of currency to convert.",
53-
Nullable: false,
54+
Nullable: &f,
5455
},
5556
"from": {
5657
Type: genai.TypeString,
5758
Description: "The currency code to convert from.",
58-
Nullable: false,
59+
Nullable: &f,
5960
},
6061
"to": {
6162
Type: genai.TypeString,

service/assistant/functions/feedback.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,24 @@ type FeedbackInput struct {
2828
}
2929

3030
func init() {
31+
f := false
3132
registerFunction(Registration{
3233
Definition: genai.FunctionDeclaration{
3334
Name: "send_feedback",
3435
Description: "Send feedback to the developers. Include the thread if you want to provide context for the feedback. Only call this if the user specifically asks to send feedback. Feedback text is optional but recommended if include_thread is true.",
3536
Parameters: &genai.Schema{
3637
Type: genai.TypeObject,
37-
Nullable: false,
38+
Nullable: &f,
3839
Properties: map[string]*genai.Schema{
3940
"feedback": {
4041
Type: genai.TypeString,
4142
Description: "The feedback to send to the developers.",
42-
Nullable: false,
43+
Nullable: &f,
4344
},
4445
"include_thread": {
4546
Type: genai.TypeBoolean,
4647
Description: "Whether to include the thread as context in the feedback.",
47-
Nullable: false,
48+
Nullable: &f,
4849
},
4950
},
5051
Required: []string{"include_thread"},

service/assistant/functions/locations.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,19 @@ type GetLocationInput struct {
2525
}
2626

2727
func init() {
28+
f := false
2829
registerFunction(Registration{
2930
Definition: genai.FunctionDeclaration{
3031
Name: "get_location",
3132
Description: "Get the latitude and longitude of a given location. If the user's location is available, also provides the distance from the user.",
3233
Parameters: &genai.Schema{
3334
Type: genai.TypeObject,
34-
Nullable: false,
35+
Nullable: &f,
3536
Properties: map[string]*genai.Schema{
3637
"place_name": {
3738
Type: genai.TypeString,
3839
Description: `The name of a place to locate, e.g. "San Francisco, CA, USA" or "Paris, France".`,
39-
Nullable: false,
40+
Nullable: &f,
4041
},
4142
},
4243
Required: []string{"place_name"},

service/assistant/functions/lua.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ type LuaInput struct {
3737
}
3838

3939
func init() {
40+
f := false
41+
t := true
4042
registerFunction(Registration{
4143
Definition: genai.FunctionDeclaration{
4244
Name: "lua",
4345
Description: "Runs the provided Lua 5.2 script, and returns the result. ONLY STANDARD LIBRARY FUNCTIONS ARE AVAILABLE. DO NOT CALL ANYTHING ELSE.",
4446
Parameters: &genai.Schema{
4547
Type: genai.TypeObject,
46-
Nullable: false,
48+
Nullable: &f,
4749
Properties: map[string]*genai.Schema{
4850
"script": {
4951
Type: genai.TypeString,
5052
Description: "The Lua 5.2 script to run. Remember the return statements!",
51-
Nullable: false,
53+
Nullable: &f,
5254
},
5355
"timezone": {
5456
Type: genai.TypeString,
5557
Description: "If necessary, the timezone name to assume when running the script. Defaults to the user's local time.",
56-
Nullable: true,
58+
Nullable: &t,
5759
},
5860
},
5961
Required: []string{"script"},

service/assistant/functions/poi.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,25 @@ type POIResponse struct {
3535
}
3636

3737
func init() {
38+
f := false
39+
t := true
3840
registerFunction(Registration{
3941
Definition: genai.FunctionDeclaration{
4042
Name: "poi",
4143
Description: "Look up points of interest near the user's location (or another named location).",
4244
Parameters: &genai.Schema{
4345
Type: genai.TypeObject,
44-
Nullable: false,
46+
Nullable: &f,
4547
Properties: map[string]*genai.Schema{
4648
"query": {
4749
Type: genai.TypeString,
4850
Description: "The search query to use to find points of interest. Could be a name (e.g. \"McDonald's\"), a category (e.g. \"restaurant\" or \"pizza\"), or another search term.",
49-
Nullable: false,
51+
Nullable: &f,
5052
},
5153
"location": {
5254
Type: genai.TypeString,
5355
Description: "The name of the location to search near. If not provided, the user's current location will be used. Assume that no location should be provided unless explicitly requested: not providing one results in more accurate answers.",
54-
Nullable: true,
56+
Nullable: &t,
5557
},
5658
"languageCode": {
5759
Type: genai.TypeString,

service/assistant/functions/reminders.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,31 @@ type DeleteReminderInput struct {
4545
}
4646

4747
func init() {
48+
f := false
49+
t := true
4850
registerFunction(Registration{
4951
Definition: genai.FunctionDeclaration{
5052
Name: "set_reminder",
5153
Description: "Set a reminder for the user to perform a task at a time. Either time or delay must be provided, but not both. If the user specifies a time but not a day, assume they meant the next time that time will happen.",
5254
Parameters: &genai.Schema{
5355
Type: genai.TypeObject,
54-
Nullable: false,
56+
Nullable: &f,
5557
Properties: map[string]*genai.Schema{
5658
"time": {
5759
Type: genai.TypeString,
5860
Description: "The time to schedule the reminder for in ISO 8601 format, e.g. '2023-07-12T00:00:00-07:00'. Always assume the user's timezone unless otherwise specified.",
59-
Nullable: true,
61+
Nullable: &t,
6062
},
6163
"delay_mins": {
6264
Type: genai.TypeInteger,
6365
Description: "The delay from now to when the reminder should be scheduled, in minutes.",
64-
Nullable: true,
66+
Nullable: &t,
6567
Format: "int32",
6668
},
6769
"what": {
6870
Type: genai.TypeString,
6971
Description: "What to remind the user to do.",
70-
Nullable: false,
72+
Nullable: &t,
7173
},
7274
},
7375
Required: []string{"what"},
@@ -94,12 +96,12 @@ func init() {
9496
Description: "Delete a specific reminder by its ID.",
9597
Parameters: &genai.Schema{
9698
Type: genai.TypeObject,
97-
Nullable: false,
99+
Nullable: &f,
98100
Properties: map[string]*genai.Schema{
99101
"id": {
100102
Type: genai.TypeString,
101103
Description: "The ID of the reminder to delete. You *must* call get_reminders first to discover the ID of the correct reminder.",
102-
Nullable: false,
104+
Nullable: &f,
103105
},
104106
},
105107
Required: []string{"id"},

service/assistant/functions/time.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@ type GetTimeInput struct {
2323
}
2424

2525
func init() {
26+
f := false
2627
registerFunction(Registration{
2728
Definition: genai.FunctionDeclaration{
2829
Name: "get_time_elsewhere",
2930
Description: "Get the current time in a given valid tzdb timezone. Not all cities have a tzdb entry - be sure to use one that exists. Call multiple times to find the time in multiple timezones.",
3031
Parameters: &genai.Schema{
3132
Type: genai.TypeObject,
32-
Nullable: false,
33+
Nullable: &f,
3334
Properties: map[string]*genai.Schema{
3435
"timezone": {
3536
Type: genai.TypeString,
3637
Description: "The timezone, e.g. 'America/Los_Angeles'.",
37-
Nullable: false,
38+
Nullable: &f,
3839
},
3940
"offset": {
4041
Type: genai.TypeNumber,

service/assistant/functions/weather.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,31 @@ type WeatherInput struct {
3636
}
3737

3838
func init() {
39+
t := true
40+
f := false
3941
registerFunction(Registration{
4042
Definition: genai.FunctionDeclaration{
4143
Name: "get_weather",
4244
Description: "Given a location, return the current or future weather, and sunrise/sunset times. Do not specify a location if you want the user's local weather.",
4345
Parameters: &genai.Schema{
4446
Type: genai.TypeObject,
45-
Nullable: false,
47+
Nullable: &f,
4648
Properties: map[string]*genai.Schema{
4749
"location": {
4850
Type: genai.TypeString,
4951
Description: "The city, state, and country, e.g. 'Redwood City, CA, USA'. Omit for the user's current location.",
50-
Nullable: true,
52+
Nullable: &t,
5153
},
5254
"unit": {
5355
Type: genai.TypeString,
5456
Description: "The user's unit preference",
55-
Nullable: false,
57+
Nullable: &f,
5658
Enum: []string{"imperial", "metric", "uk hybrid"},
5759
},
5860
"kind": {
5961
Type: genai.TypeString,
6062
Description: "The kind of weather to return: current weather, the next 7 days, or the next 24 hours.",
61-
Nullable: false,
63+
Nullable: &f,
6264
Enum: []string{"current", "forecast daily", "forecast hourly"},
6365
},
6466
},

service/assistant/functions/wikipedia.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,30 @@ var urlMap = map[string]string{
4646
}
4747

4848
func init() {
49+
f := false
4950
registerFunction(Registration{
5051
Definition: genai.FunctionDeclaration{
5152
Name: "wikipedia",
5253
Description: "Look up the content of a single named wiki article, from Wikipedia or topic-specific wikis like Bulbapedia. Never say the wiki page didn't have the information needed without first trying to fetch the complete article.",
5354
Parameters: &genai.Schema{
5455
Type: genai.TypeObject,
55-
Nullable: false,
56+
Nullable: &f,
5657
Properties: map[string]*genai.Schema{
5758
"wiki": {
5859
Type: genai.TypeString,
5960
Description: "The Wiki to search.",
60-
Nullable: false,
61+
Nullable: &f,
6162
Enum: []string{"wikipedia", "bulbapedia"},
6263
},
6364
"article_name": {
6465
Type: genai.TypeString,
6566
Description: "The name of the article to look up",
66-
Nullable: false,
67+
Nullable: &f,
6768
},
6869
"complete_article": {
6970
Type: genai.TypeBoolean,
7071
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.",
71-
Nullable: false,
72+
Nullable: &f,
7273
},
7374
},
7475
Required: []string{"wiki", "article_name"},

0 commit comments

Comments
 (0)