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: added a check for api keys and baseURL's #855

Closed
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions app/components/chat/BaseChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,25 @@

const handleSendMessage = (event: React.UIEvent, messageInput?: string) => {
if (sendMessage) {
// Check if provider exists and is not experimental
if (provider) {
const isExperimental = ['Ollama', 'LMStudio', 'OpenAILike'].includes(provider.name);

if (isExperimental) {
// For experimental providers, check if base URL is set
if (!provider.settings?.baseUrl) {

Check failure on line 219 in app/components/chat/BaseChat.tsx

View workflow job for this annotation

GitHub Actions / Test

Property 'settings' does not exist on type 'ProviderInfo'.
toast.error(`Please set a base URL for ${provider.name} in the model settings`);

Check failure on line 220 in app/components/chat/BaseChat.tsx

View workflow job for this annotation

GitHub Actions / Test

Property 'settings' does not exist on type 'ProviderInfo'.
return;
}
} else {
// For non-experimental providers, check if API key is set
if (!apiKeys[provider.name]) {
toast.error(`Please set an API key for ${provider.name} in the model settings`);
return;
}
}
}

sendMessage(event, messageInput);

if (recognition) {
Expand Down
Loading