mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
~/modules
This commit is contained in:
+3
-3
@@ -6,9 +6,9 @@ import { CacheProvider, EmotionCache } from '@emotion/react';
|
||||
import { CssBaseline, CssVarsProvider } from '@mui/joy';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
||||
import '@/common/styles/GithubMarkdown.css';
|
||||
import { Brand } from '@/common/brand';
|
||||
import { createEmotionCache, theme } from '@/common/theme';
|
||||
import '~/common/styles/GithubMarkdown.css';
|
||||
import { Brand } from '~/common/brand';
|
||||
import { createEmotionCache, theme } from '~/common/theme';
|
||||
|
||||
|
||||
// Client-side cache, shared for the whole session of the user in the browser.
|
||||
|
||||
+3
-2
@@ -4,9 +4,10 @@ import { default as Document, DocumentContext, DocumentProps, Head, Html, Main,
|
||||
import createEmotionServer from '@emotion/server/create-instance';
|
||||
import { getInitColorSchemeScript } from '@mui/joy/styles';
|
||||
|
||||
import { Brand } from '@/common/brand';
|
||||
import { Brand } from '~/common/brand';
|
||||
import { bodyFontClassName, createEmotionCache } from '~/common/theme';
|
||||
|
||||
import { MyAppProps } from './_app';
|
||||
import { bodyFontClassName, createEmotionCache } from '@/common/theme';
|
||||
|
||||
|
||||
interface MyDocumentProps extends DocumentProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { ElevenLabs } from '@/modules/elevenlabs/elevenlabs.types';
|
||||
import { postToElevenLabs } from '@/modules/elevenlabs/elevenlabs.server';
|
||||
import { ElevenLabs } from '~/modules/elevenlabs/elevenlabs.types';
|
||||
import { postToElevenLabs } from '~/modules/elevenlabs/elevenlabs.server';
|
||||
|
||||
|
||||
export default async function handler(req: NextRequest) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { ElevenLabs } from '@/modules/elevenlabs/elevenlabs.types';
|
||||
import { getFromElevenLabs } from '@/modules/elevenlabs/elevenlabs.server';
|
||||
import { ElevenLabs } from '~/modules/elevenlabs/elevenlabs.types';
|
||||
import { getFromElevenLabs } from '~/modules/elevenlabs/elevenlabs.server';
|
||||
|
||||
|
||||
export default async function handler(req: NextRequest) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { OpenAI } from '@/modules/openai/openai.types';
|
||||
import { openaiPost, toApiChatRequest, toWireCompletionRequest } from '@/modules/openai/openai.server';
|
||||
import { OpenAI } from '~/modules/openai/openai.types';
|
||||
import { openaiPost, toApiChatRequest, toWireCompletionRequest } from '~/modules/openai/openai.server';
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { OpenAI } from '@/modules/openai/openai.types';
|
||||
import { openaiGet, toApiChatRequest } from '@/modules/openai/openai.server';
|
||||
import { OpenAI } from '~/modules/openai/openai.types';
|
||||
import { openaiGet, toApiChatRequest } from '~/modules/openai/openai.server';
|
||||
|
||||
|
||||
export default async function handler(req: NextRequest): Promise<NextResponse> {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { createParser } from 'eventsource-parser';
|
||||
|
||||
import { OpenAI } from '@/modules/openai/openai.types';
|
||||
import { openaiPostResponse, toApiChatRequest, toWireCompletionRequest } from '@/modules/openai/openai.server';
|
||||
import { OpenAI } from '~/modules/openai/openai.types';
|
||||
import { openaiPostResponse, toApiChatRequest, toWireCompletionRequest } from '~/modules/openai/openai.server';
|
||||
|
||||
|
||||
async function chatStreamRepeater(api: OpenAI.API.Configuration, rest: Omit<OpenAI.API.Chat.Request, 'api'>, signal: AbortSignal): Promise<ReadableStream> {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { Prodia } from '@/modules/prodia/prodia.types';
|
||||
import { Prodia } from '~/modules/prodia/prodia.types';
|
||||
|
||||
|
||||
export const prodiaHeaders = (apiKey: string): Record<string, string> => ({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { Prodia } from '@/modules/prodia/prodia.types';
|
||||
import { Prodia } from '~/modules/prodia/prodia.types';
|
||||
|
||||
|
||||
// for lack of an API
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { PasteGG } from '@/modules/pastegg/pastegg.types';
|
||||
import { pasteGgPost } from '@/modules/pastegg/pastegg.server';
|
||||
import { PasteGG } from '~/modules/pastegg/pastegg.types';
|
||||
import { pasteGgPost } from '~/modules/pastegg/pastegg.server';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { Search } from '@/modules/search/search.types';
|
||||
import { objectToQueryString } from '@/modules/search/search.client';
|
||||
import { Search } from '~/modules/search/search.types';
|
||||
import { objectToQueryString } from '~/modules/search/search.client';
|
||||
|
||||
|
||||
export default async function handler(req: NextRequest): Promise<NextResponse> {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { AppLayout } from '@/common/layouts/AppLayout';
|
||||
import { AppLayout } from '~/common/layouts/AppLayout';
|
||||
|
||||
import { Chat } from '../src/apps/chat/Chat';
|
||||
|
||||
|
||||
+13
-13
@@ -3,20 +3,20 @@ import { shallow } from 'zustand/shallow';
|
||||
|
||||
import { useTheme } from '@mui/joy';
|
||||
|
||||
import { CmdRunProdia } from '@/modules/prodia/prodia.client';
|
||||
import { CmdRunReact } from '@/modules/search/search.client';
|
||||
import { PasteGG } from '@/modules/pastegg/pastegg.types';
|
||||
import { PublishedModal } from '@/modules/pastegg/PublishedModal';
|
||||
import { callPublish } from '@/modules/pastegg/pastegg.client';
|
||||
import { CmdRunProdia } from '~/modules/prodia/prodia.client';
|
||||
import { CmdRunReact } from '~/modules/search/search.client';
|
||||
import { PasteGG } from '~/modules/pastegg/pastegg.types';
|
||||
import { PublishedModal } from '~/modules/pastegg/PublishedModal';
|
||||
import { callPublish } from '~/modules/pastegg/pastegg.client';
|
||||
|
||||
import { ConfirmationModal } from '@/common/components/ConfirmationModal';
|
||||
import { Link } from '@/common/components/Link';
|
||||
import { conversationToMarkdown } from '@/common/util/conversationToMarkdown';
|
||||
import { createDMessage, DMessage, restoreConversationFromJson, useChatStore } from '@/common/state/store-chats';
|
||||
import { extractCommands } from '@/common/util/extractCommands';
|
||||
import { useApplicationBarStore } from '@/common/layouts/appbar/useApplicationBarStore';
|
||||
import { useComposerStore } from '@/common/state/store-composer';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { ConfirmationModal } from '~/common/components/ConfirmationModal';
|
||||
import { Link } from '~/common/components/Link';
|
||||
import { conversationToMarkdown } from '~/common/util/conversationToMarkdown';
|
||||
import { createDMessage, DMessage, restoreConversationFromJson, useChatStore } from '~/common/state/store-chats';
|
||||
import { extractCommands } from '~/common/util/extractCommands';
|
||||
import { useApplicationBarStore } from '~/common/layouts/appbar/useApplicationBarStore';
|
||||
import { useComposerStore } from '~/common/state/store-composer';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { ActionItems } from './components/appbar/ActionItems';
|
||||
import { ChatMessageList } from './components/ChatMessageList';
|
||||
|
||||
@@ -4,8 +4,8 @@ import { shallow } from 'zustand/shallow';
|
||||
import { Box, List } from '@mui/joy';
|
||||
import { SxProps } from '@mui/joy/styles/types';
|
||||
|
||||
import { createDMessage, DMessage, useChatStore } from '@/common/state/store-chats';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { createDMessage, DMessage, useChatStore } from '~/common/state/store-chats';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { ChatMessage } from './message/ChatMessage';
|
||||
import { ChatMessageSelectable, MessagesSelectionHeader } from './message/ChatMessageSelectable';
|
||||
|
||||
@@ -6,9 +6,9 @@ import ClearIcon from '@mui/icons-material/Clear';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
|
||||
import { SystemPurposeId, SystemPurposes } from '../../../data';
|
||||
import { useChatStore } from '@/common/state/store-chats';
|
||||
import { usePurposeStore } from '@/common/state/store-purposes';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { useChatStore } from '~/common/state/store-chats';
|
||||
import { usePurposeStore } from '~/common/state/store-purposes';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
|
||||
// Constants for tile sizes / grid width - breakpoints need to be computed here to work around
|
||||
|
||||
@@ -9,8 +9,8 @@ import ExitToAppIcon from '@mui/icons-material/ExitToApp';
|
||||
import FileDownloadIcon from '@mui/icons-material/FileDownload';
|
||||
import SettingsSuggestIcon from '@mui/icons-material/SettingsSuggest';
|
||||
|
||||
import { downloadConversationJson, useChatStore } from '@/common/state/store-chats';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { downloadConversationJson, useChatStore } from '~/common/state/store-chats';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
|
||||
export function ActionItems(props: {
|
||||
|
||||
@@ -6,9 +6,9 @@ import { SxProps } from '@mui/joy/styles/types';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
||||
|
||||
import { InlineTextarea } from '@/common/components/InlineTextarea';
|
||||
import { InlineTextarea } from '~/common/components/InlineTextarea';
|
||||
import { SystemPurposes } from '../../../../data';
|
||||
import { conversationTitle, useChatStore } from '@/common/state/store-chats';
|
||||
import { conversationTitle, useChatStore } from '~/common/state/store-chats';
|
||||
|
||||
|
||||
const DEBUG_CONVERSATION_IDs = false;
|
||||
|
||||
@@ -6,8 +6,8 @@ import AddIcon from '@mui/icons-material/Add';
|
||||
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
||||
import FileUploadIcon from '@mui/icons-material/FileUpload';
|
||||
|
||||
import { MAX_CONVERSATIONS, useChatStore } from '@/common/state/store-chats';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { MAX_CONVERSATIONS, useChatStore } from '~/common/state/store-chats';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { ConversationItem } from './ConversationItem';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import { shallow } from 'zustand/shallow';
|
||||
|
||||
import { AppBarDropdown } from '@/common/layouts/appbar/AppBarDropdown';
|
||||
import { useChatStore } from '@/common/state/store-chats';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { AppBarDropdown } from '~/common/layouts/appbar/AppBarDropdown';
|
||||
import { useChatStore } from '~/common/state/store-chats';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { ChatModelId, ChatModels, SystemPurposeId, SystemPurposes } from '../../../../data';
|
||||
|
||||
|
||||
@@ -17,20 +17,19 @@ import TelegramIcon from '@mui/icons-material/Telegram';
|
||||
import UploadFileIcon from '@mui/icons-material/UploadFile';
|
||||
|
||||
import { ChatModels, SendModeId, SendModes } from '../../../../data';
|
||||
import { ConfirmationModal } from '@/common/components/ConfirmationModal';
|
||||
import { countModelTokens } from '@/common/llm-util/token-counter';
|
||||
import { htmlTableToMarkdown } from '@/common/util/htmlTableToMarkdown';
|
||||
import { pdfToText } from '@/common/util/pdfToText';
|
||||
import { useChatStore } from '@/common/state/store-chats';
|
||||
import { useComposerStore } from '@/common/state/store-composer';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { useSpeechRecognition } from '@/common/components/useSpeechRecognition';
|
||||
import { ConfirmationModal } from '~/common/components/ConfirmationModal';
|
||||
import { countModelTokens } from '~/common/llm-util/token-counter';
|
||||
import { hideOnDesktop, hideOnMobile } from '~/common/theme';
|
||||
import { htmlTableToMarkdown } from '~/common/util/htmlTableToMarkdown';
|
||||
import { pdfToText } from '~/common/util/pdfToText';
|
||||
import { useChatStore } from '~/common/state/store-chats';
|
||||
import { useComposerStore } from '~/common/state/store-composer';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
import { useSpeechRecognition } from '~/common/components/useSpeechRecognition';
|
||||
|
||||
import { ContentReducerModal } from './ContentReducerModal';
|
||||
import { TokenBadge } from './TokenBadge';
|
||||
import { TokenProgressbar } from './TokenProgressbar';
|
||||
import { hideOnDesktop, hideOnMobile } from '@/common/theme';
|
||||
// import { isValidProdiaApiKey, requireUserKeyProdia } from '@/modules/prodia/prodia.client';
|
||||
|
||||
|
||||
/// Text template helpers
|
||||
|
||||
@@ -3,9 +3,9 @@ import * as React from 'react';
|
||||
import { Alert, Box, Button, CircularProgress, Divider, FormControl, FormHelperText, FormLabel, Modal, ModalClose, ModalDialog, Option, Select, Slider, Stack, Textarea, Typography } from '@mui/joy';
|
||||
|
||||
import { ChatModelId, ChatModels, fastChatModelId } from '../../../../data';
|
||||
import { Section } from '@/common/components/Section';
|
||||
import { countModelTokens } from '@/common/llm-util/token-counter';
|
||||
import { summerizeToFitContextBudget } from '@/common/llm-util/summerize';
|
||||
import { Section } from '~/common/components/Section';
|
||||
import { countModelTokens } from '~/common/llm-util/token-counter';
|
||||
import { summerizeToFitContextBudget } from '~/common/llm-util/summerize';
|
||||
|
||||
import { TokenBadge } from './TokenBadge';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Box, Grid, IconButton, Sheet, Stack, styled, Typography, useTheme } fro
|
||||
import { SxProps } from '@mui/joy/styles/types';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
|
||||
import { DEphemeral, useChatStore } from '@/common/state/store-chats';
|
||||
import { DEphemeral, useChatStore } from '~/common/state/store-chats';
|
||||
|
||||
|
||||
const StateLine = styled(Typography)(({ theme }) => ({
|
||||
@@ -42,7 +42,7 @@ function ListRenderer({ name, list }: { name: string, list: any[] }) {
|
||||
return <StateLine><b>{name}</b>[{list.length ? list.length : ''}]: {list.length ? '(not displayed)' : 'empty'}</StateLine>;
|
||||
}
|
||||
|
||||
function ObjectRenderer({ name, value }: { name: string, value: object }) {
|
||||
function ObjectRenderer({ name }: { name: string }) {
|
||||
return <StateLine><b>{name}</b>: <i>object not displayed</i></StateLine>;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ function StateRenderer(props: { state: object }) {
|
||||
: Array.isArray(value)
|
||||
? <ListRenderer key={'state-' + key} name={key} list={value} />
|
||||
: typeof value === 'object'
|
||||
? <ObjectRenderer key={'state-' + key} name={key} value={value} />
|
||||
? <ObjectRenderer key={'state-' + key} name={key} />
|
||||
: <Typography key={'state-' + key} level='body2'>{key}: {value}</Typography>,
|
||||
)}
|
||||
</Sheet>
|
||||
|
||||
@@ -15,17 +15,17 @@ import ReplayIcon from '@mui/icons-material/Replay';
|
||||
import SettingsSuggestIcon from '@mui/icons-material/SettingsSuggest';
|
||||
import SmartToyOutlinedIcon from '@mui/icons-material/SmartToyOutlined';
|
||||
|
||||
import { requireUserKeyElevenLabs, speakText } from '@/modules/elevenlabs/elevenlabs.client';
|
||||
import { requireUserKeyProdia } from '@/modules/prodia/prodia.client';
|
||||
import { requireUserKeyElevenLabs, speakText } from '~/modules/elevenlabs/elevenlabs.client';
|
||||
import { requireUserKeyProdia } from '~/modules/prodia/prodia.client';
|
||||
|
||||
import { DMessage } from '@/common/state/store-chats';
|
||||
import { InlineTextarea } from '@/common/components/InlineTextarea';
|
||||
import { Link } from '@/common/components/Link';
|
||||
import { DMessage } from '~/common/state/store-chats';
|
||||
import { InlineTextarea } from '~/common/components/InlineTextarea';
|
||||
import { Link } from '~/common/components/Link';
|
||||
import { SystemPurposeId, SystemPurposes } from '../../../../data';
|
||||
import { copyToClipboard } from '@/common/util/copyToClipboard';
|
||||
import { cssRainbowColorKeyframes } from '@/common/theme';
|
||||
import { prettyBaseModel } from '@/common/util/conversationToMarkdown';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { copyToClipboard } from '~/common/util/copyToClipboard';
|
||||
import { cssRainbowColorKeyframes } from '~/common/theme';
|
||||
import { prettyBaseModel } from '~/common/util/conversationToMarkdown';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { RenderCode } from './RenderCode';
|
||||
import { RenderHtml } from './RenderHtml';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Box, Button, Checkbox, IconButton, ListItem, Sheet, Typography, useThem
|
||||
import ClearIcon from '@mui/icons-material/Clear';
|
||||
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
||||
|
||||
import { DMessage } from '@/common/state/store-chats';
|
||||
import { DMessage } from '~/common/state/store-chats';
|
||||
|
||||
import { TokenBadge } from '../composer/TokenBadge';
|
||||
import { makeAvatar, messageBackground } from './ChatMessage';
|
||||
|
||||
@@ -9,7 +9,7 @@ import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
||||
import SchemaIcon from '@mui/icons-material/Schema';
|
||||
import ShapeLineOutlinedIcon from '@mui/icons-material/ShapeLineOutlined';
|
||||
|
||||
import { copyToClipboard } from '@/common/util/copyToClipboard';
|
||||
import { copyToClipboard } from '~/common/util/copyToClipboard';
|
||||
|
||||
import { CodeBlock } from './Block';
|
||||
import { OpenInCodepen } from './OpenInCodepen';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Box, IconButton, Tooltip } from '@mui/joy';
|
||||
import ReplayIcon from '@mui/icons-material/Replay';
|
||||
import ZoomOutMapIcon from '@mui/icons-material/ZoomOutMap';
|
||||
|
||||
import { Link } from '@/common/components/Link';
|
||||
import { Link } from '~/common/components/Link';
|
||||
|
||||
import { ImageBlock } from './Block';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as React from 'react';
|
||||
import { Chip, Typography } from '@mui/joy';
|
||||
import { SxProps } from '@mui/joy/styles/types';
|
||||
|
||||
import { extractCommands } from '@/common/util/extractCommands';
|
||||
import { extractCommands } from '~/common/util/extractCommands';
|
||||
|
||||
import { TextBlock } from './Block';
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { ChatModelId, SystemPurposeId, SystemPurposes } from '../../../data';
|
||||
import { createDMessage, DMessage, useChatStore } from '@/common/state/store-chats';
|
||||
|
||||
import { OpenAI } from '@/modules/openai/openai.types';
|
||||
import { getOpenAISettings } from '@/modules/openai/openai.client';
|
||||
import { speakText } from '@/modules/elevenlabs/elevenlabs.client';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { OpenAI } from '~/modules/openai/openai.types';
|
||||
import { getOpenAISettings } from '~/modules/openai/openai.client';
|
||||
import { speakText } from '~/modules/elevenlabs/elevenlabs.client';
|
||||
|
||||
import { createDMessage, DMessage, useChatStore } from '~/common/state/store-chats';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { updateAutoConversationTitle } from './ai-functions';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Agent } from '@/common/llm-util/react';
|
||||
import { Agent } from '~/common/llm-util/react';
|
||||
import { ChatModelId } from '../../../data';
|
||||
import { createEphemeral, DMessage, useChatStore } from '@/common/state/store-chats';
|
||||
import { createEphemeral, DMessage, useChatStore } from '~/common/state/store-chats';
|
||||
|
||||
import { createAssistantTypingMessage } from './agi-immediate';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { callChat } from '~/modules/openai/openai.client';
|
||||
|
||||
import { ChatModelId, fastChatModelId } from '../../../data';
|
||||
import { callChat } from '@/modules/openai/openai.client';
|
||||
import { useChatStore } from '@/common/state/store-chats';
|
||||
import { useChatStore } from '~/common/state/store-chats';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Prodia } from '@/modules/prodia/prodia.types';
|
||||
import { prodiaDefaultModelId } from '@/modules/prodia/prodia.client';
|
||||
import { Prodia } from '~/modules/prodia/prodia.types';
|
||||
import { prodiaDefaultModelId } from '~/modules/prodia/prodia.client';
|
||||
|
||||
import { useChatStore } from '@/common/state/store-chats';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { useChatStore } from '~/common/state/store-chats';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { createAssistantTypingMessage } from './agi-immediate';
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ import * as React from 'react';
|
||||
|
||||
import { Box, Button } from '@mui/joy';
|
||||
|
||||
import { ElevenlabsSettings } from '@/modules/elevenlabs/ElevenlabsSettings';
|
||||
import { ProdiaSettings } from '@/modules/prodia/ProdiaSettings';
|
||||
import { SearchSettings } from '@/modules/search/SearchSettings';
|
||||
import { ElevenlabsSettings } from '~/modules/elevenlabs/ElevenlabsSettings';
|
||||
import { ProdiaSettings } from '~/modules/prodia/ProdiaSettings';
|
||||
import { SearchSettings } from '~/modules/search/SearchSettings';
|
||||
|
||||
import { GoodModal } from '@/common/components/GoodModal';
|
||||
import { useUIStore } from '@/common/state/store-ui';
|
||||
import { GoodModal } from '~/common/components/GoodModal';
|
||||
import { useUIStore } from '~/common/state/store-ui';
|
||||
|
||||
import { UISettings } from './UISettings';
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import WidthNormalIcon from '@mui/icons-material/WidthNormal';
|
||||
import WidthWideIcon from '@mui/icons-material/WidthWide';
|
||||
|
||||
import { Section } from '@/common/components/Section';
|
||||
import { hideOnMobile, settingsGap } from '@/common/theme';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { Section } from '~/common/components/Section';
|
||||
import { hideOnMobile, settingsGap } from '~/common/theme';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
// languages is defined as a JSON file
|
||||
import languages from './languages.json' assert { type: 'json' };
|
||||
|
||||
@@ -3,13 +3,12 @@ import { shallow } from 'zustand/shallow';
|
||||
|
||||
import { Box, Container, useTheme } from '@mui/joy';
|
||||
|
||||
import { ModelsModal } from '@/modules/models/ModelsModal';
|
||||
import { ModelsModal } from '~/modules/models/ModelsModal';
|
||||
import { SettingsModal } from '../../apps/settings/SettingsModal';
|
||||
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
|
||||
import { ApplicationBar } from './appbar/ApplicationBar';
|
||||
import { NoSSR } from '../components/NoSSR';
|
||||
import { useSettingsStore } from '../state/store-settings';
|
||||
|
||||
|
||||
export function AppLayout(props: {
|
||||
|
||||
@@ -8,10 +8,9 @@ import MenuIcon from '@mui/icons-material/Menu';
|
||||
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
||||
import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined';
|
||||
|
||||
import { useUIStore } from '@/common/state/store-ui';
|
||||
|
||||
import { SupportMenuItem } from './SupportMenuItem';
|
||||
import { useApplicationBarStore } from './useApplicationBarStore';
|
||||
import { useUIStore } from '../../state/store-ui';
|
||||
|
||||
|
||||
function CommonContextItems(props: { onClose: () => void }) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import { Box, Button, ListItem, SvgIcon, useTheme } from '@mui/joy';
|
||||
import { SxProps } from '@mui/joy/styles/types';
|
||||
import GitHubIcon from '@mui/icons-material/GitHub';
|
||||
|
||||
import { Brand } from '@/common/brand';
|
||||
import { Link } from '@/common/components/Link';
|
||||
import { cssRainbowColorKeyframes } from '@/common/theme';
|
||||
import { Brand } from '../../brand';
|
||||
import { Link } from '../../components/Link';
|
||||
import { cssRainbowColorKeyframes } from '../../theme';
|
||||
|
||||
|
||||
// missing from MUI, using Tabler for Discord
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OpenAI } from '@/modules/openai/openai.types';
|
||||
import { callApiSearchGoogle } from '@/modules/search/search.client';
|
||||
import { callChat } from '@/modules/openai/openai.client';
|
||||
import { OpenAI } from '~/modules/openai/openai.types';
|
||||
import { callApiSearchGoogle } from '~/modules/search/search.client';
|
||||
import { callChat } from '~/modules/openai/openai.client';
|
||||
|
||||
import { ChatModelId } from '../../data';
|
||||
import { currentDate, reActPrompt } from './prompts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { callChat } from '@/modules/openai/openai.client';
|
||||
import { callChat } from '~/modules/openai/openai.client';
|
||||
|
||||
import { ChatModelId, ChatModels } from '../../data';
|
||||
import { cleanupPrompt } from './prompts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CmdRunProdia } from '@/modules/prodia/prodia.client';
|
||||
import { CmdRunReact, CmdRunSearch } from '@/modules/search/search.client';
|
||||
import { CmdRunProdia } from '~/modules/prodia/prodia.client';
|
||||
import { CmdRunReact, CmdRunSearch } from '~/modules/search/search.client';
|
||||
|
||||
export const commands = [...CmdRunProdia, ...CmdRunSearch, ...CmdRunReact];
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import RecordVoiceOverIcon from '@mui/icons-material/RecordVoiceOver';
|
||||
import VisibilityIcon from '@mui/icons-material/Visibility';
|
||||
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
||||
|
||||
import { Section } from '@/common/components/Section';
|
||||
import { settingsCol1Width, settingsGap } from '@/common/theme';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { Section } from '~/common/components/Section';
|
||||
import { settingsCol1Width, settingsGap } from '~/common/theme';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { isElevenLabsEnabled, requireUserKeyElevenLabs, useElevenLabsVoices } from './elevenlabs.client';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ElevenLabs } from './elevenlabs.types';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
|
||||
export const requireUserKeyElevenLabs = !process.env.HAS_SERVER_KEY_ELEVENLABS;
|
||||
|
||||
@@ -6,7 +6,7 @@ import AddIcon from '@mui/icons-material/Add';
|
||||
import CloudOutlinedIcon from '@mui/icons-material/CloudOutlined';
|
||||
import ComputerIcon from '@mui/icons-material/Computer';
|
||||
|
||||
import { hideOnMobile } from '@/common/theme';
|
||||
import { hideOnMobile } from '~/common/theme';
|
||||
|
||||
import { DModelSourceId, useModelsStore } from './store-models';
|
||||
import { defaultVendorId, ModelVendorId, rankedVendors } from './vendors-registry';
|
||||
|
||||
@@ -7,7 +7,7 @@ import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
||||
//import FileDownloadIcon from '@mui/icons-material/FileDownload';
|
||||
|
||||
import { DModelSourceId, useModelsStore } from './store-models';
|
||||
import { configureVendorSource } from '@/modules/models/vendors-registry';
|
||||
import { configureVendorSource } from './vendors-registry';
|
||||
|
||||
|
||||
export function ConfigureSources() {
|
||||
|
||||
@@ -3,13 +3,13 @@ import { shallow } from 'zustand/shallow';
|
||||
|
||||
import { Divider } from '@mui/joy';
|
||||
|
||||
import { GoodModal } from '@/common/components/GoodModal';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { useUIStore } from '@/common/state/store-ui';
|
||||
import { GoodModal } from '~/common/components/GoodModal';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
import { useUIStore } from '~/common/state/store-ui';
|
||||
|
||||
import { AddVendor } from './AddVendor';
|
||||
import { ConfigureSources } from './ConfigureSources';
|
||||
import { EditModels } from '@/modules/models/EditModels';
|
||||
import { EditModels } from './EditModels';
|
||||
|
||||
|
||||
export function ModelsModal() {
|
||||
|
||||
@@ -2,9 +2,10 @@ import * as React from 'react';
|
||||
|
||||
import { FormControl, FormHelperText, FormLabel, Input } from '@mui/joy';
|
||||
|
||||
import { Link } from '~/common/components/Link';
|
||||
|
||||
import { DModelSourceId, useSourceConfigurator } from '../store-models';
|
||||
import { normConfigLocalAI, SourceConfigLocalAI } from './vendor';
|
||||
import { Link } from '@/common/components/Link';
|
||||
|
||||
|
||||
export function SourceConfig(props: { sourceId: DModelSourceId }) {
|
||||
|
||||
@@ -2,13 +2,13 @@ import * as React from 'react';
|
||||
|
||||
import { Box, FormControl, FormHelperText, FormLabel, Input, Slider, Stack } from '@mui/joy';
|
||||
|
||||
import { hasServerKeyOpenAI, isValidOpenAIApiKey } from '@/modules/openai/openai.client';
|
||||
import { Brand } from '~/common/brand';
|
||||
import { FormInputKey } from '~/common/components/FormInputKey';
|
||||
import { Link } from '~/common/components/Link';
|
||||
import { Section } from '~/common/components/Section';
|
||||
import { settingsCol1Width, settingsGap, settingsMaxWidth } from '~/common/theme';
|
||||
|
||||
import { Brand } from '@/common/brand';
|
||||
import { FormInputKey } from '@/common/components/FormInputKey';
|
||||
import { Link } from '@/common/components/Link';
|
||||
import { Section } from '@/common/components/Section';
|
||||
import { settingsCol1Width, settingsGap, settingsMaxWidth } from '@/common/theme';
|
||||
import { hasServerKeyOpenAI, isValidOpenAIApiKey } from '../../openai/openai.client';
|
||||
|
||||
import { DModelSourceId, useSourceConfigurator } from '../store-models';
|
||||
import { normConfigOpenAI, SourceConfigOpenAI } from './vendor';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ChatModelId } from '../../data';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { OpenAI } from './openai.types';
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ import * as React from 'react';
|
||||
|
||||
import { Alert, Box, Button, Divider, Input, Modal, ModalDialog, Stack, Typography } from '@mui/joy';
|
||||
|
||||
import { Link } from '@/common/components/Link';
|
||||
import { Link } from '~/common/components/Link';
|
||||
|
||||
import { PasteGG } from './pastegg.types';
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// noinspection ExceptionCaughtLocallyJS
|
||||
|
||||
import { Brand } from '@/common/brand';
|
||||
import { Brand } from '~/common/brand';
|
||||
|
||||
import { PasteGG } from './pastegg.types';
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import VisibilityIcon from '@mui/icons-material/Visibility';
|
||||
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
||||
|
||||
import { Section } from '@/common/components/Section';
|
||||
import { settingsGap } from '@/common/theme';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { Section } from '~/common/components/Section';
|
||||
import { settingsGap } from '~/common/theme';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { Prodia } from './prodia.types';
|
||||
import { isValidProdiaApiKey, prodiaDefaultModelId, requireUserKeyProdia } from './prodia.client';
|
||||
|
||||
@@ -4,14 +4,14 @@ import { shallow } from 'zustand/shallow';
|
||||
import { Box, FormControl, FormHelperText, FormLabel, Input, Stack, Tooltip } from '@mui/joy';
|
||||
import KeyIcon from '@mui/icons-material/Key';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||
|
||||
import { Section } from '@/common/components/Section';
|
||||
import { settingsCol1Width, settingsGap } from '@/common/theme';
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { Link } from '~/common/components/Link';
|
||||
import { Section } from '~/common/components/Section';
|
||||
import { settingsCol1Width, settingsGap } from '~/common/theme';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { isValidGoogleCloudApiKey, isValidGoogleCseId, requireUserKeyGoogleCse } from './search.client';
|
||||
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||
import { Link } from '@/common/components/Link';
|
||||
|
||||
|
||||
export function SearchSettings() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useSettingsStore } from '@/common/state/store-settings';
|
||||
import { useSettingsStore } from '~/common/state/store-settings';
|
||||
|
||||
import { Search } from './search.types';
|
||||
|
||||
|
||||
+4
-3
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES6",
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"skipLibCheck": true,
|
||||
"baseUrl": ".",
|
||||
"strict": true,
|
||||
@@ -17,8 +18,8 @@
|
||||
"incremental": true,
|
||||
"jsxImportSource": "@emotion/react",
|
||||
"paths": {
|
||||
"@/common/*": ["src/common/*"],
|
||||
"@/modules/*": ["src/modules/*"]
|
||||
"~/common/*": ["src/common/*"],
|
||||
"~/modules/*": ["src/modules/*"]
|
||||
},
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
|
||||
Reference in New Issue
Block a user