Reference for APITools
PromptingTools.Experimental.APITools.create_websearch
PromptingTools.Experimental.APITools.tavily_api
create_websearch(query::AbstractString;
api_key::AbstractString,
search_depth::AbstractString = "basic")
Arguments
query::AbstractString
: The query to search for.api_key::AbstractString
: The API key to use for the search. Get an API key from Tavily.search_depth::AbstractString
: The depth of the search. Can be either "basic" or "advanced". Default is "basic". Advanced search calls equal to 2 requests.include_answer::Bool
: Whether to include the answer in the search results. Default isfalse
.include_raw_content::Bool
: Whether to include the raw content in the search results. Default isfalse
.max_results::Integer
: The maximum number of results to return. Default is 5.include_images::Bool
: Whether to include images in the search results. Default isfalse
.include_domains::AbstractVector{<:AbstractString}
: A list of domains to include in the search results. Default is an empty list.exclude_domains::AbstractVector{<:AbstractString}
: A list of domains to exclude from the search results. Default is an empty list.
Example
r = create_websearch("Who is King Charles?")
Even better, you can get not just the results but also the answer:
r = create_websearch("Who is King Charles?"; include_answer = true)
See Rest API documentation for more information.
tavily_api(;
api_key::AbstractString,
endpoint::String = "search",
url::AbstractString = "https://api.tavily.com",
http_kwargs::NamedTuple = NamedTuple(),
kwargs...)
Sends API requests to Tavily and returns the response.