RetrievalConfig
public struct RetrievalConfig : Sendable, EncodableConfiguration for grounding retrieval tools, such as Grounding with Google Maps.
Use RetrievalConfig inside ToolConfig or TemplateToolConfig to provide optional
location coordinates and language preferences to bias and localize search results.
-
Constructs a new
RetrievalConfig.Declaration
Swift
public init(location: CLLocationCoordinate2D? = nil, languageCode: String? = nil)Parameters
locationGeographic coordinates used to bias results towards the user's location.
languageCodeA BCP 47 language code to localize responses.
-
Declaration
Swift
public func encode(to encoder: Encoder) throws