This commit is contained in:
Junhui Chen 2025-08-09 14:50:38 +08:00
parent 9de8c3b5c7
commit 60152a64f0
2 changed files with 3 additions and 4 deletions

View File

@ -36,7 +36,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
// // role: 'assistant',
// // timestamp: new Date().toISOString()
// // }
// // ]);
// //
const sessionId = await createNewConversation(text);
// if (!sessionId) {

View File

@ -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<string>("/chat/new", {
method: "POST",
});
return data
}, []);
};
// 获取对话信息
export const getConversation = async ({