Skip to content

Commit e981817

Browse files
authored
feat: support multiple urls in Tavily tool (#243)
1 parent 9f75fbe commit e981817

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Chain/ToolBox/Tool/Tavily.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Tool integration of tavily.com.
1212
*/
1313
#[AsTool('tavily_search', description: 'search for information on the internet', method: 'search')]
14-
#[AsTool('tavily_extract', description: 'fetch content from a website', method: 'extract')]
14+
#[AsTool('tavily_extract', description: 'fetch content from websites', method: 'extract')]
1515
final readonly class Tavily
1616
{
1717
/**
@@ -40,15 +40,13 @@ public function search(string $query): string
4040
}
4141

4242
/**
43-
* TODO: Support list of URLs.
44-
*
45-
* @param string $url URL to fetch information from
43+
* @param string[] $urls URLs to fetch information from
4644
*/
47-
public function extract(string $url): string
45+
public function extract(array $urls): string
4846
{
4947
$response = $this->httpClient->request('POST', 'https://api.tavily.com/extract', [
5048
'json' => [
51-
'urls' => [$url],
49+
'urls' => $urls,
5250
'api_key' => $this->apiKey,
5351
],
5452
]);

0 commit comments

Comments
 (0)