Add web search to 15+ LLM’s in 2 minutes
search()
for simple scripts, asearch()
for async frameworks like
FastAPI. All methods have sync and async versions.Method | Type | Description |
---|---|---|
search() | Sync | Blocking call that returns complete response |
search_stream() | Sync | Returns generator for streaming responses |
asearch() | Async | Non-blocking call for async/await workflows |
asearch_stream() | Async | Returns async generator for streaming |
asearch()
in python for non-blocking operations in async applications:
Parameter | Type | Description | Example |
---|---|---|---|
query | string | Your search question | "Latest AI news" |
model | string | Model to use for processing | "claude-sonnet-4-20250514" |
Parameter | Type | Default | Description |
---|---|---|---|
return_sources | boolean | false | Include source URLs in response |
return_images | boolean | false | Include relevant images |
citations | boolean | false | Add inline citations [1] in response |
max_tokens | integer | 1500 | Maximum response length |
temperature | float | 0.7 | Response creativity (0-1) |
search_context_size | string | medium | Size of the search context to use for the LLM low , medium , high |
search_type | string | "general" | "general" or "news" |
date_filter | string | "anytime" | "anytime" , "hour" , "day" , "week" , "month" , "year" |
location | string | "us" | Geographic bias for results |
response_language | string | "auto" | Response language or "auto" |
domain_filter | array | null | Limit to specific domains, e.g. ["pubmed.com", "nature.com"] to include domains and add "-" to exclude domains, e.g. ["pubmed.com", "-nature.com"] - |
max_queries | integer | 1 | Number of search queries to generate ( a prompts can need 2 or more queries to be effective). each search query will be charged 0,005 $. |
system_prompt | string | null | Override default system prompt of LLMLAYER |
answer_type | string | "markdown" | "markdown" , "html" , or "json" |
json_schema | string | null | Required when answer_type="json" |
provider_key | string | null | You can bring your own api key for a specific model ( the provider of the selected model) , this is an option for advanced users that want to be charged directly by their model provider |