Skip to content

Update Exa Search tool to current API#6407

Open
10ishq wants to merge 3 commits into
FlowiseAI:mainfrom
10ishq:exa-api-modernize
Open

Update Exa Search tool to current API#6407
10ishq wants to merge 3 commits into
FlowiseAI:mainfrom
10ishq:exa-api-modernize

Conversation

@10ishq
Copy link
Copy Markdown

@10ishq 10ishq commented May 18, 2026

Updates the Exa Search node to current API conventions:

  • Search types updated to auto, fast, instant, deep (removed keyword/neural)
  • Categories limited to the current 6
  • Added maxAgeHours parameter
  • Removed useAutoprompt from UI
  • Added x-exa-integration: flowise-integration header

10ishq and others added 2 commits May 13, 2026 16:56
…ation header

- Search types: auto/fast/instant/deep (removed keyword/neural)
- Categories: exactly 6 (company, people, research paper, news, personal site, financial report)
- Removed useAutoprompt from UI
- Added maxAgeHours for freshness control
- Added x-exa-integration: flowise-integration header

Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>
Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the ExaSearch tool by adding new search types and a maxAgeHours parameter, while removing the useAutoprompt option and refining categories. Feedback indicates that the integration header implementation may be non-functional due to SDK limitations. Additionally, suggestions were made to improve type safety for search parameters and to trim whitespace when parsing domain lists.

Comment on lines +200 to +203
;(client as any).headers = {
...(client as any).headers,
'x-exa-integration': 'flowise-integration'
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Exa client from the exa-js library does not typically expose or utilize a headers property on the instance for its requests. The internal request method in the SDK usually constructs headers dynamically using only the apiKey. Consequently, setting (client as any).headers is likely non-functional, and the x-exa-integration header will not be sent to the API.

If the SDK version used does not support custom headers in the constructor or via a public property, this integration tracking might not be achievable through the SDK instance directly. You should verify if the header is actually being sent in your tests.

const numResults = nodeData.inputs?.numResults as string
const type = nodeData.inputs?.type as 'keyword' | 'neural' | 'auto' | undefined
const useAutoprompt = nodeData.inputs?.useAutoprompt as boolean
const type = nodeData.inputs?.type as string | undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The type for type has been generalized to string | undefined, which reduces type safety. Since the supported search types are now a fixed set, it is better to use a union of the allowed string literals to maintain compile-time validation.

Suggested change
const type = nodeData.inputs?.type as string | undefined
const type = nodeData.inputs?.type as 'auto' | 'fast' | 'instant' | 'deep' | undefined

Comment on lines 211 to 212
includeDomains: includeDomains ? includeDomains.split(',') : undefined,
excludeDomains: excludeDomains ? excludeDomains.split(',') : undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When splitting domains by comma, users might include spaces (e.g., "example.com, test.com"). It is recommended to trim each domain string to ensure the API receives clean values without leading or trailing whitespace. This approach of using simple, chained operations improves readability and reduces potential errors.

Suggested change
includeDomains: includeDomains ? includeDomains.split(',') : undefined,
excludeDomains: excludeDomains ? excludeDomains.split(',') : undefined,
includeDomains: includeDomains ? includeDomains.split(',').map((d) => d.trim()) : undefined,
excludeDomains: excludeDomains ? excludeDomains.split(',').map((d) => d.trim()) : undefined,
References
  1. Prioritize code readability and understandability over conciseness. A series of simple, chained operations can be preferable to a single, more complex one if it improves understandability and reduces the potential for future errors.

Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant