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

Feature/remote ai services #163

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9e8af34
Removed unused var
sebiweise Dec 13, 2023
257320b
Added Azure as a new vendor
sebiweise Dec 13, 2023
aa15a86
Removed logging
sebiweise Dec 13, 2023
d61fae2
Added anthropic sdk
sebiweise Dec 13, 2023
3d40b94
Build fix getOpenAiClient
sebiweise Dec 13, 2023
4a1b266
Ai vendor refactoring
sebiweise Dec 14, 2023
8e367d0
PossibleModels changed to array
sebiweise Dec 14, 2023
a767da1
turbo update
sebiweise Dec 14, 2023
fd01e32
Added advanced settings accordion
sebiweise Dec 15, 2023
47248d7
Reafactoring some ui elements (toasts, modelselect)
sebiweise Dec 15, 2023
838a346
toast fix
sebiweise Dec 15, 2023
85f8b6e
Textarea && tooltip update
sebiweise Dec 15, 2023
d5afc6f
SettingsPage to SettingsDialog
sebiweise Dec 15, 2023
92b5344
Added new env vars to configure "advancedSettings"
sebiweise Dec 15, 2023
d1d9573
Added cards to settings
sebiweise Dec 15, 2023
6be2fc7
Added ai-services endpoint
sebiweise Dec 22, 2023
91fb1f6
Added endpoint url var
sebiweise Dec 22, 2023
e54942b
Removed logging
sebiweise Dec 22, 2023
0577955
Removed fixed aiModelSettings
sebiweise Dec 22, 2023
399e0b9
Ui hook fix
sebiweise Dec 22, 2023
5a5c88e
Merge branch 'dev' into feature/remote_ai_services
sebiweise Dec 22, 2023
7669c9e
Added Google Ai Services
sebiweise Dec 25, 2023
6afc7e0
doc link fix
sebiweise Dec 25, 2023
409426d
Refactoring
sebiweise Dec 26, 2023
ab507b9
Moved unsaged folder
sebiweise Dec 26, 2023
28b6e77
Merge branch 'dev' into feature/remote_ai_services
sebiweise Dec 26, 2023
453af93
Added shared ui package
sebiweise Dec 26, 2023
c77930b
Merge branch 'dev' into feature/remote_ai_services
sebiweise Dec 27, 2023
05f861a
Build fix web
sebiweise Dec 27, 2023
5a87e6c
Build fix desktop
sebiweise Dec 27, 2023
92bdba8
ci build fix
sebiweise Dec 27, 2023
b4237ff
Style update
sebiweise Dec 27, 2023
3a98970
Added dropdown menu
sebiweise Dec 27, 2023
4b257f6
Build time fix
sebiweise Dec 28, 2023
6ae0388
Merge branch 'dev' into feature/remote_ai_services
sebiweise Dec 28, 2023
2615e3b
Tailwind style fix
sebiweise Dec 28, 2023
565cab3
Removed shared ui package
sebiweise Dec 28, 2023
1c95ea8
Revert "Removed shared ui package"
jorge-menjivar Dec 29, 2023
1664c98
Only using tailwind on the components dir
jorge-menjivar Dec 29, 2023
1a5cb45
Merge pull request #1 from jorge-menjivar/remote_ai_services
sebiweise Dec 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/desktop/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { AxiomWebVitals } from 'next-axiom';

import { DEFAULT_DESCRIPTION, DEFAULT_TITLE } from '@/utils/app/const';

import { ThemeProvider } from '@/components/common/ui/theme-provider';
import { ThemeProvider } from '@ui/components/ui/theme-provider';

import '@/styles/globals.css';
import '@ui/styles/globals.css';

export const metadata: Metadata = {
title: DEFAULT_TITLE,
Expand Down
57 changes: 0 additions & 57 deletions apps/desktop/components/common/ui/button.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions apps/desktop/components/common/ui/input.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions apps/desktop/components/common/ui/textarea.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { useTranslation } from 'next-i18next';
import { Message } from '@/types/chat';
import { Template } from '@/types/templates';

import { Button } from '@/components/common/ui/button';
import { Textarea } from '@/components/common/ui/textarea';
import { Button } from '@ui/components/ui/button';
import { Textarea } from '@ui/components/ui/textarea';

import ChatContext from './chat.context';
import { TemplateListComponent } from './template-list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { useTranslation } from 'next-i18next';

import { Message } from '@/types/chat';

import { Button } from '@/components/common/ui/button';
import { Textarea } from '@/components/common/ui/textarea';
import { Button } from '@ui/components/ui/button';
import { Textarea } from '@ui/components/ui/textarea';
import { CodeBlock } from '@/components/markdown/code-block';

import ChatContext from './chat.context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const Chat = memo(() => {
);

chatDispatch({
type: 'change',
field: 'selectedConversationMessages',
value: _conversationMessages,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { useContext } from 'react';

import { DefaultValues, Setting } from '@/types/settings';

import { Input } from '@/components/common/ui/input';
import { Input } from '@ui/components/ui/input';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/components/common/ui/select';
} from '@ui/components/ui/select';

import SettingsContext from '../settings.context';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ export const Settings = () => {
}, [searchQuery, settingsDispatch]);

const doSearch = (query: string) =>
settingsDispatch({ field: 'searchQuery', value: query });
settingsDispatch({type: 'change', field: 'searchQuery', value: query });

const handleSelect = (settingId: string) => {
settingsDispatch({
type: 'change',
field: 'selectedSettingId',
value: settingId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ActivityBar = ({ icons }: { icons: JSX.Element[] }) => {
setShowPrimaryMenu(true);
localSaveShowPrimaryMenu(!showPrimaryMenu);
}
primaryMenuDispatch({ field: 'selectedIndex', value: index });
primaryMenuDispatch({ type: 'change', field: 'selectedIndex', value: index });
};

const handleSignOut = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ConversationList } from './components/conversation-list';
import { ConversationsSettings } from './components/conversations-settings';
import { ConversationsFolders } from './components/folders';
import Search from '@/components/common/Search';
import { Button } from '@/components/common/ui/button';
import { Button } from '@ui/components/ui/button';

import ConversationsContext from './conversations.context';
import { ConversationsInitialState, initialState } from './conversations.state';
Expand Down Expand Up @@ -92,6 +92,7 @@ export const Conversations = () => {
useEffect(() => {
if (searchTerm) {
chatDispatch({
type: 'change',
field: 'filteredConversations',
value: conversations.filter((conversation) => {
const conversationMessages = messages.filter(
Expand All @@ -107,14 +108,15 @@ export const Conversations = () => {
});
} else {
chatDispatch({
type: 'change',
field: 'filteredConversations',
value: conversations,
});
}
}, [searchTerm, conversations, chatDispatch, messages]);

const doSearch = (term: string) =>
chatDispatch({ field: 'searchTerm', value: term });
chatDispatch({ type: 'change', field: 'searchTerm', value: term });

const allowDrop = (e: any) => {
e.stopPropagation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const SystemPromptComponent = ({ systemPrompt }: Props) => {

if (isDeleting) {
deleteSystemPrompt(systemPrompt.id);
promptDispatch({ field: 'searchTerm', value: '' });
promptDispatch({ type: 'change', field: 'searchTerm', value: '' });
}

setIsDeleting(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useTranslation } from 'next-i18next';

import { SystemPrompt } from '@/types/system-prompt';

import { Button } from '@/components/common/ui/button';
import { Button } from '@ui/components/ui/button';
import { PrimaryLabel } from '@/components/common/ui/primary-label';

import { ChipList } from './models-list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useCreateReducer } from '@/hooks/useCreateReducer';
import { SystemPromptFolders } from './components/folders';
import { SystemPromptList } from './components/system-prompt-list';
import Search from '@/components/common/Search';
import { Button } from '@/components/common/ui/button';
import { Button } from '@ui/components/ui/button';

import SystemPromptsContext from './system-prompts.context';
import {
Expand Down Expand Up @@ -58,6 +58,7 @@ const SystemPrompts = () => {
useEffect(() => {
if (searchTerm) {
promptDispatch({
type: 'change',
field: 'filteredSystemPrompts',
value: systemPrompts.filter((systemPrompt) => {
const searchable =
Expand All @@ -71,6 +72,7 @@ const SystemPrompts = () => {
});
} else {
promptDispatch({
type: 'change',
field: 'filteredSystemPrompts',
value: systemPrompts,
});
Expand All @@ -91,7 +93,7 @@ const SystemPrompts = () => {
};

const doSearch = (term: string) =>
promptDispatch({ field: 'searchTerm', value: term });
promptDispatch({ type: 'change', field: 'searchTerm', value: term });

const handleDragEnter = (e: any) => {
e.target.style.background = '#343541';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ export const TemplateComponent = ({ template }: Props) => {

const handleUpdate = (template: Template) => {
updateTemplate(template);
promptDispatch({ field: 'searchTerm', value: '' });
promptDispatch({ type: 'change', field: 'searchTerm', value: '' });
};

const handleDelete: MouseEventHandler<HTMLButtonElement> = (e) => {
e.stopPropagation();

if (isDeleting) {
deleteTemplate(template);
promptDispatch({ field: 'searchTerm', value: '' });
promptDispatch({ type: 'change', field: 'searchTerm', value: '' });
}

setIsDeleting(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation } from 'next-i18next';

import { Template } from '@/types/templates';

import { Button } from '@/components/common/ui/button';
import { Button } from '@ui/components/ui/button';

interface Props {
template: Template;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useCreateReducer } from '@/hooks/useCreateReducer';
import { TemplateFolders } from './components/folders';
import { PromptList } from './components/template-list';
import Search from '@/components/common/Search';
import { Button } from '@/components/common/ui/button';
import { Button } from '@ui/components/ui/button';

import PromptsContext from './prompts.context';
import { PromptsInitialState, initialState } from './prompts.state';
Expand Down Expand Up @@ -50,6 +50,7 @@ const Templates = () => {
useEffect(() => {
if (searchTerm) {
promptDispatch({
type: 'change',
field: 'filteredPrompts',
value: templates.filter((prompt) => {
const searchable =
Expand All @@ -62,7 +63,7 @@ const Templates = () => {
}),
});
} else {
promptDispatch({ field: 'filteredPrompts', value: templates });
promptDispatch({ type: 'change', field: 'filteredPrompts', value: templates });
}
}, [searchTerm, templates, promptDispatch]);

Expand All @@ -84,7 +85,7 @@ const Templates = () => {
}
};
const doSearch = (term: string) =>
promptDispatch({ field: 'searchTerm', value: term });
promptDispatch({ type: 'change', field: 'searchTerm', value: term });

return (
<PromptsContext.Provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ActivityBar = ({ icons }: { icons: JSX.Element[] }) => {
setShowSecondaryMenu(true);
localSaveShowSecondaryMenu(true);
}
secondaryMenuDispatch({ field: 'selectedIndex', value: index });
secondaryMenuDispatch({ type: 'change', field: 'selectedIndex', value: index });
};

// VS Code Activity Bar with tabs at the top and setting button at the bottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useEffect, useState } from 'react';
import { useTranslation } from 'next-i18next';

import { PrimaryLabel } from '@/components/common/ui/primary-label';
import { Slider } from '@/components/common/ui/slider';
import { Switch } from '@/components/common/ui/switch';
import { Slider } from '@ui/components/ui/slider';
import { Switch } from '@ui/components/ui/switch';

import { useConversations } from '@/providers/conversations';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useTranslation } from 'next-i18next';
import { storageGetSavedSettingValue } from '@/utils/app/storage/local/settings';

import { PrimaryLabel } from '@/components/common/ui/primary-label';
import { Slider } from '@/components/common/ui/slider';
import { Switch } from '@/components/common/ui/switch';
import { Slider } from '@ui/components/ui/slider';
import { Switch } from '@ui/components/ui/switch';

import { useConversations } from '@/providers/conversations';
import { useSettings } from '@/providers/settings';
Expand Down Expand Up @@ -38,7 +38,7 @@ export const MaxTokensSlider = () => {
);

return maxTokens || 4096;
}, [selectedConversation?.model?.id]);
}, [selectedConversation?.model?.id,savedSettings]);

const [value, setValue] = useState<number[]>([
selectedConversation?.params.max_tokens ?? modelTokenLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SelectItem,
SelectTrigger,
SelectValue,
} from '@/components/common/ui/select';
} from '@ui/components/ui/select';

import { useConversations } from '@/providers/conversations';
import { useModels } from '@/providers/models';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useEffect, useState } from 'react';
import { useTranslation } from 'next-i18next';

import { PrimaryLabel } from '@/components/common/ui/primary-label';
import { Slider } from '@/components/common/ui/slider';
import { Switch } from '@/components/common/ui/switch';
import { Slider } from '@ui/components/ui/slider';
import { Switch } from '@ui/components/ui/switch';

import { useConversations } from '@/providers/conversations';

Expand Down