mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
Remove azure models (#297)
This commit is contained in:
parent
01abcb7014
commit
dcf749b96d
5 changed files with 13 additions and 25 deletions
|
|
@ -189,6 +189,6 @@ export default class ChatModelManager {
|
|||
}
|
||||
|
||||
async countTokens(inputStr: string): Promise<number> {
|
||||
return ChatModelManager.chatOpenAI.getNumTokens(inputStr);
|
||||
return ChatModelManager.chatModel.getNumTokens(inputStr);
|
||||
}
|
||||
}
|
||||
|
|
@ -113,14 +113,7 @@ const ChatIcons: React.FC<ChatIconsProps> = ({
|
|||
<option value={ChatModelDisplayNames.GPT_4}>{ChatModelDisplayNames.GPT_4}</option>
|
||||
<option value={ChatModelDisplayNames.GPT_4_TURBO}>{ChatModelDisplayNames.GPT_4_TURBO}</option>
|
||||
<option value={ChatModelDisplayNames.GPT_4_32K}>{ChatModelDisplayNames.GPT_4_32K}</option>
|
||||
{/* <option value={ChatModelDisplayNames.CLAUDE_1}>{ChatModelDisplayNames.CLAUDE_1}</option>
|
||||
<option value={ChatModelDisplayNames.CLAUDE_1_100K}>{ChatModelDisplayNames.CLAUDE_1_100K}</option>
|
||||
<option value={ChatModelDisplayNames.CLAUDE_INSTANT_1}>{ChatModelDisplayNames.CLAUDE_INSTANT_1}</option>
|
||||
<option value={ChatModelDisplayNames.CLAUDE_INSTANT_1_100K}>{ChatModelDisplayNames.CLAUDE_INSTANT_1_100K}</option> */}
|
||||
<option value={ChatModelDisplayNames.AZURE_GPT_35_TURBO}>{ChatModelDisplayNames.AZURE_GPT_35_TURBO}</option>
|
||||
<option value={ChatModelDisplayNames.AZURE_GPT_35_TURBO_16K}>{ChatModelDisplayNames.AZURE_GPT_35_TURBO_16K}</option>
|
||||
<option value={ChatModelDisplayNames.AZURE_GPT_4}>{ChatModelDisplayNames.AZURE_GPT_4}</option>
|
||||
<option value={ChatModelDisplayNames.AZURE_GPT_4_32K}>{ChatModelDisplayNames.AZURE_GPT_4_32K}</option>
|
||||
<option value={ChatModelDisplayNames.AZURE_OPENAI}>{ChatModelDisplayNames.AZURE_OPENAI}</option>
|
||||
<option value={ChatModelDisplayNames.GEMINI_PRO}>{ChatModelDisplayNames.GEMINI_PRO}</option>
|
||||
<option value={ChatModelDisplayNames.OPENROUTERAI}>{ChatModelDisplayNames.OPENROUTERAI}</option>
|
||||
<option value={ChatModelDisplayNames.LM_STUDIO}>{ChatModelDisplayNames.LM_STUDIO}</option>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ export enum ChatModels {
|
|||
GPT_4 = 'gpt-4',
|
||||
GPT_4_TURBO = 'gpt-4-turbo-preview',
|
||||
GPT_4_32K = 'gpt-4-32k',
|
||||
AZURE_GPT_35_TURBO = 'gpt-35-turbo',
|
||||
AZURE_GPT_35_TURBO_16K = 'gpt-35-turbo-16k',
|
||||
GEMINI_PRO = 'gemini-pro',
|
||||
OLLAMA = 'ollama',
|
||||
}
|
||||
|
|
@ -23,10 +21,7 @@ export enum ChatModelDisplayNames {
|
|||
GPT_4 = 'GPT-4',
|
||||
GPT_4_TURBO = 'GPT-4 TURBO',
|
||||
GPT_4_32K = 'GPT-4 32K',
|
||||
AZURE_GPT_35_TURBO = 'AZURE GPT-3.5',
|
||||
AZURE_GPT_35_TURBO_16K = 'AZURE GPT-3.5-16K',
|
||||
AZURE_GPT_4 = 'AZURE GPT-4',
|
||||
AZURE_GPT_4_32K = 'AZURE GPT-4 32K',
|
||||
AZURE_OPENAI = 'AZURE OPENAI',
|
||||
GEMINI_PRO = 'GEMINI PRO',
|
||||
OPENROUTERAI = 'OPENROUTER.AI',
|
||||
OLLAMA = 'OLLAMA (LOCAL)',
|
||||
|
|
@ -43,10 +38,7 @@ export const OPENAI_MODELS = new Set([
|
|||
]);
|
||||
|
||||
export const AZURE_MODELS = new Set([
|
||||
ChatModelDisplayNames.AZURE_GPT_35_TURBO,
|
||||
ChatModelDisplayNames.AZURE_GPT_35_TURBO_16K,
|
||||
ChatModelDisplayNames.AZURE_GPT_4,
|
||||
ChatModelDisplayNames.AZURE_GPT_4_32K,
|
||||
ChatModelDisplayNames.AZURE_OPENAI,
|
||||
]);
|
||||
|
||||
export const GOOGLE_MODELS = new Set([
|
||||
|
|
@ -71,10 +63,7 @@ export const DISPLAY_NAME_TO_MODEL: Record<string, string> = {
|
|||
[ChatModelDisplayNames.GPT_4]: ChatModels.GPT_4,
|
||||
[ChatModelDisplayNames.GPT_4_TURBO]: ChatModels.GPT_4_TURBO,
|
||||
[ChatModelDisplayNames.GPT_4_32K]: ChatModels.GPT_4_32K,
|
||||
[ChatModelDisplayNames.AZURE_GPT_35_TURBO]: ChatModels.AZURE_GPT_35_TURBO,
|
||||
[ChatModelDisplayNames.AZURE_GPT_35_TURBO_16K]: ChatModels.AZURE_GPT_35_TURBO_16K,
|
||||
[ChatModelDisplayNames.AZURE_GPT_4]: ChatModels.GPT_4,
|
||||
[ChatModelDisplayNames.AZURE_GPT_4_32K]: ChatModels.GPT_4_32K,
|
||||
[ChatModelDisplayNames.AZURE_OPENAI]: 'azure_openai',
|
||||
[ChatModelDisplayNames.GEMINI_PRO]: ChatModels.GEMINI_PRO,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ const ApiSettings: React.FC<ApiSettingsProps> = ({
|
|||
/>
|
||||
<ApiSetting
|
||||
title="Azure OpenAI API Deployment Name"
|
||||
description="This is your actual model, no need to pass a model name separately."
|
||||
value={azureOpenAIApiDeploymentName}
|
||||
setValue={setAzureOpenAIApiDeploymentName}
|
||||
placeholder="Enter Azure OpenAI API Deployment Name"
|
||||
|
|
|
|||
|
|
@ -183,12 +183,17 @@ export function sendNotesContentPrompt(notes: { name: string; content: string }[
|
|||
}
|
||||
|
||||
function getNoteTitleAndTags(noteWithTag: { name: string; content: string, tags?: string[] }): string {
|
||||
return `[[${noteWithTag.name}]]` + (noteWithTag.tags ? `\ntags: ${noteWithTag.tags.join(',')}` : '');
|
||||
return (
|
||||
`[[${noteWithTag.name}]]` +
|
||||
(noteWithTag.tags && noteWithTag.tags.length > 0
|
||||
? `\ntags: ${noteWithTag.tags.join(",")}`
|
||||
: "")
|
||||
);
|
||||
}
|
||||
|
||||
function getChatContextStr(chatNoteContextPath: string, chatNoteContextTags: string[]): string {
|
||||
const pathStr = (chatNoteContextPath ? `\nChat context by path: ${chatNoteContextPath}` : '');
|
||||
const tagsStr = (chatNoteContextTags ? `\nChat context by tags: ${chatNoteContextTags}` : '');
|
||||
const tagsStr = (chatNoteContextTags?.length > 0 ? `\nChat context by tags: ${chatNoteContextTags}` : '');
|
||||
return pathStr + tagsStr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue