Plugin runtime (#2050)

* feat: plugin run (#1950)

* feat: plugin run

* fix

* ui

* fix

* change user input type

* fix

* fix

* temp

* split out plugin chat

* perf: chatbox

* perf: chatbox

* fix: plugin runtime (#2032)

* fix: plugin runtime

* fix

* fix build

* fix build

* perf: chat send prompt

* perf: chat log ux

* perf: chatbox context and share page plugin runtime

* perf: plugin run time config

* fix: ts

* feat: doc

* perf: isPc check

* perf: variable input render

* feat: app search

* fix: response box height

* fix: phone ui

* perf: lock

* perf: plugin route

* fix: chat (#2049)

---------

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-07-15 22:50:48 +08:00
committed by GitHub
parent 090c880860
commit b5c98a4f63
126 changed files with 5012 additions and 4317 deletions

View File

@@ -8,7 +8,10 @@ import type { ListAppBody } from '@/pages/api/core/app/list';
/**
* 获取模型列表
*/
export const getMyApps = (data?: ListAppBody) => POST<AppListItemType[]>('/core/app/list', data);
export const getMyApps = (data?: ListAppBody) =>
POST<AppListItemType[]>('/core/app/list', data, {
maxQuantity: 1
});
/**
* 创建一个模型

View File

@@ -7,6 +7,7 @@ import { ChatHistoryItemType } from '@fastgpt/global/core/chat/type';
import { ClearHistoriesProps, DelHistoryProps, UpdateHistoryProps } from '@/global/core/chat/api';
import { useDisclosure } from '@chakra-ui/react';
import { useChatStore } from './storeChat';
import { getNanoid } from '@fastgpt/global/common/string/tools';
type ChatContextValueType = {
histories: ChatHistoryItemType[];
@@ -66,7 +67,6 @@ const ChatContextProvider = ({
}: ChatContextValueType & { children: ReactNode }) => {
const router = useRouter();
const { chatId = '' } = router.query as { chatId: string };
const isSystemChat = router.pathname === '/chat';
const forbidLoadChat = useRef(false);
@@ -74,7 +74,7 @@ const ChatContextProvider = ({
const { setLastChatId } = useChatStore();
const onChangeChatId = useCallback(
(changeChatId = '', forbid = false) => {
(changeChatId = getNanoid(), forbid = false) => {
if (chatId !== changeChatId) {
forbidLoadChat.current = forbid;
setLastChatId(changeChatId);