Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add google gemini #22

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

add google gemini #22

wants to merge 9 commits into from

Conversation

wangzhankun
Copy link

Notice: I have only tests the google gemini, because I have no openai api.

  • create interface AiAssistantInterface as all ai models father class
  • class GoogleGeminiApi and class OpenAIAssistant implements AiAssistantInterface
  • add provider settings and change the default settings into:
const DEFAULT_SETTINGS: Settings = {
	provider: "openai",
	assistantSettings: new Map<string, AiAssistantSettings>([
		["openai", {
			apiKey: "",
			modelName: "gpt-3.5-turbo",
			imageModelName: "dall-e-3",
			maxTokens: 500,
			replaceSelection: true,
			imgFolder: "AiAssistant/Assets",
			language: "",
		}],
		[
			"google", {
				apiKey: "AIzaSyAthMXmBkx4E7S7E9pdzo7xUiVShxvCj5A",
				modelName: "gemini-pro",
				imageModelName: "gemini-pro-vision",
				maxTokens: 1000,
				replaceSelection: true,
				imgFolder: "AiAssistant/Assets",
				language: "",
			}
		]
	])
};
  • to select model from setting tab for different provider, implement GoogleGeminiSettingTab in src/google_gemini_api.ts and OpenaiSettingTab in src/openai_api.ts

@wangzhankun wangzhankun mentioned this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant