mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: format with prettier
This commit is contained in:
parent
03fb09c3d6
commit
a147ad6610
164 changed files with 11257 additions and 8154 deletions
|
|
@ -1,32 +1,65 @@
|
|||
import { getAPIUrl } from "@services/config/config";
|
||||
import { RequestBody } from "@services/utils/ts/requests";
|
||||
import { getAPIUrl } from '@services/config/config'
|
||||
import { RequestBody } from '@services/utils/ts/requests'
|
||||
|
||||
export async function startActivityAIChatSession(message: string, activity_uuid: string) {
|
||||
export async function startActivityAIChatSession(
|
||||
message: string,
|
||||
activity_uuid: string
|
||||
) {
|
||||
const data = {
|
||||
message,
|
||||
activity_uuid,
|
||||
};
|
||||
const result = await fetch(`${getAPIUrl()}ai/start/activity_chat_session`, RequestBody("POST", data, null));
|
||||
const json = await result.json();
|
||||
}
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}ai/start/activity_chat_session`,
|
||||
RequestBody('POST', data, null)
|
||||
)
|
||||
const json = await result.json()
|
||||
if (result.status === 200) {
|
||||
return { success: true, data: json, status: result.status, HTTPmessage: result.statusText };
|
||||
return {
|
||||
success: true,
|
||||
data: json,
|
||||
status: result.status,
|
||||
HTTPmessage: result.statusText,
|
||||
}
|
||||
} else {
|
||||
return { success: false, data: json, status: result.status, HTTPmessage: result.statusText };
|
||||
return {
|
||||
success: false,
|
||||
data: json,
|
||||
status: result.status,
|
||||
HTTPmessage: result.statusText,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function sendActivityAIChatMessage(message: string, aichat_uuid: string, activity_uuid: string) {
|
||||
export async function sendActivityAIChatMessage(
|
||||
message: string,
|
||||
aichat_uuid: string,
|
||||
activity_uuid: string
|
||||
) {
|
||||
const data = {
|
||||
aichat_uuid,
|
||||
message,
|
||||
activity_uuid,
|
||||
};
|
||||
const result = await fetch(`${getAPIUrl()}ai/send/activity_chat_message`, RequestBody("POST", data, null));
|
||||
}
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}ai/send/activity_chat_message`,
|
||||
RequestBody('POST', data, null)
|
||||
)
|
||||
|
||||
const json = await result.json();
|
||||
const json = await result.json()
|
||||
if (result.status === 200) {
|
||||
return { success: true, data: json, status: result.status, HTTPmessage: result.statusText };
|
||||
return {
|
||||
success: true,
|
||||
data: json,
|
||||
status: result.status,
|
||||
HTTPmessage: result.statusText,
|
||||
}
|
||||
} else {
|
||||
return { success: false, data: json, status: result.status, HTTPmessage: result.statusText };
|
||||
return {
|
||||
success: false,
|
||||
data: json,
|
||||
status: result.status,
|
||||
HTTPmessage: result.statusText,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue