5151 @ JsonSubTypes .Type (value = Content .McpServerToolCallContent .class , name = "mcp_server_tool_call" ),
5252 @ JsonSubTypes .Type (value = Content .McpServerToolResultContent .class , name = "mcp_server_tool_result" ),
5353 @ JsonSubTypes .Type (value = Content .FileSearchCallContent .class , name = "file_search_call" ),
54- @ JsonSubTypes .Type (value = Content .FileSearchResultContent .class , name = "file_search_result" )
54+ @ JsonSubTypes .Type (value = Content .FileSearchResultContent .class , name = "file_search_result" ),
55+ @ JsonSubTypes .Type (value = Content .GoogleMapsCallContent .class , name = "google_maps_call" ),
56+ @ JsonSubTypes .Type (value = Content .GoogleMapsResultContent .class , name = "google_maps_result" )
5557})
5658public sealed interface Content permits
5759 Content .TextContent ,
@@ -71,7 +73,9 @@ public sealed interface Content permits
7173 Content .McpServerToolCallContent ,
7274 Content .McpServerToolResultContent ,
7375 Content .FileSearchCallContent ,
74- Content .FileSearchResultContent {
76+ Content .FileSearchResultContent ,
77+ Content .GoogleMapsCallContent ,
78+ Content .GoogleMapsResultContent {
7579
7680 /**
7781 * Returns the type of content.
@@ -133,16 +137,74 @@ public TextContent(String text) {
133137
134138 /**
135139 * Annotation for text content.
136- *
137- * @param startIndex Start index of the annotation.
138- * @param endIndex End index of the annotation.
139- * @param source Source of the annotation.
140+ */
141+ @ JsonTypeInfo (
142+ use = JsonTypeInfo .Id .NAME ,
143+ include = JsonTypeInfo .As .EXISTING_PROPERTY ,
144+ property = "type" ,
145+ visible = true
146+ )
147+ @ JsonSubTypes ({
148+ @ JsonSubTypes .Type (value = Content .UrlCitation .class , name = "url_citation" ),
149+ @ JsonSubTypes .Type (value = Content .FileCitation .class , name = "file_citation" ),
150+ @ JsonSubTypes .Type (value = Content .PlaceCitation .class , name = "place_citation" )
151+ })
152+ sealed interface Annotation permits UrlCitation , FileCitation , PlaceCitation {
153+ /**
154+ * Returns the type of annotation.
155+ *
156+ * @return The annotation type.
157+ */
158+ String type ();
159+ }
160+
161+ /**
162+ * URL citation annotation.
140163 */
141164 @ JsonIgnoreProperties (ignoreUnknown = true )
142- record Annotation (
165+ record UrlCitation (
166+ String type ,
143167 @ JsonProperty ("start_index" ) Integer startIndex ,
144168 @ JsonProperty ("end_index" ) Integer endIndex ,
169+ String url ,
170+ String title
171+ ) implements Annotation {}
172+
173+ /**
174+ * File citation annotation.
175+ */
176+ @ JsonIgnoreProperties (ignoreUnknown = true )
177+ record FileCitation (
178+ String type ,
179+ @ JsonProperty ("start_index" ) Integer startIndex ,
180+ @ JsonProperty ("end_index" ) Integer endIndex ,
181+ @ JsonProperty ("document_uri" ) String documentUri ,
182+ @ JsonProperty ("file_name" ) String fileName ,
145183 String source
184+ ) implements Annotation {}
185+
186+ /**
187+ * Place citation annotation.
188+ */
189+ @ JsonIgnoreProperties (ignoreUnknown = true )
190+ record PlaceCitation (
191+ String type ,
192+ @ JsonProperty ("start_index" ) Integer startIndex ,
193+ @ JsonProperty ("end_index" ) Integer endIndex ,
194+ @ JsonProperty ("place_id" ) String placeId ,
195+ String name ,
196+ String url ,
197+ @ JsonProperty ("review_snippets" ) List <ReviewSnippet > reviewSnippets
198+ ) implements Annotation {}
199+
200+ /**
201+ * Review snippet for place citation or Google Maps results.
202+ */
203+ @ JsonIgnoreProperties (ignoreUnknown = true )
204+ record ReviewSnippet (
205+ String title ,
206+ String url ,
207+ @ JsonProperty ("review_id" ) String reviewId
146208 ) {}
147209
148210 /**
@@ -268,7 +330,8 @@ record FunctionCallContent(
268330 String type ,
269331 String id ,
270332 String name ,
271- Map <String , Object > arguments
333+ Map <String , Object > arguments ,
334+ String signature
272335 ) implements Content {}
273336
274337 /**
@@ -312,7 +375,8 @@ record ToolResult(
312375 record CodeExecutionCallContent (
313376 String type ,
314377 String id ,
315- CodeExecutionCallArguments arguments
378+ CodeExecutionCallArguments arguments ,
379+ String signature
316380 ) implements Content {}
317381
318382 /**
@@ -358,7 +422,8 @@ record CodeExecutionResultContent(
358422 record UrlContextCallContent (
359423 String type ,
360424 String id ,
361- UrlContextCallArguments arguments
425+ UrlContextCallArguments arguments ,
426+ String signature
362427 ) implements Content {}
363428
364429 /**
@@ -536,4 +601,71 @@ record FileSearchResult(
536601 String text ,
537602 @ JsonProperty ("file_search_store" ) String fileSearchStore
538603 ) {}
604+
605+ // --- Google Maps ---
606+
607+ /**
608+ * Content representing a Google Maps call.
609+ *
610+ * @param type The type of content (must be "google_maps_call").
611+ * @param id The unique identifier for the Google Maps call.
612+ * @param arguments The arguments for the Google Maps.
613+ * @param signature The signature of the call.
614+ */
615+ @ JsonIgnoreProperties (ignoreUnknown = true )
616+ record GoogleMapsCallContent (
617+ String type ,
618+ String id ,
619+ GoogleMapsCallArguments arguments ,
620+ String signature
621+ ) implements Content {}
622+
623+ /**
624+ * Arguments for a Google Maps call.
625+ *
626+ * @param queries The queries to be executed.
627+ */
628+ @ JsonIgnoreProperties (ignoreUnknown = true )
629+ record GoogleMapsCallArguments (
630+ List <String > queries
631+ ) {}
632+
633+ /**
634+ * Content representing the result of a Google Maps call.
635+ *
636+ * @param type The type of content (must be "google_maps_result").
637+ * @param callId The ID of the Google Maps call.
638+ * @param signature The signature of the result.
639+ * @param result The list of Google Maps results.
640+ */
641+ @ JsonIgnoreProperties (ignoreUnknown = true )
642+ record GoogleMapsResultContent (
643+ String type ,
644+ @ JsonProperty ("call_id" ) String callId ,
645+ String signature ,
646+ List <GoogleMapsResult > result
647+ ) implements Content {}
648+
649+ /**
650+ * Result of a single Google Maps call.
651+ *
652+ * @param places The places that were found.
653+ * @param widgetContextToken Resource name of the Google Maps widget context token.
654+ */
655+ @ JsonIgnoreProperties (ignoreUnknown = true )
656+ record GoogleMapsResult (
657+ List <Places > places ,
658+ @ JsonProperty ("widget_context_token" ) String widgetContextToken
659+ ) {}
660+
661+ /**
662+ * Place details.
663+ */
664+ @ JsonIgnoreProperties (ignoreUnknown = true )
665+ record Places (
666+ @ JsonProperty ("place_id" ) String placeId ,
667+ String name ,
668+ String url ,
669+ @ JsonProperty ("review_snippets" ) List <ReviewSnippet > reviewSnippets
670+ ) {}
539671}
0 commit comments