Class WebSearchPreviewTool
- 
                    
                    
- All Implemented Interfaces:
 
public final class WebSearchPreviewToolThis tool searches the web for relevant results to use in a response. Learn more about the web search tool.
 
- 
                
                    
                    
- 
                                
                            
                                
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classWebSearchPreviewTool.BuilderA builder for WebSearchPreviewTool.
public final classWebSearchPreviewTool.TypeThe type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.public final classWebSearchPreviewTool.SearchContextSizeHigh level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.public final classWebSearchPreviewTool.UserLocationThe user's location.
 
- 
                                
                            
                                
Method Summary
- 
                    
                    
                    
- 
                                
                            
                                
Method Detail
- 
                                        
type
final WebSearchPreviewTool.Type type()
The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11. 
- 
                                        
searchContextSize
final Optional<WebSearchPreviewTool.SearchContextSize> searchContextSize()
High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default. 
- 
                                        
userLocation
final Optional<WebSearchPreviewTool.UserLocation> userLocation()
The user's location.
 
- 
                                        
_type
final JsonField<WebSearchPreviewTool.Type> _type()
Returns the raw JSON value of type.
Unlike type, this method doesn't throw if the JSON field has an unexpected type.
 
- 
                                        
_searchContextSize
final JsonField<WebSearchPreviewTool.SearchContextSize> _searchContextSize()
Returns the raw JSON value of searchContextSize.
Unlike searchContextSize, this method doesn't throw if the JSON field has an unexpected type.
 
- 
                                        
_userLocation
final JsonField<WebSearchPreviewTool.UserLocation> _userLocation()
Returns the raw JSON value of userLocation.
Unlike userLocation, this method doesn't throw if the JSON field has an unexpected type.
 
- 
                                        
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
 
- 
                                        
toBuilder
final WebSearchPreviewTool.Builder toBuilder()
 
- 
                                        
validate
final WebSearchPreviewTool validate()
 
- 
                                        
builder
final static WebSearchPreviewTool.Builder builder()
Returns a mutable builder for constructing an instance of WebSearchPreviewTool.
The following fields are required:
.type() 
 - 
                                        
 
 - 
                                
                            
                                
 
 - 
                    
                    
                    
 
 -