Skip to content

Commit 382a5bd

Browse files
committed
feat(exa): add date filters to search
1 parent af84019 commit 382a5bd

4 files changed

Lines changed: 76 additions & 0 deletions

File tree

apps/docs/content/docs/en/tools/exa.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ Search the web using Exa AI. Returns relevant search results with titles, URLs,
5454
| `highlights` | boolean | No | Include highlighted snippets in results \(default: false\) |
5555
| `summary` | boolean | No | Include AI-generated summaries in results \(default: false\) |
5656
| `livecrawl` | string | No | Live crawling mode: never \(default\), fallback, always, or preferred \(always try livecrawl, fall back to cache if fails\) |
57+
| `startCrawlDate` | string | No | Only include results crawled on or after this ISO 8601 date \(e.g., "2024-01-01" or "2024-01-01T00:00:00.000Z"\) |
58+
| `endCrawlDate` | string | No | Only include results crawled on or before this ISO 8601 date |
59+
| `startPublishedDate` | string | No | Only include results published on or after this ISO 8601 date |
60+
| `endPublishedDate` | string | No | Only include results published on or before this ISO 8601 date |
5761
| `apiKey` | string | Yes | Exa AI API Key |
5862
| `pricing` | custom | No | No description |
5963
| `metadata` | string | No | No description |

apps/sim/blocks/blocks/exa.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,38 @@ export const ExaBlock: BlockConfig<ExaResponse> = {
136136
condition: { field: 'operation', value: 'exa_search' },
137137
mode: 'advanced',
138138
},
139+
{
140+
id: 'startPublishedDate',
141+
title: 'Start Published Date',
142+
type: 'short-input',
143+
placeholder: '2024-01-01 or 2024-01-01T00:00:00.000Z',
144+
condition: { field: 'operation', value: 'exa_search' },
145+
mode: 'advanced',
146+
},
147+
{
148+
id: 'endPublishedDate',
149+
title: 'End Published Date',
150+
type: 'short-input',
151+
placeholder: '2024-12-31 or 2024-12-31T23:59:59.999Z',
152+
condition: { field: 'operation', value: 'exa_search' },
153+
mode: 'advanced',
154+
},
155+
{
156+
id: 'startCrawlDate',
157+
title: 'Start Crawl Date',
158+
type: 'short-input',
159+
placeholder: '2024-01-01 or 2024-01-01T00:00:00.000Z',
160+
condition: { field: 'operation', value: 'exa_search' },
161+
mode: 'advanced',
162+
},
163+
{
164+
id: 'endCrawlDate',
165+
title: 'End Crawl Date',
166+
type: 'short-input',
167+
placeholder: '2024-12-31 or 2024-12-31T23:59:59.999Z',
168+
condition: { field: 'operation', value: 'exa_search' },
169+
mode: 'advanced',
170+
},
139171
// Get Contents operation inputs
140172
{
141173
id: 'urls',
@@ -385,6 +417,10 @@ export const ExaBlock: BlockConfig<ExaResponse> = {
385417
highlights: { type: 'boolean', description: 'Include highlights' },
386418
summary: { type: 'boolean', description: 'Include summary' },
387419
livecrawl: { type: 'string', description: 'Live crawl mode' },
420+
startCrawlDate: { type: 'string', description: 'Earliest crawl date (ISO 8601)' },
421+
endCrawlDate: { type: 'string', description: 'Latest crawl date (ISO 8601)' },
422+
startPublishedDate: { type: 'string', description: 'Earliest published date (ISO 8601)' },
423+
endPublishedDate: { type: 'string', description: 'Latest published date (ISO 8601)' },
388424
// Get Contents operation
389425
urls: { type: 'string', description: 'URLs to retrieve' },
390426
summaryQuery: { type: 'string', description: 'Summary query guidance' },

apps/sim/tools/exa/search.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,31 @@ export const searchTool: ToolConfig<ExaSearchParams, ExaSearchResponse> = {
7979
description:
8080
'Live crawling mode: never (default), fallback, always, or preferred (always try livecrawl, fall back to cache if fails)',
8181
},
82+
startCrawlDate: {
83+
type: 'string',
84+
required: false,
85+
visibility: 'user-or-llm',
86+
description:
87+
'Only include results crawled on or after this ISO 8601 date (e.g., "2024-01-01" or "2024-01-01T00:00:00.000Z")',
88+
},
89+
endCrawlDate: {
90+
type: 'string',
91+
required: false,
92+
visibility: 'user-or-llm',
93+
description: 'Only include results crawled on or before this ISO 8601 date',
94+
},
95+
startPublishedDate: {
96+
type: 'string',
97+
required: false,
98+
visibility: 'user-or-llm',
99+
description: 'Only include results published on or after this ISO 8601 date',
100+
},
101+
endPublishedDate: {
102+
type: 'string',
103+
required: false,
104+
visibility: 'user-or-llm',
105+
description: 'Only include results published on or before this ISO 8601 date',
106+
},
82107
apiKey: {
83108
type: 'string',
84109
required: true,
@@ -140,6 +165,12 @@ export const searchTool: ToolConfig<ExaSearchParams, ExaSearchResponse> = {
140165
// Category filtering
141166
if (params.category) body.category = params.category
142167

168+
// Date filtering
169+
if (params.startCrawlDate) body.startCrawlDate = params.startCrawlDate
170+
if (params.endCrawlDate) body.endCrawlDate = params.endCrawlDate
171+
if (params.startPublishedDate) body.startPublishedDate = params.startPublishedDate
172+
if (params.endPublishedDate) body.endPublishedDate = params.endPublishedDate
173+
143174
// Build contents object for content options
144175
const contents: Record<string, any> = {}
145176

apps/sim/tools/exa/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export interface ExaSearchParams extends ExaBaseParams {
3737
summary?: boolean | { query?: string }
3838
// Live crawl mode
3939
livecrawl?: 'always' | 'fallback' | 'never'
40+
// Date filters (ISO 8601)
41+
startCrawlDate?: string
42+
endCrawlDate?: string
43+
startPublishedDate?: string
44+
endPublishedDate?: string
4045
}
4146

4247
export interface ExaSearchResult {

0 commit comments

Comments
 (0)