stash code

This commit is contained in:
lloydzhou
2024-08-29 19:55:09 +08:00
parent d2cb984ced
commit 571ce11e53
5 changed files with 213 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ import {
useAccessStore,
useAppConfig,
useChatStore,
usePluginStore,
} from "@/app/store";
import { collectModelsWithDefaultModel } from "@/app/utils/model";
import {
@@ -240,6 +241,11 @@ export class ChatGPTApi implements LLMApi {
);
}
if (shouldStream) {
const [tools1, funcs2] = usePluginStore
.getState()
.getAsTools(useChatStore.getState().currentSession().mask?.plugin);
console.log("getAsTools", tools1, funcs2);
// return
// TODO mock tools and funcs
const tools = [
{
@@ -276,8 +282,8 @@ export class ChatGPTApi implements LLMApi {
chatPath,
requestPayload,
getHeaders(),
tools,
funcs,
tools1,
funcs2,
controller,
// parseSSE
(text: string, runTools: ChatMessageTool[]) => {