-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support of Serper and Bing search
- Loading branch information
Showing
8 changed files
with
135 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* eslint-disable eqeqeq */ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
/** | ||
* @author Pengfei Ni | ||
* | ||
* @license | ||
* Copyright (c) 2024 - Present, Pengfei Ni | ||
* | ||
* All rights reserved. Code licensed under the ISC license | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
*/ | ||
import { ChatMessageHistory } from "langchain/stores/message/in_memory"; | ||
|
||
export class ModelConfig { | ||
apiKey: string; | ||
apiBaseUrl: string; | ||
maxTokens: number; | ||
temperature: number; | ||
topP: number; | ||
organization: string; | ||
googleCSEApiKey: string; | ||
googleCSEId: string; | ||
serperKey: string; | ||
bingKey: string; | ||
messageHistory: ChatMessageHistory; | ||
|
||
constructor({ apiKey, apiBaseUrl, maxTokens, temperature, topP, organization, googleCSEApiKey, googleCSEId, serperKey, bingKey, messageHistory }: { apiKey: string; apiBaseUrl: string; maxTokens: number; temperature: number; topP: number; organization: string; googleCSEApiKey: string; googleCSEId: string; serperKey: string; bingKey: string; messageHistory: ChatMessageHistory; }) { | ||
this.apiKey = apiKey; | ||
this.apiBaseUrl = apiBaseUrl; | ||
this.maxTokens = maxTokens; | ||
this.temperature = temperature; | ||
this.topP = topP; | ||
this.organization = organization; | ||
this.googleCSEApiKey = googleCSEApiKey; | ||
this.googleCSEId = googleCSEId; | ||
this.serperKey = serperKey; | ||
this.bingKey = bingKey; | ||
this.messageHistory = messageHistory; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters