fix: websearch multiple apikeys bug
This commit is contained in:
parent
c8983f3000
commit
9cb127f14e
@ -8,10 +8,10 @@ export default class ExaProvider extends BaseWebSearchProvider {
|
|||||||
|
|
||||||
constructor(provider: WebSearchProvider) {
|
constructor(provider: WebSearchProvider) {
|
||||||
super(provider)
|
super(provider)
|
||||||
if (!provider.apiKey) {
|
if (!this.apiKey) {
|
||||||
throw new Error('API key is required for Exa provider')
|
throw new Error('API key is required for Exa provider')
|
||||||
}
|
}
|
||||||
this.exa = new ExaClient({ apiKey: provider.apiKey })
|
this.exa = new ExaClient({ apiKey: this.apiKey })
|
||||||
}
|
}
|
||||||
|
|
||||||
public async search(query: string, maxResults: number): Promise<WebSearchResponse> {
|
public async search(query: string, maxResults: number): Promise<WebSearchResponse> {
|
||||||
|
|||||||
@ -8,10 +8,10 @@ export default class TavilyProvider extends BaseWebSearchProvider {
|
|||||||
|
|
||||||
constructor(provider: WebSearchProvider) {
|
constructor(provider: WebSearchProvider) {
|
||||||
super(provider)
|
super(provider)
|
||||||
if (!provider.apiKey) {
|
if (!this.apiKey) {
|
||||||
throw new Error('API key is required for Tavily provider')
|
throw new Error('API key is required for Tavily provider')
|
||||||
}
|
}
|
||||||
this.tvly = new TavilyClient({ apiKey: provider.apiKey })
|
this.tvly = new TavilyClient({ apiKey: this.apiKey })
|
||||||
}
|
}
|
||||||
|
|
||||||
public async search(query: string, maxResults: number, excludeDomains: string[]): Promise<WebSearchResponse> {
|
public async search(query: string, maxResults: number, excludeDomains: string[]): Promise<WebSearchResponse> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user