Move ai folder to lib/ (#542)
This commit is contained in:
parent
914238be80
commit
b8643353c0
9 changed files with 8 additions and 8 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
import { CoreMessage, type CoreUserMessage, generateText } from 'ai';
|
import { CoreMessage, type CoreUserMessage, generateText } from 'ai';
|
||||||
import { cookies } from 'next/headers';
|
import { cookies } from 'next/headers';
|
||||||
|
|
||||||
import { customModel } from '@/ai';
|
import { customModel } from '@/lib/ai';
|
||||||
|
|
||||||
export async function saveModelId(model: string) {
|
export async function saveModelId(model: string) {
|
||||||
const cookieStore = await cookies();
|
const cookieStore = await cookies();
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import {
|
import {
|
||||||
convertToCoreMessages,
|
|
||||||
type Message,
|
type Message,
|
||||||
StreamData,
|
StreamData,
|
||||||
|
convertToCoreMessages,
|
||||||
streamObject,
|
streamObject,
|
||||||
streamText,
|
streamText,
|
||||||
} from 'ai';
|
} from 'ai';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
import { customModel } from '@/ai';
|
|
||||||
import { models } from '@/ai/models';
|
|
||||||
import { systemPrompt } from '@/ai/prompts';
|
|
||||||
import { auth } from '@/app/(auth)/auth';
|
import { auth } from '@/app/(auth)/auth';
|
||||||
|
import { customModel } from '@/lib/ai';
|
||||||
|
import { models } from '@/lib/ai/models';
|
||||||
|
import { systemPrompt } from '@/lib/ai/prompts';
|
||||||
import {
|
import {
|
||||||
deleteChatById,
|
deleteChatById,
|
||||||
getChatById,
|
getChatById,
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import { CoreMessage } from 'ai';
|
||||||
import { cookies } from 'next/headers';
|
import { cookies } from 'next/headers';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
import { DEFAULT_MODEL_NAME, models } from '@/ai/models';
|
|
||||||
import { auth } from '@/app/(auth)/auth';
|
import { auth } from '@/app/(auth)/auth';
|
||||||
import { Chat as PreviewChat } from '@/components/chat';
|
import { Chat as PreviewChat } from '@/components/chat';
|
||||||
|
import { DEFAULT_MODEL_NAME, models } from '@/lib/ai/models';
|
||||||
import { getChatById, getMessagesByChatId } from '@/lib/db/queries';
|
import { getChatById, getMessagesByChatId } from '@/lib/db/queries';
|
||||||
import { convertToUIMessages } from '@/lib/utils';
|
import { convertToUIMessages } from '@/lib/utils';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { cookies } from 'next/headers';
|
import { cookies } from 'next/headers';
|
||||||
|
|
||||||
import { DEFAULT_MODEL_NAME, models } from '@/ai/models';
|
|
||||||
import { Chat } from '@/components/chat';
|
import { Chat } from '@/components/chat';
|
||||||
|
import { DEFAULT_MODEL_NAME, models } from '@/lib/ai/models';
|
||||||
import { generateUUID } from '@/lib/utils';
|
import { generateUUID } from '@/lib/utils';
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import { startTransition, useMemo, useOptimistic, useState } from 'react';
|
import { startTransition, useMemo, useOptimistic, useState } from 'react';
|
||||||
|
|
||||||
import { models } from '@/ai/models';
|
|
||||||
import { saveModelId } from '@/app/(chat)/actions';
|
import { saveModelId } from '@/app/(chat)/actions';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
|
|
@ -11,6 +10,7 @@ import {
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
|
import { models } from '@/lib/ai/models';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
import { CheckCirclFillIcon, ChevronDownIcon } from './icons';
|
import { CheckCirclFillIcon, ChevronDownIcon } from './icons';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue