-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TUCEGA
authored and
TUCEGA
committed
Feb 23, 2024
1 parent
71401c1
commit 8d2b345
Showing
6 changed files
with
42 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ChatGoogleGenerativeAI } from '@langchain/google-genai'; | ||
import { IChatConfig, ILLMConfig } from '../../interface/agent.interface'; | ||
|
||
class GoogleLLMService { | ||
private _chatSettings: IChatConfig; | ||
private _llmSettings: ILLMConfig; | ||
|
||
constructor(chatSettings: IChatConfig, llmSettings: ILLMConfig) { | ||
this._chatSettings = chatSettings; | ||
this._llmSettings = llmSettings; | ||
} | ||
|
||
public build(): ChatGoogleGenerativeAI { | ||
return new ChatGoogleGenerativeAI({ | ||
temperature: this._chatSettings.temperature, | ||
modelName: this._llmSettings.model, | ||
apiKey: this._llmSettings.apiKey, | ||
maxOutputTokens: 2048, | ||
streaming: true, | ||
}); | ||
} | ||
} | ||
|
||
export default GoogleLLMService; |
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