Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(tavily): add AI actions and output schemas (#15870)

Kishan Parmar008f9baf7bd1
diff --git a/packages/pieces/community/tavily/README.md b/packages/pieces/community/tavily/README.md
index e0e46df4bb3..4a2f5862a11 100644
--- a/packages/pieces/community/tavily/README.md
+++ b/packages/pieces/community/tavily/README.md
@@ -15,6 +15,16 @@ Tavily is an AI-powered search engine designed for accurate and real-time inform
- Supports various content types
- Removes ads and irrelevant content
+3. **Crawl Website**: Crawl a website from a root URL and return page content
+
+4. **Map Website**: Crawl a website from a root URL and return the URL structure, without page content
+
+5. **Start Research Task**: Start an asynchronous, in-depth research task on a topic or question
+
+6. **Get Research Task**: Get the status and result of a research task by its request id
+
+7. **Get Usage**: Get API key and account credit usage for the connected Tavily account
+
## Authentication
This piece requires an API key from Tavily. To obtain your API key:
1. Visit https://tavily.com/ and sign up for an account
diff --git a/packages/pieces/community/tavily/package.json b/packages/pieces/community/tavily/package.json
index f5971e15ab8..9f7b1fab337 100644
--- a/packages/pieces/community/tavily/package.json
+++ b/packages/pieces/community/tavily/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-tavily",
- "version": "0.2.0",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/tavily/src/index.ts b/packages/pieces/community/tavily/src/index.ts
index 0eec038b0c8..22b0f1f6291 100644
--- a/packages/pieces/community/tavily/src/index.ts
+++ b/packages/pieces/community/tavily/src/index.ts
@@ -3,17 +3,29 @@ import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { searchAction } from './lib/actions/search';
import { extractAction } from './lib/actions/extract';
+import { crawlWebsiteAction } from './lib/actions/ai/crawl-website';
+import { mapWebsiteAction } from './lib/actions/ai/map-website';
+import { startResearchTaskAction } from './lib/actions/ai/start-research-task';
+import { getResearchTaskAction } from './lib/actions/ai/get-research-task';
+import { getUsageAction } from './lib/actions/ai/get-usage';
import { tavilyAuth } from './lib/auth';
export const tavily = createPiece({
displayName: 'Tavily',
description: 'Search engine tailored for AI agents.',
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/tavily.jpg',
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
authors: ['OsamaHaikal'],
auth: tavilyAuth,
- actions: [searchAction, extractAction,
+ actions: [
+ searchAction,
+ extractAction,
+ crawlWebsiteAction,
+ mapWebsiteAction,
+ startResearchTaskAction,
+ getResearchTaskAction,
+ getUsageAction,
createCustomApiCallAction({
baseUrl: () => 'https://api.tavily.com',
auth: tavilyAuth,
diff --git a/packages/pieces/community/tavily/src/lib/actions/ai/crawl-website.ts b/packages/pieces/community/tavily/src/lib/actions/ai/crawl-website.ts
new file mode 100644
index 00000000000..a2a5ca18375
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/actions/ai/crawl-website.ts
@@ -0,0 +1,128 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { tavilyAuth } from '../../auth';
+import { tavilyCommon } from '../../common/client';
+import { tavilyCrawlWebsiteOutputSchema } from '../../output-schemas';
+
+export const crawlWebsiteAction = createAction({
+ name: 'tavily_crawl_website',
+ outputSchema: tavilyCrawlWebsiteOutputSchema,
+ classification: 'SEARCH',
+ displayName: 'Crawl Website',
+ description: 'Crawl a website starting from a root URL and return the content of the pages found.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ "Explore a website starting from a root URL, following links up to a depth and breadth limit, and return the extracted content of each page visited. Use to gather content across a whole site or section rather than a single page. Use `tavily_map_website` instead when only the URL structure is needed, not page content. Not idempotent: page content and the set of URLs discovered can change between runs.",
+ idempotent: false,
+ },
+ auth: tavilyAuth,
+ props: {
+ url: Property.ShortText({
+ displayName: 'Root URL',
+ description: 'The root URL to begin the crawl from.',
+ required: true,
+ }),
+ instructions: Property.LongText({
+ displayName: 'Instructions',
+ description: 'Natural language instructions describing what the crawler should look for.',
+ required: false,
+ }),
+ max_depth: Property.Number({
+ displayName: 'Max Depth',
+ description: 'How far from the root URL the crawler can explore. Range: 1-5.',
+ required: false,
+ defaultValue: 1,
+ }),
+ max_breadth: Property.Number({
+ displayName: 'Max Breadth',
+ description: 'Maximum number of links to follow per level of the tree. Range: 1-500.',
+ required: false,
+ defaultValue: 20,
+ }),
+ limit: Property.Number({
+ displayName: 'Limit',
+ description: 'Total number of links the crawler will process before stopping.',
+ required: false,
+ defaultValue: 50,
+ }),
+ select_paths: Property.Array({
+ displayName: 'Select Paths',
+ description: 'Regex patterns selecting only URLs with these path patterns.',
+ required: false,
+ }),
+ select_domains: Property.Array({
+ displayName: 'Select Domains',
+ description: 'Regex patterns selecting only specific domains or subdomains.',
+ required: false,
+ }),
+ exclude_paths: Property.Array({
+ displayName: 'Exclude Paths',
+ description: 'Regex patterns excluding URLs with these path patterns.',
+ required: false,
+ }),
+ exclude_domains: Property.Array({
+ displayName: 'Exclude Domains',
+ description: 'Regex patterns excluding specific domains or subdomains.',
+ required: false,
+ }),
+ allow_external: Property.Checkbox({
+ displayName: 'Allow External Links',
+ description: 'Include external domain links in the final results list.',
+ required: false,
+ defaultValue: true,
+ }),
+ include_images: Property.Checkbox({
+ displayName: 'Include Images',
+ description: 'Include images found on the crawled pages.',
+ required: false,
+ defaultValue: false,
+ }),
+ extract_depth: Property.StaticDropdown({
+ displayName: 'Extract Depth',
+ description: 'The depth of content extraction per page.',
+ required: false,
+ defaultValue: 'basic',
+ options: {
+ options: [
+ { label: 'Basic', value: 'basic' },
+ { label: 'Advanced', value: 'advanced' },
+ ],
+ },
+ }),
+ format: Property.StaticDropdown({
+ displayName: 'Format',
+ description: 'The format of the extracted page content.',
+ required: false,
+ defaultValue: 'markdown',
+ options: {
+ options: [
+ { label: 'Markdown', value: 'markdown' },
+ { label: 'Text', value: 'text' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return tavilyCommon.request({
+ apiKey: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/crawl',
+ body: {
+ url: propsValue.url,
+ instructions: propsValue.instructions,
+ max_depth: propsValue.max_depth,
+ max_breadth: propsValue.max_breadth,
+ limit: propsValue.limit,
+ select_paths: propsValue.select_paths,
+ select_domains: propsValue.select_domains,
+ exclude_paths: propsValue.exclude_paths,
+ exclude_domains: propsValue.exclude_domains,
+ allow_external: propsValue.allow_external,
+ include_images: propsValue.include_images,
+ extract_depth: propsValue.extract_depth,
+ format: propsValue.format,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/tavily/src/lib/actions/ai/get-research-task.ts b/packages/pieces/community/tavily/src/lib/actions/ai/get-research-task.ts
new file mode 100644
index 00000000000..ab23a5ca0c3
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/actions/ai/get-research-task.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { tavilyAuth } from '../../auth';
+import { tavilyCommon } from '../../common/client';
+import { tavilyGetResearchTaskOutputSchema } from '../../output-schemas';
+
+export const getResearchTaskAction = createAction({
+ name: 'tavily_get_research_task',
+ outputSchema: tavilyGetResearchTaskOutputSchema,
+ classification: 'READ',
+ displayName: 'Get Research Task',
+ description: 'Get the status and result of a research task by its request id.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ "Read the status and, once finished, the content and sources of a research task started with `tavily_start_research_task`. Status is one of pending, in_progress, completed, or failed; only a completed task carries content and sources. Use to poll a previously started research task. Read-only and idempotent.",
+ idempotent: true,
+ },
+ auth: tavilyAuth,
+ props: {
+ request_id: Property.ShortText({
+ displayName: 'Request ID',
+ description: 'The request id returned by Start Research Task.',
+ required: true,
+ }),
+ include_usage: Property.Checkbox({
+ displayName: 'Include Usage',
+ description: 'Include credit usage information in the response.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return tavilyCommon.request({
+ apiKey: auth.secret_text,
+ method: HttpMethod.GET,
+ path: `/research/${encodeURIComponent(propsValue.request_id)}`,
+ queryParams: {
+ ...(propsValue.include_usage !== undefined && {
+ include_usage: String(propsValue.include_usage),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/tavily/src/lib/actions/ai/get-usage.ts b/packages/pieces/community/tavily/src/lib/actions/ai/get-usage.ts
new file mode 100644
index 00000000000..a1fe9f6a82e
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/actions/ai/get-usage.ts
@@ -0,0 +1,37 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { tavilyAuth } from '../../auth';
+import { tavilyCommon } from '../../common/client';
+import { tavilyGetUsageOutputSchema } from '../../output-schemas';
+
+export const getUsageAction = createAction({
+ name: 'tavily_get_usage',
+ outputSchema: tavilyGetUsageOutputSchema,
+ classification: 'READ',
+ displayName: 'Get Usage',
+ description: 'Get API key and account credit usage for the connected Tavily account.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Read the connected API key and account-level credit usage, broken down by endpoint (search, extract, crawl, map, research). Use to check remaining credits or usage against plan limits before running a costly operation. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: tavilyAuth,
+ props: {
+ project_id: Property.ShortText({
+ displayName: 'Project ID',
+ description: 'Optional project id to scope the usage query to a specific project.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return tavilyCommon.request({
+ apiKey: auth.secret_text,
+ method: HttpMethod.GET,
+ path: '/usage',
+ headers: {
+ ...(propsValue.project_id !== undefined && { 'X-Project-ID': propsValue.project_id }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/tavily/src/lib/actions/ai/map-website.ts b/packages/pieces/community/tavily/src/lib/actions/ai/map-website.ts
new file mode 100644
index 00000000000..8083092989b
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/actions/ai/map-website.ts
@@ -0,0 +1,95 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { tavilyAuth } from '../../auth';
+import { tavilyCommon } from '../../common/client';
+import { tavilyMapWebsiteOutputSchema } from '../../output-schemas';
+
+export const mapWebsiteAction = createAction({
+ name: 'tavily_map_website',
+ outputSchema: tavilyMapWebsiteOutputSchema,
+ classification: 'SEARCH',
+ displayName: 'Map Website',
+ description: 'Crawl a website starting from a root URL and return the URL structure discovered, without page content.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ "Explore a website starting from a root URL, following links up to a depth and breadth limit, and return the list of URLs discovered — no page content. Use to discover a site's structure or find candidate URLs to pass to `tavily_extract` or `tavily_crawl_website`. Not idempotent: the set of URLs discovered can change between runs.",
+ idempotent: false,
+ },
+ auth: tavilyAuth,
+ props: {
+ url: Property.ShortText({
+ displayName: 'Root URL',
+ description: 'The root URL to begin the mapping from.',
+ required: true,
+ }),
+ instructions: Property.LongText({
+ displayName: 'Instructions',
+ description: 'Natural language instructions guiding the crawler.',
+ required: false,
+ }),
+ max_depth: Property.Number({
+ displayName: 'Max Depth',
+ description: 'How far from the root URL the crawler can explore. Range: 1-5.',
+ required: false,
+ defaultValue: 1,
+ }),
+ max_breadth: Property.Number({
+ displayName: 'Max Breadth',
+ description: 'Maximum number of links to follow per level of the tree. Range: 1-500.',
+ required: false,
+ defaultValue: 20,
+ }),
+ limit: Property.Number({
+ displayName: 'Limit',
+ description: 'Total number of links the crawler will process before stopping.',
+ required: false,
+ defaultValue: 50,
+ }),
+ select_paths: Property.Array({
+ displayName: 'Select Paths',
+ description: 'Regex patterns selecting only URLs with these path patterns.',
+ required: false,
+ }),
+ select_domains: Property.Array({
+ displayName: 'Select Domains',
+ description: 'Regex patterns selecting only specific domains or subdomains.',
+ required: false,
+ }),
+ exclude_paths: Property.Array({
+ displayName: 'Exclude Paths',
+ description: 'Regex patterns excluding URLs with these path patterns.',
+ required: false,
+ }),
+ exclude_domains: Property.Array({
+ displayName: 'Exclude Domains',
+ description: 'Regex patterns excluding specific domains or subdomains.',
+ required: false,
+ }),
+ allow_external: Property.Checkbox({
+ displayName: 'Allow External Links',
+ description: 'Include external domain links in the final results list.',
+ required: false,
+ defaultValue: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return tavilyCommon.request({
+ apiKey: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/map',
+ body: {
+ url: propsValue.url,
+ instructions: propsValue.instructions,
+ max_depth: propsValue.max_depth,
+ max_breadth: propsValue.max_breadth,
+ limit: propsValue.limit,
+ select_paths: propsValue.select_paths,
+ select_domains: propsValue.select_domains,
+ exclude_paths: propsValue.exclude_paths,
+ exclude_domains: propsValue.exclude_domains,
+ allow_external: propsValue.allow_external,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/tavily/src/lib/actions/ai/start-research-task.ts b/packages/pieces/community/tavily/src/lib/actions/ai/start-research-task.ts
new file mode 100644
index 00000000000..ba4c9b5c22d
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/actions/ai/start-research-task.ts
@@ -0,0 +1,93 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { tavilyAuth } from '../../auth';
+import { tavilyCommon } from '../../common/client';
+import { tavilyStartResearchTaskOutputSchema } from '../../output-schemas';
+
+export const startResearchTaskAction = createAction({
+ name: 'tavily_start_research_task',
+ outputSchema: tavilyStartResearchTaskOutputSchema,
+ classification: 'WRITE',
+ displayName: 'Start Research Task',
+ description: 'Start an asynchronous, in-depth research task on a topic or question.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Queue a background research task that investigates a topic or question in depth and returns a request id. The task runs asynchronously; poll its result with `tavily_get_research_task` using the returned request id. Use for comprehensive, multi-source research beyond what a single search covers. Not idempotent: every call starts a new task.',
+ idempotent: false,
+ },
+ auth: tavilyAuth,
+ props: {
+ input: Property.LongText({
+ displayName: 'Research Question',
+ description: 'The research task or question to investigate.',
+ required: true,
+ }),
+ model: Property.StaticDropdown({
+ displayName: 'Model',
+ description: '"mini" for targeted research, "pro" for comprehensive multi-angle analysis.',
+ required: false,
+ defaultValue: 'auto',
+ options: {
+ options: [
+ { label: 'Auto', value: 'auto' },
+ { label: 'Mini', value: 'mini' },
+ { label: 'Pro', value: 'pro' },
+ ],
+ },
+ }),
+ citation_format: Property.StaticDropdown({
+ displayName: 'Citation Format',
+ description: 'Citation style used in the report.',
+ required: false,
+ defaultValue: 'numbered',
+ options: {
+ options: [
+ { label: 'Numbered', value: 'numbered' },
+ { label: 'MLA', value: 'mla' },
+ { label: 'APA', value: 'apa' },
+ { label: 'Chicago', value: 'chicago' },
+ ],
+ },
+ }),
+ output_length: Property.StaticDropdown({
+ displayName: 'Output Length',
+ description: 'Target size of the response.',
+ required: false,
+ defaultValue: 'standard',
+ options: {
+ options: [
+ { label: 'Short', value: 'short' },
+ { label: 'Standard', value: 'standard' },
+ { label: 'Long', value: 'long' },
+ ],
+ },
+ }),
+ include_domains: Property.Array({
+ displayName: 'Include Domains',
+ description: 'Soft preference domains; research prioritizes these. Max 20.',
+ required: false,
+ }),
+ exclude_domains: Property.Array({
+ displayName: 'Exclude Domains',
+ description: 'Hard blocklist; no URLs from these domains appear. Max 20.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return tavilyCommon.request({
+ apiKey: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/research',
+ body: {
+ input: propsValue.input,
+ model: propsValue.model,
+ citation_format: propsValue.citation_format,
+ output_length: propsValue.output_length,
+ include_domains: propsValue.include_domains,
+ exclude_domains: propsValue.exclude_domains,
+ stream: false,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/tavily/src/lib/actions/extract.ts b/packages/pieces/community/tavily/src/lib/actions/extract.ts
index bf820f9f5ed..5b31c1d5fbf 100644
--- a/packages/pieces/community/tavily/src/lib/actions/extract.ts
+++ b/packages/pieces/community/tavily/src/lib/actions/extract.ts
@@ -1,9 +1,11 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { tavilyAuth } from '../auth';
+import { extractOutputSchema } from '../output-schemas';
export const extractAction = createAction({
name: 'extract',
+ outputSchema: extractOutputSchema,
classification: 'READ',
displayName: 'Extract Content',
description: 'Retrieve raw web content from specified URLs.',
diff --git a/packages/pieces/community/tavily/src/lib/actions/search.ts b/packages/pieces/community/tavily/src/lib/actions/search.ts
index c02cfe5b33e..e1124cff329 100644
--- a/packages/pieces/community/tavily/src/lib/actions/search.ts
+++ b/packages/pieces/community/tavily/src/lib/actions/search.ts
@@ -1,9 +1,11 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { tavilyAuth } from '../auth';
+import { searchOutputSchema } from '../output-schemas';
export const searchAction = createAction({
name: 'search',
+ outputSchema: searchOutputSchema,
classification: 'SEARCH',
displayName: 'Search',
description: 'Search for data based on a query.',
diff --git a/packages/pieces/community/tavily/src/lib/common/client.ts b/packages/pieces/community/tavily/src/lib/common/client.ts
new file mode 100644
index 00000000000..890f1bbebc7
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/common/client.ts
@@ -0,0 +1,52 @@
+import { httpClient, HttpMethod, AuthenticationType, HttpError } from '@activepieces/pieces-common';
+
+const BASE_URL = 'https://api.tavily.com';
+
+async function request<T>({
+ apiKey,
+ method,
+ path,
+ body,
+ queryParams,
+ headers,
+}: {
+ apiKey: string;
+ method: HttpMethod;
+ path: string;
+ body?: Record<string, unknown>;
+ queryParams?: Record<string, string>;
+ headers?: Record<string, string>;
+}): Promise<T> {
+ try {
+ const response = await httpClient.sendRequest<T>({
+ method,
+ url: `${BASE_URL}${path}`,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: apiKey,
+ },
+ headers: {
+ 'Content-Type': 'application/json',
+ ...headers,
+ },
+ queryParams,
+ body,
+ });
+ return response.body;
+ } catch (e) {
+ if (e instanceof HttpError) {
+ const status = e.response.status;
+ const message = JSON.stringify(e.response.body);
+ if (status === 401) {
+ throw new Error(`Invalid Tavily API key: ${message}`);
+ }
+ if (status === 429) {
+ throw new Error(`Tavily rate limit exceeded: ${message}`);
+ }
+ throw new Error(`Tavily API error (${status}): ${message}`);
+ }
+ throw e;
+ }
+}
+
+export const tavilyCommon = { request };
diff --git a/packages/pieces/community/tavily/src/lib/output-schemas.ts b/packages/pieces/community/tavily/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..07e61998904
--- /dev/null
+++ b/packages/pieces/community/tavily/src/lib/output-schemas.ts
@@ -0,0 +1,147 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+export const tavilyCrawlWebsiteOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'base_url', label: 'Base URL', format: 'url' },
+ {
+ key: 'results',
+ label: 'Results',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'raw_content', label: 'Raw Content' },
+ ],
+ },
+ { key: 'response_time', label: 'Response Time', format: 'number' },
+ { key: 'request_id', label: 'Request ID' },
+ ],
+};
+
+export const extractOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'title', label: 'Title' },
+ { key: 'raw_content', label: 'Raw Content' },
+ { key: 'images', label: 'Images' },
+ ],
+ },
+ {
+ key: 'failed_results',
+ label: 'Failed Results',
+ labelKey: 'url',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'error', label: 'Error' },
+ ],
+ },
+ { key: 'response_time', label: 'Response Time', format: 'number' },
+ { key: 'request_id', label: 'Request ID' },
+ ],
+};
+
+export const tavilyGetResearchTaskOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'content', label: 'Content' },
+ {
+ key: 'sources',
+ label: 'Sources',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'title', label: 'Title' },
+ { key: 'favicon', label: 'Favicon', format: 'url' },
+ ],
+ },
+ { key: 'status', label: 'Status' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ {
+ key: 'usage',
+ label: 'Usage',
+ children: [{ key: 'credits', label: 'Credits', format: 'number' }],
+ },
+ { key: 'response_time', label: 'Response Time', format: 'number' },
+ { key: 'request_id', label: 'Request ID' },
+ ],
+};
+
+export const tavilyMapWebsiteOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'base_url', label: 'Base URL', format: 'url' },
+ { key: 'results', label: 'Results' },
+ { key: 'response_time', label: 'Response Time', format: 'number' },
+ { key: 'request_id', label: 'Request ID' },
+ ],
+};
+
+export const searchOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'query', label: 'Query' },
+ { key: 'follow_up_questions', label: 'Follow Up Questions' },
+ { key: 'answer', label: 'Answer' },
+ { key: 'images', label: 'Images' },
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'title',
+ listItems: [
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'title', label: 'Title' },
+ { key: 'content', label: 'Content' },
+ { key: 'score', label: 'Score', format: 'number' },
+ { key: 'raw_content', label: 'Raw Content' },
+ { key: 'id', label: 'ID' },
+ ],
+ },
+ { key: 'response_time', label: 'Response Time', format: 'number' },
+ { key: 'request_id', label: 'Request ID' },
+ ],
+};
+
+export const tavilyStartResearchTaskOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'status', label: 'Status' },
+ { key: 'input', label: 'Input' },
+ { key: 'model', label: 'Model' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'response_time', label: 'Response Time', format: 'number' },
+ { key: 'request_id', label: 'Request ID' },
+ ],
+};
+
+export const tavilyGetUsageOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'key',
+ label: 'Key',
+ children: [
+ { key: 'usage', label: 'Usage', format: 'number' },
+ { key: 'limit', label: 'Limit', format: 'number' },
+ { key: 'search_usage', label: 'Search Usage', format: 'number' },
+ { key: 'crawl_usage', label: 'Crawl Usage', format: 'number' },
+ { key: 'extract_usage', label: 'Extract Usage', format: 'number' },
+ { key: 'map_usage', label: 'Map Usage', format: 'number' },
+ { key: 'research_usage', label: 'Research Usage', format: 'number' },
+ ],
+ },
+ {
+ key: 'account',
+ label: 'Account',
+ children: [
+ { key: 'current_plan', label: 'Current Plan' },
+ { key: 'plan_usage', label: 'Plan Usage', format: 'number' },
+ { key: 'plan_limit', label: 'Plan Limit', format: 'number' },
+ { key: 'search_usage', label: 'Search Usage', format: 'number' },
+ { key: 'crawl_usage', label: 'Crawl Usage', format: 'number' },
+ { key: 'extract_usage', label: 'Extract Usage', format: 'number' },
+ { key: 'map_usage', label: 'Map Usage', format: 'number' },
+ { key: 'research_usage', label: 'Research Usage', format: 'number' },
+ { key: 'paygo_usage', label: 'Paygo Usage', format: 'number' },
+ { key: 'paygo_limit', label: 'Paygo Limit', format: 'number' },
+ ],
+ },
+ ],
+};