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

feat(Google): Support all Text/Chat Models, Server Response streaming, PaLM -> Google 🤖 #1316

Merged
merged 26 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
605b688
feat: update PaLM icons
danny-avila Dec 8, 2023
e9e74b9
feat: add additional google models
danny-avila Dec 8, 2023
3f818db
POC: formatting inputs for Vertex AI streaming
danny-avila Dec 8, 2023
bfe8a77
refactor: move endpoints services outside of /routes dir to /services…
danny-avila Dec 9, 2023
2a58b1b
refactor: shorten schemas import
danny-avila Dec 9, 2023
5d9af57
refactor: rename PALM to GOOGLE
danny-avila Dec 9, 2023
bdd3444
feat: make Google editable endpoint
danny-avila Dec 9, 2023
47f70d1
feat: reusable Ask and Edit controllers based off Anthropic
danny-avila Dec 9, 2023
c4aa488
chore: organize imports/logic
danny-avila Dec 9, 2023
809aa0b
fix(parseConvo): include examples in googleSchema
danny-avila Dec 9, 2023
9237641
fix: google only allows odd number of messages to be sent
danny-avila Dec 9, 2023
c4ecf85
fix: pass proxy to AnthropicClient
danny-avila Dec 9, 2023
d31377b
refactor: change `google` altName to `Google`
danny-avila Dec 9, 2023
dbf5c91
refactor: update getModelMaxTokens and related functions to handle ma…
danny-avila Dec 9, 2023
b2dd4a9
refactor: google Icon and response sender changes (Codey and Google l…
danny-avila Dec 9, 2023
9a754af
feat: google support for maxTokensMap
danny-avila Dec 9, 2023
945e878
feat: google updated endpoints with Ask/Edit controllers, buildOption…
danny-avila Dec 9, 2023
c0dbe2b
feat(GoogleClient): now builds prompt for text models and supports re…
danny-avila Dec 9, 2023
9b1fafb
chore(GoogleClient): remove comments, left before for reference in gi…
danny-avila Dec 9, 2023
c481844
docs: update google instructions (WIP)
danny-avila Dec 9, 2023
d0f33c8
docs(apis_and_tokens.md): add images to google instructions
danny-avila Dec 9, 2023
cd8ebd4
docs: remove typo apis_and_tokens.md
danny-avila Dec 9, 2023
29392cb
Update apis_and_tokens.md
danny-avila Dec 9, 2023
1e45b93
feat(Google): use default settings map, fully support context for bot…
danny-avila Dec 10, 2023
fd9c0d2
chore: update more PaLM references to Google
danny-avila Dec 10, 2023
447eaf4
chore: move playwright out of workflows to avoid failing tests
danny-avila Dec 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ DEBUG_OPENAI=false
# OPENROUTER_API_KEY=

#============#
# PaLM #
# Google #
#============#

PALM_KEY=user_provided
GOOGLE_KEY=user_provided
# GOOGLE_REVERSE_PROXY=

#============#
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- 🌎 Multilingual UI:
- English, 中文, Deutsch, Español, Français, Italiano, Polski, Português Brasileiro, Русский
- 日本語, Svenska, 한국어, Tiếng Việt, 繁體中文, العربية, Türkçe, Nederlands
- 🤖 AI model selection: OpenAI API, Azure, BingAI, ChatGPT Browser, PaLM2, Anthropic (Claude), Plugins
- 🤖 AI model selection: OpenAI API, Azure, BingAI, ChatGPT, Google Vertex AI, Anthropic (Claude), Plugins
- 💾 Create, Save, & Share Custom Presets
- 🔄 Edit, Resubmit, and Continue messages with conversation branching
- 📤 Export conversations as screenshots, markdown, text, json.
Expand Down
5 changes: 3 additions & 2 deletions api/app/clients/AnthropicClient.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Anthropic = require('@anthropic-ai/sdk');
const { encoding_for_model: encodingForModel, get_encoding: getEncoding } = require('tiktoken');
const { getResponseSender, EModelEndpoint } = require('~/server/routes/endpoints/schemas');
const { getResponseSender, EModelEndpoint } = require('~/server/services/Endpoints');
const { getModelMaxTokens } = require('~/utils');
const BaseClient = require('./BaseClient');

Expand Down Expand Up @@ -46,7 +46,8 @@ class AnthropicClient extends BaseClient {
stop: modelOptions.stop, // no stop method for now
};

this.maxContextTokens = getModelMaxTokens(this.modelOptions.model) ?? 100000;
this.maxContextTokens =
getModelMaxTokens(this.modelOptions.model, EModelEndpoint.anthropic) ?? 100000;
this.maxResponseTokens = this.modelOptions.maxOutputTokens || 1500;
this.maxPromptTokens =
this.options.maxPromptTokens || this.maxContextTokens - this.maxResponseTokens;
Expand Down
1 change: 1 addition & 0 deletions api/app/clients/BaseClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ class BaseClient {
amount: promptTokens,
debug: this.options.debug,
model: this.modelOptions.model,
endpoint: this.options.endpoint,
},
});
}
Expand Down
Loading
Loading