mirror of
https://github.com/coaidev/coai.git
synced 2025-05-22 22:40:14 +09:00
update markdown
This commit is contained in:
parent
5a20c5282e
commit
1313b861e8
@ -61,8 +61,10 @@ func NewChatInstanceFromModel(props *InstanceProps) *ChatInstance {
|
|||||||
return NewChatInstanceFromConfig("subscribe")
|
return NewChatInstanceFromConfig("subscribe")
|
||||||
}
|
}
|
||||||
return NewChatInstanceFromConfig("gpt3")
|
return NewChatInstanceFromConfig("gpt3")
|
||||||
|
|
||||||
case globals.Dalle2:
|
case globals.Dalle2:
|
||||||
return NewChatInstanceFromConfig("gpt3")
|
return NewChatInstanceFromConfig("gpt3")
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return NewChatInstanceFromConfig("gpt3")
|
return NewChatInstanceFromConfig("gpt3")
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,14 @@ function doAction(dispatch: AppDispatch, url: string): boolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LanguageMap: Record<string, string> = {
|
||||||
|
"html": "htmlbars",
|
||||||
|
"js": "javascript",
|
||||||
|
"ts": "typescript",
|
||||||
|
"rs": "rust",
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
function Markdown({ children, className }: MarkdownProps) {
|
function Markdown({ children, className }: MarkdownProps) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -70,8 +78,8 @@ function Markdown({ children, className }: MarkdownProps) {
|
|||||||
},
|
},
|
||||||
code({ inline, className, children, ...props }) {
|
code({ inline, className, children, ...props }) {
|
||||||
const match = /language-(\w+)/.exec(className || "");
|
const match = /language-(\w+)/.exec(className || "");
|
||||||
if (match && match[1] === "file")
|
const language = match ? match[1] : "";
|
||||||
return parseFile(children.toString());
|
if (language) return parseFile(children.toString());
|
||||||
return !inline && match ? (
|
return !inline && match ? (
|
||||||
<div className={`markdown-syntax`}>
|
<div className={`markdown-syntax`}>
|
||||||
<div className={`markdown-syntax-header`}>
|
<div className={`markdown-syntax-header`}>
|
||||||
@ -84,13 +92,13 @@ function Markdown({ children, className }: MarkdownProps) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<p>{match[1]}</p>
|
<p>{language}</p>
|
||||||
</div>
|
</div>
|
||||||
<SyntaxHighlighter
|
<SyntaxHighlighter
|
||||||
{...props}
|
{...props}
|
||||||
children={String(children).replace(/\n$/, "")}
|
children={String(children).replace(/\n$/, "")}
|
||||||
style={style}
|
style={style}
|
||||||
language={match[1]}
|
language={LanguageMap[language] || language}
|
||||||
PreTag="div"
|
PreTag="div"
|
||||||
wrapLongLines={true}
|
wrapLongLines={true}
|
||||||
wrapLines={true}
|
wrapLines={true}
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
} from "@/utils/env.ts";
|
} from "@/utils/env.ts";
|
||||||
import { getMemory } from "@/utils/memory.ts";
|
import { getMemory } from "@/utils/memory.ts";
|
||||||
|
|
||||||
export const version = "3.6.11";
|
export const version = "3.6.12";
|
||||||
export const dev: boolean = getDev();
|
export const dev: boolean = getDev();
|
||||||
export const deploy: boolean = true;
|
export const deploy: boolean = true;
|
||||||
export let rest_api: string = getRestApi(deploy);
|
export let rest_api: string = getRestApi(deploy);
|
||||||
@ -21,7 +21,7 @@ export const supportModels: Model[] = [
|
|||||||
{ id: "gpt-3.5-turbo-0613", name: "GPT-3.5", free: true, auth: false },
|
{ id: "gpt-3.5-turbo-0613", name: "GPT-3.5", free: true, auth: false },
|
||||||
{ id: "gpt-3.5-turbo-16k-0613", name: "GPT-3.5-16k", free: true, auth: true },
|
{ id: "gpt-3.5-turbo-16k-0613", name: "GPT-3.5-16k", free: true, auth: true },
|
||||||
{ id: "gpt-4-0613", name: "GPT-4", free: false, auth: true },
|
{ id: "gpt-4-0613", name: "GPT-4", free: false, auth: true },
|
||||||
{ id: "gpt-4v", name: "GPT-4V", free: false, auth: true },
|
{ id: "gpt-4-v", name: "gpt-4-v", free: false, auth: true },
|
||||||
{ id: "gpt-4-dalle", name: "DALLE3", free: false, auth: true },
|
{ id: "gpt-4-dalle", name: "DALLE3", free: false, auth: true },
|
||||||
|
|
||||||
// anthropic models
|
// anthropic models
|
||||||
@ -64,7 +64,7 @@ export const largeContextModels = [
|
|||||||
|
|
||||||
export const planModels = [
|
export const planModels = [
|
||||||
"gpt-4-0613",
|
"gpt-4-0613",
|
||||||
"gpt-4v",
|
"gpt-4-v",
|
||||||
"gpt-4-dalle",
|
"gpt-4-dalle",
|
||||||
"claude-2-100k",
|
"claude-2-100k",
|
||||||
];
|
];
|
||||||
|
@ -46,7 +46,7 @@ const (
|
|||||||
GPT3Turbo16k0613 = "gpt-3.5-turbo-16k-0613"
|
GPT3Turbo16k0613 = "gpt-3.5-turbo-16k-0613"
|
||||||
GPT3Turbo16k0301 = "gpt-3.5-turbo-16k-0301"
|
GPT3Turbo16k0301 = "gpt-3.5-turbo-16k-0301"
|
||||||
GPT4 = "gpt-4"
|
GPT4 = "gpt-4"
|
||||||
GPT4Vision = "gpt-4v"
|
GPT4Vision = "gpt-4-v"
|
||||||
GPT40314 = "gpt-4-0314"
|
GPT40314 = "gpt-4-0314"
|
||||||
GPT40613 = "gpt-4-0613"
|
GPT40613 = "gpt-4-0613"
|
||||||
GPT432k = "gpt-4-32k"
|
GPT432k = "gpt-4-32k"
|
||||||
|
Loading…
Reference in New Issue
Block a user