_CoreSpotlight_FoundationModels · IOS API REFERENCE
SpotlightSearchTool.Configuration
struct · iOS 27.0+ · SDK 27.1
struct Configuration
The configuration data to use when creating a Spotlight search tool.
Use this structure to specify the data sources, guidance, and options for ``SpotlightSearchTool``
to use when performing searches. Create an instance of this structure as part of the setup of the
search tool, and configure it with the information you want. For more information about configuring
the search tool, see <doc:making-your-indexed-content-available-to-foundation-models>.
Members (11)
get · iOS 27.0+
customStages
TypeScript
get customStages(): Array<SDKHandle>
Swift declaration
var customStages: [any CustomStage] { get set }
Custom pipeline stages you use to help the Spotlight search tool generate results.
Provide a custom stage if you have custom code for determining search results. For example, you might
use a custom stage to provide the Spotlight search tool with app-managed relevance scores. The tool
makes your custom stages available to the model, which determines whether to run them based on the prompt.
For more information about creating a custom stage, see <doc:making-your-indexed-content-available-to-foundation-models>.
set · iOS 27.0+
customStages
TypeScript
set customStages(value: Array<SDKHandle>)
Swift declaration
var customStages: [any CustomStage] { get set }
Custom pipeline stages you use to help the Spotlight search tool generate results.
Provide a custom stage if you have custom code for determining search results. For example, you might
use a custom stage to provide the Spotlight search tool with app-managed relevance scores. The tool
makes your custom stages available to the model, which determines whether to run them based on the prompt.
For more information about creating a custom stage, see <doc:making-your-indexed-content-available-to-foundation-models>.
get · iOS 27.0+
contactResolver
TypeScript
get contactResolver(): (SDKHandle) | null
Swift declaration
var contactResolver: (any ContactResolver)?
A custom type you use to identify the owner of your app’s data.
Use this property to provide additional context about the person using your app. The model uses
this information to help resolve first-person pronouns in prompts that indicate ownership of a
particular data item. Provide any information about the person that makes sense for your app.
For example, a communications app might include the person’s name and the phone number or email
associated with their account.
For information about how to create a contact resolver, see <doc:making-your-indexed-content-available-to-foundation-models>.
set · iOS 27.0+
contactResolver
TypeScript
set contactResolver(value: (SDKHandle) | null)
Swift declaration
var contactResolver: (any ContactResolver)?
A custom type you use to identify the owner of your app’s data.
Use this property to provide additional context about the person using your app. The model uses
this information to help resolve first-person pronouns in prompts that indicate ownership of a
particular data item. Provide any information about the person that makes sense for your app.
For example, a communications app might include the person’s name and the phone number or email
associated with their account.
For information about how to create a contact resolver, see <doc:making-your-indexed-content-available-to-foundation-models>.
get · iOS 27.0+
maximumResponseSize
TypeScript
get maximumResponseSize(): (number) | null
Swift declaration
var maximumResponseSize: Int?
The maximum number of UTF-8 characters of rendered tool output the
search tool sends back to the model on a single call.
If `nil`, the tool picks a default based on the configured ``guide``.
Pass an explicit value to override that default; the override applies
regardless of the guide's level.
set · iOS 27.0+
maximumResponseSize
TypeScript
set maximumResponseSize(value: (number) | null)
Swift declaration
var maximumResponseSize: Int?
The maximum number of UTF-8 characters of rendered tool output the
search tool sends back to the model on a single call.
If `nil`, the tool picks a default based on the configured ``guide``.
Pass an explicit value to override that default; the override applies
regardless of the guide's level.
get · iOS 27.0+
guide
TypeScript
get guide(): (SpotlightSearchTool_Guide) | null
Swift declaration
var guide: SpotlightSearchTool.Guide?
Options you use to guide the search process that the tool uses to retrieve results.
The Spotlight search tool employs many techniques to look for results, but some techniques might
not be relevant or necessary for your content. Use this property to offer guidance on how to search
for your content, and to reduce the amount of data the tool delivers to the model. If you don’t
specify custom guidance, the search tool uses all availble techniques, which can take extra time
to run and consume additional resources.
set · iOS 27.0+
guide
TypeScript
set guide(value: (SpotlightSearchTool_Guide) | null)
Swift declaration
var guide: SpotlightSearchTool.Guide?
Options you use to guide the search process that the tool uses to retrieve results.
The Spotlight search tool employs many techniques to look for results, but some techniques might
not be relevant or necessary for your content. Use this property to offer guidance on how to search
for your content, and to reduce the amount of data the tool delivers to the model. If you don’t
specify custom guidance, the search tool uses all availble techniques, which can take extra time
to run and consume additional resources.
The data sources and options to use during a search.
Use this property to specify where you want ``SpotlightSearchTool`` to look for your app’s data.
Fill this property with ``CoreSpotlightSource`` or ``FileSource`` types. If you specify multiple
search sources, the tool searches all of them and delivers the merged results to the model. Each
source object also has options about how much data to retrieve from the source, which you can use
to control how much data you send to the model.
If you don’t specify a value for this property, the search tool uses a default ``CoreSpotlightSource``
to search your app’s Spotlight index.
set · iOS 27.0+
sources
TypeScript
set sources(value: Array<SearchSource>)
Swift declaration
var sources: [SearchSource]
The data sources and options to use during a search.
Use this property to specify where you want ``SpotlightSearchTool`` to look for your app’s data.
Fill this property with ``CoreSpotlightSource`` or ``FileSource`` types. If you specify multiple
search sources, the tool searches all of them and delivers the merged results to the model. Each
source object also has options about how much data to retrieve from the source, which you can use
to control how much data you send to the model.
If you don’t specify a value for this property, the search tool uses a default ``CoreSpotlightSource``
to search your app’s Spotlight index.