rm small suffix, more quote fixes
This commit is contained in:
parent
6e6cf7830a
commit
4cfe5b90d5
4 changed files with 22 additions and 24 deletions
|
|
@ -1,17 +1,17 @@
|
||||||
"use client";
|
'use client';
|
||||||
|
|
||||||
import Link from "next/link";
|
import Link from 'next/link';
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from 'next/navigation';
|
||||||
import { useWindowSize } from "usehooks-ts";
|
import { useWindowSize } from 'usehooks-ts';
|
||||||
|
|
||||||
import { ModelSelector } from "@/components/model-selector";
|
import { ModelSelector } from '@/components/model-selector';
|
||||||
import { SidebarToggle } from "@/components/sidebar-toggle";
|
import { SidebarToggle } from '@/components/sidebar-toggle';
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from '@/components/ui/button';
|
||||||
import { PlusIcon, VercelIcon } from "./icons";
|
import { PlusIcon, VercelIcon } from './icons';
|
||||||
import { useSidebar } from "./ui/sidebar";
|
import { useSidebar } from './ui/sidebar';
|
||||||
import { memo } from "react";
|
import { memo } from 'react';
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
|
||||||
import { VisibilityType, VisibilitySelector } from "./visibility-selector";
|
import { VisibilityType, VisibilitySelector } from './visibility-selector';
|
||||||
|
|
||||||
function PureChatHeader({
|
function PureChatHeader({
|
||||||
chatId,
|
chatId,
|
||||||
|
|
@ -40,7 +40,7 @@ function PureChatHeader({
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="order-2 md:order-1 md:px-2 px-2 md:h-fit ml-auto md:ml-0"
|
className="order-2 md:order-1 md:px-2 px-2 md:h-fit ml-auto md:ml-0"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push("/");
|
router.push('/');
|
||||||
router.refresh();
|
router.refresh();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { xai } from "@ai-sdk/xai";
|
||||||
|
|
||||||
export const myProvider = customProvider({
|
export const myProvider = customProvider({
|
||||||
languageModels: {
|
languageModels: {
|
||||||
"chat-model-small": xai("grok-2-1212"),
|
"chat-model": xai("grok-2-1212"),
|
||||||
"chat-model-reasoning": wrapLanguageModel({
|
"chat-model-reasoning": wrapLanguageModel({
|
||||||
model: fireworks("accounts/fireworks/models/deepseek-r1"),
|
model: fireworks("accounts/fireworks/models/deepseek-r1"),
|
||||||
middleware: extractReasoningMiddleware({ tagName: "think" }),
|
middleware: extractReasoningMiddleware({ tagName: "think" }),
|
||||||
|
|
@ -27,7 +27,7 @@ export const myProvider = customProvider({
|
||||||
|
|
||||||
You can replace the models with any other provider of your choice. You will need to install the provider library and switch the models accordingly.
|
You can replace the models with any other provider of your choice. You will need to install the provider library and switch the models accordingly.
|
||||||
|
|
||||||
For example, if you want to use Anthropic's `claude-3-5-sonnet` model for `chat-model-large`, you can replace the `xai` model with the `anthropic` model as shown below.
|
For example, if you want to use Anthropic's `claude-3-5-sonnet` model for `chat-model`, you can replace the `xai` model with the `anthropic` model as shown below.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { customProvider } from "ai";
|
import { customProvider } from "ai";
|
||||||
|
|
@ -35,8 +35,7 @@ import { anthropic } from "@ai-sdk/anthropic";
|
||||||
|
|
||||||
export const myProvider = customProvider({
|
export const myProvider = customProvider({
|
||||||
languageModels: {
|
languageModels: {
|
||||||
"chat-model-small": openai("gpt-4o-mini"),
|
"chat-model": anthropic("claude-3-5-sonnet"), // Replace xai with anthropic
|
||||||
"chat-model-large": anthropic("claude-3-5-sonnet"), // Replace openai with anthropic
|
|
||||||
"chat-model-reasoning": wrapLanguageModel({
|
"chat-model-reasoning": wrapLanguageModel({
|
||||||
model: fireworks("accounts/fireworks/models/deepseek-r1"),
|
model: fireworks("accounts/fireworks/models/deepseek-r1"),
|
||||||
middleware: extractReasoningMiddleware({ tagName: "think" }),
|
middleware: extractReasoningMiddleware({ tagName: "think" }),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export const DEFAULT_CHAT_MODEL: string = 'chat-model-small';
|
export const DEFAULT_CHAT_MODEL: string = 'chat-model';
|
||||||
|
|
||||||
interface ChatModel {
|
interface ChatModel {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -8,9 +8,9 @@ interface ChatModel {
|
||||||
|
|
||||||
export const chatModels: Array<ChatModel> = [
|
export const chatModels: Array<ChatModel> = [
|
||||||
{
|
{
|
||||||
id: 'chat-model-small',
|
id: 'chat-model',
|
||||||
name: 'Small model',
|
name: 'Chat model',
|
||||||
description: 'Small model for fast, lightweight tasks',
|
description: 'Primary model for all-purpose chat',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'chat-model-reasoning',
|
id: 'chat-model-reasoning',
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,7 @@ import {
|
||||||
export const myProvider = isTestEnvironment
|
export const myProvider = isTestEnvironment
|
||||||
? customProvider({
|
? customProvider({
|
||||||
languageModels: {
|
languageModels: {
|
||||||
'chat-model-small': chatModel,
|
'chat-model': chatModel,
|
||||||
'chat-model-large': chatModel,
|
|
||||||
'chat-model-reasoning': reasoningModel,
|
'chat-model-reasoning': reasoningModel,
|
||||||
'title-model': titleModel,
|
'title-model': titleModel,
|
||||||
'artifact-model': artifactModel,
|
'artifact-model': artifactModel,
|
||||||
|
|
@ -26,7 +25,7 @@ export const myProvider = isTestEnvironment
|
||||||
})
|
})
|
||||||
: customProvider({
|
: customProvider({
|
||||||
languageModels: {
|
languageModels: {
|
||||||
'chat-model-small': xai('grok-2-1212'),
|
'chat-model': xai('grok-2-1212'),
|
||||||
'chat-model-reasoning': wrapLanguageModel({
|
'chat-model-reasoning': wrapLanguageModel({
|
||||||
model: fireworks('accounts/fireworks/models/deepseek-r1'),
|
model: fireworks('accounts/fireworks/models/deepseek-r1'),
|
||||||
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue