fix
This commit is contained in:
parent
9de8c3b5c7
commit
60152a64f0
@ -36,7 +36,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
|
|||||||
// // role: 'assistant',
|
// // role: 'assistant',
|
||||||
// // timestamp: new Date().toISOString()
|
// // timestamp: new Date().toISOString()
|
||||||
// // }
|
// // }
|
||||||
// // ]);
|
// //
|
||||||
|
|
||||||
const sessionId = await createNewConversation(text);
|
const sessionId = await createNewConversation(text);
|
||||||
// if (!sessionId) {
|
// if (!sessionId) {
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { Message } from "@/types/ask";
|
|||||||
import * as FileSystem from 'expo-file-system';
|
import * as FileSystem from 'expo-file-system';
|
||||||
import * as MediaLibrary from 'expo-media-library';
|
import * as MediaLibrary from 'expo-media-library';
|
||||||
import { TFunction } from "i18next";
|
import { TFunction } from "i18next";
|
||||||
import { useCallback } from "react";
|
|
||||||
import { Alert } from 'react-native';
|
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", {
|
const data = await fetchApi<string>("/chat/new", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
});
|
});
|
||||||
return data
|
return data
|
||||||
}, []);
|
};
|
||||||
|
|
||||||
// 获取对话信息
|
// 获取对话信息
|
||||||
export const getConversation = async ({
|
export const getConversation = async ({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user