diff --git a/components/ask/hello.tsx b/components/ask/hello.tsx index 21282e9..39cf38b 100644 --- a/components/ask/hello.tsx +++ b/components/ask/hello.tsx @@ -36,7 +36,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell // // role: 'assistant', // // timestamp: new Date().toISOString() // // } - // // ]); + // // const sessionId = await createNewConversation(text); // if (!sessionId) { diff --git a/components/ask/utils.ts b/components/ask/utils.ts index 79f046a..fb1250d 100644 --- a/components/ask/utils.ts +++ b/components/ask/utils.ts @@ -3,7 +3,6 @@ import { Message } from "@/types/ask"; import * as FileSystem from 'expo-file-system'; import * as MediaLibrary from 'expo-media-library'; import { TFunction } from "i18next"; -import { useCallback } from "react"; import { Alert } from 'react-native'; // 实现一个函数,从两个数组中轮流插入新数组 @@ -19,12 +18,12 @@ export const mergeArrays = (arr1: any[], arr2: any[]) => { // 创建新对话并获取消息 -export const createNewConversation = useCallback(async (user_text: string) => { +export const createNewConversation = async (user_text: string) => { const data = await fetchApi("/chat/new", { method: "POST", }); return data -}, []); +}; // 获取对话信息 export const getConversation = async ({