forked from logancyang/obsidian-copilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v2.4.9] Add openrouter support (logancyang#234)
- Loading branch information
1 parent
0c5e75e
commit 195c7de
Showing
10 changed files
with
161 additions
and
67 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,56 @@ | ||
import { ChainType } from '@/chainFactory'; | ||
import { ChatPromptTemplate } from "langchain/prompts"; | ||
|
||
export interface ModelConfig { | ||
modelName: string, | ||
temperature: number, | ||
streaming: boolean, | ||
maxRetries: number, | ||
maxConcurrency: number, | ||
maxTokens?: number, | ||
openAIApiKey?: string, | ||
anthropicApiKey?: string, | ||
azureOpenAIApiKey?: string, | ||
azureOpenAIApiInstanceName?: string, | ||
azureOpenAIApiDeploymentName?: string, | ||
azureOpenAIApiVersion?: string, | ||
// Google and TogetherAI API key share this property | ||
apiKey?: string, | ||
openAIProxyBaseUrl?: string, | ||
ollamaModel?: string, | ||
openRouterModel?: string, | ||
lmStudioPort?: string, | ||
} | ||
|
||
export interface LangChainParams { | ||
openAIApiKey: string, | ||
huggingfaceApiKey: string, | ||
cohereApiKey: string, | ||
anthropicApiKey: string, | ||
azureOpenAIApiKey: string, | ||
azureOpenAIApiInstanceName: string, | ||
azureOpenAIApiDeploymentName: string, | ||
azureOpenAIApiVersion: string, | ||
azureOpenAIApiEmbeddingDeploymentName: string, | ||
googleApiKey: string, | ||
openRouterAiApiKey: string, | ||
model: string, | ||
modelDisplayName: string, | ||
temperature: number, | ||
maxTokens: number, | ||
systemMessage: string, | ||
chatContextTurns: number, | ||
embeddingProvider: string, | ||
chainType: ChainType, // Default ChainType is set in main.ts getAIStateParams | ||
options: SetChainOptions, | ||
ollamaModel: string, | ||
openRouterModel: string, | ||
lmStudioPort: string, | ||
openAIProxyBaseUrl?: string, | ||
} | ||
|
||
export interface SetChainOptions { | ||
prompt?: ChatPromptTemplate; | ||
noteContent?: string; | ||
forceNewCreation?: boolean; | ||
} |
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
Oops, something went wrong.