Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/Chain/ToolBox/Tool/Tavily.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Tool integration of tavily.com.
*/
#[AsTool('tavily_search', description: 'search for information on the internet', method: 'search')]
#[AsTool('tavily_extract', description: 'fetch content from a website', method: 'extract')]
#[AsTool('tavily_extract', description: 'fetch content from websites', method: 'extract')]
final readonly class Tavily
{
/**
Expand Down Expand Up @@ -40,15 +40,13 @@ public function search(string $query): string
}

/**
* TODO: Support list of URLs.
*
* @param string $url URL to fetch information from
* @param string[] $urls URLs to fetch information from
*/
public function extract(string $url): string
public function extract(array $urls): string
{
$response = $this->httpClient->request('POST', 'https://api.tavily.com/extract', [
'json' => [
'urls' => [$url],
'urls' => $urls,
'api_key' => $this->apiKey,
],
]);
Expand Down