TavilyClient class

Client for Tavily API (v.1.0.0)

Tavily Search is a robust search API tailored specifically for LLM Agents. It seamlessly integrates with diverse data sources to ensure a superior, relevant search experience.

Constructors

TavilyClient.new({String? baseUrl, Map<String, String> headers = const {}, Map<String, dynamic> queryParams = const {}, Client? client})
Creates a new TavilyClient instance.

Properties

baseUrl String?
Override base URL (default: server url defined in spec)
final
client → Client
HTTP client for requests
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Global headers to be sent with every request
final
queryParams Map<String, dynamic>
Global query parameters to be sent with every request
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

endSession() → void
Close the HTTP client and end session
makeRequest({required String baseUrl, required String path, required HttpMethod method, Map<String, dynamic> queryParams = const {}, Map<String, String> headerParams = const {}, bool isMultipart = false, String requestType = '', String responseType = '', Object? body}) Future<Response>
Reusable request method
makeRequestStream({required String baseUrl, required String path, required HttpMethod method, Map<String, dynamic> queryParams = const {}, Map<String, String> headerParams = const {}, bool isMultipart = false, String requestType = '', String responseType = '', Object? body}) Future<StreamedResponse>
Reusable request stream method
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onRequest(BaseRequest request) Future<BaseRequest>
Middleware for HTTP requests (user can override)
onResponse(Response response) Future<Response>
Middleware for HTTP responses (user can override)
onStreamedResponse(StreamedResponse response) Future<StreamedResponse>
Middleware for HTTP streamed responses (user can override)
Search for data based on a query.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited