Commit 9f33b0ca authored by 周成波's avatar 周成波

改一下LLM接口名称

parent fbf3035b
......@@ -4,12 +4,12 @@
import request from '@/api/request'
export default {
submitGpt(prompt: string, llm: string = "gpt"): Promise<string> {
submitLLM(prompt: string, llm: string = "gpt"): Promise<string> {
if (!prompt) {
return Promise.reject("输入不能为空");
}
const post_data = { source_text: prompt, llm: llm }
return request.post('/text2video/text2gpt', post_data)
return request.post('/text2video/text2llm', post_data)
.then((res: any) => {
// console.log(res);
if (res && res.code === 0) {
......
This diff is collapsed.
......@@ -47,7 +47,7 @@ const fanyi_llm_name = qwen.name
const voice_rate = ref(-15)
const voice_volume = ref(0)
const voice = ref("zh-CN-YunjianNeural")
const bgm = ref("")
const bgm = ref("解忧曲")
onMounted(() => {
......@@ -59,7 +59,7 @@ const delay = (ms: any) => new Promise(res => setTimeout(res, ms));
const onSubmitGpt = () => {
text2videoService
.submitGpt(form.chatgpt_prompt, wenan_llm)
.submitLLM(form.chatgpt_prompt, wenan_llm)
.then((result: string) => {
console.log(form.chatgpt_prompt);
console.log(result);
......@@ -89,7 +89,7 @@ const onAdaptRoles = async () => {
const adapt_restrict = `
指令:
请理解这个故事,给出这个故事中的所有角色,多个角色以逗号分隔`;
const roles = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
const roles = await text2videoService.submitLLM("故事:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
form.all_roles = roles.replace(/。/g, '').replace(/、/g, ',')
console.log(form.all_roles)
const roles_arr = form.all_roles.split(/[,,]/);
......@@ -106,7 +106,7 @@ const onAdaptRoles = async () => {
要求:
关键词以逗号分隔。
只要返回关键词,不需要其他的说明文字。`;
let keywords = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
let keywords = await text2videoService.submitLLM("故事:\n" + form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
keywords = keywords.replace(/。/g, '').replace(/、/g, ',')
form.chatgpt_answer_roles.push({
"角色": one_role.trim(),
......@@ -211,7 +211,7 @@ const onAdaptOne = async (item: any) => {
要求:
关键词以逗号分隔。
只要返回关键词,不需要其他的说明文字。`;
const keywords = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n" + adapt_restrict, tuili_llm);
const keywords = await text2videoService.submitLLM("故事:\n" + form.chatgpt_answer + "\n" + adapt_restrict, tuili_llm);
// console.log(keywords)
item.场景关键词 = keywords;
if (form.chatgpt_answer_roles.length === 0) {
......@@ -223,7 +223,7 @@ const onAdaptOne = async (item: any) => {
const adapt_role_restrict = `
指令:
请理解这个故事,针对其中的这个场景:“${item.场景描述}”,从所有角色中选择本场景的角色,多个角色以逗号分隔。`;
const item_roles = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n所有角色:\n"+ form.all_roles +"\n" + adapt_role_restrict, tuili_llm);
const item_roles = await text2videoService.submitLLM("故事:\n" + form.chatgpt_answer + "\n所有角色:\n"+ form.all_roles +"\n" + adapt_role_restrict, tuili_llm);
// console.log(role_keywords)
item.角色 = item_roles;
let role_kws = ""
......@@ -280,7 +280,7 @@ const onDrawOne = async (item: any) => {
if (item.场景关键词) {temp_prompt = temp_prompt + `场景关键词为:${item.场景关键词}\n`};
if (item.角色) {temp_prompt = temp_prompt + `场景中的角色有:${item.角色}\n`};
if (item.角色关键词) {temp_prompt = temp_prompt + `角色关键词为:${item.角色关键词}\n`};
const sd_describe = await text2videoService.submitGpt(
const sd_describe = await text2videoService.submitLLM(
`${temp_prompt}
指令:
请理解以上内容,并返回一段英文的描述。`, fanyi_llm
......
......@@ -47,7 +47,7 @@ const fanyi_llm_name = gpt.name
const voice_rate = ref(-15)
const voice_volume = ref(0)
const voice = ref("en-US-BrianNeural")
const bgm = ref("")
const bgm = ref("解忧曲")
onMounted(() => {
// 初始化示例数据
......@@ -58,7 +58,7 @@ const delay = (ms: any) => new Promise(res => setTimeout(res, ms));
const onSubmitGpt = () => {
text2videoService
.submitGpt(form.chatgpt_prompt, wenan_llm)
.submitLLM(form.chatgpt_prompt, wenan_llm)
.then((result: string) => {
console.log(form.chatgpt_prompt);
console.log(result);
......@@ -88,7 +88,7 @@ const onAdaptRoles = async () => {
const adapt_restrict = `
Instructions:
Please understand this story and provide all the characters in it, with multiple characters separated by commas`;
const roles = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
const roles = await text2videoService.submitLLM("story:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
form.all_roles = roles.replace(/。/g, '').replace(/、/g, ',')
console.log(form.all_roles)
const roles_arr = form.all_roles.split(/[,,]/);
......@@ -105,7 +105,7 @@ const onAdaptRoles = async () => {
Requirement:
Keywords are separated by commas.
As long as the keyword is returned, no additional explanatory text is required.`;
let keywords = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
let keywords = await text2videoService.submitLLM("story:\n" + form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
keywords = keywords.replace(/。/g, '').replace(/、/g, ',')
form.chatgpt_answer_roles.push({
"角色": one_role.trim(),
......@@ -210,7 +210,7 @@ const onAdaptOne = async (item: any) => {
Requirement:
Keywords are separated by commas.
As long as the keyword is returned, no additional explanatory text is required.`;
const keywords = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n" + adapt_restrict, tuili_llm);
const keywords = await text2videoService.submitLLM("story:\n" + form.chatgpt_answer + "\n" + adapt_restrict, tuili_llm);
// console.log(keywords)
item.场景关键词 = keywords;
if (form.chatgpt_answer_roles.length === 0) {
......@@ -222,7 +222,7 @@ const onAdaptOne = async (item: any) => {
const adapt_role_restrict = `
Instructions:
Please understand this story and for the scene: "${item.场景描述}", select the character in this scene from characters, with multiple characters separated by commas.`;
const item_roles = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\ncharacters:\n"+ form.all_roles +"\n" + adapt_role_restrict, tuili_llm);
const item_roles = await text2videoService.submitLLM("story:\n" + form.chatgpt_answer + "\ncharacters:\n"+ form.all_roles +"\n" + adapt_role_restrict, tuili_llm);
// console.log(role_keywords)
item.角色 = item_roles;
let role_kws = ""
......@@ -279,7 +279,7 @@ const onDrawOne = async (item: any) => {
if (item.场景关键词) {temp_prompt = temp_prompt + `Scene keywords are: ${item.场景关键词}\n`};
if (item.角色) {temp_prompt = temp_prompt + `Characters in the scene are: ${item.角色}\n`};
if (item.角色关键词) {temp_prompt = temp_prompt + `Character keywords are: ${item.角色关键词}\n`};
const sd_describe = await text2videoService.submitGpt(
const sd_describe = await text2videoService.submitLLM(
`${temp_prompt}
Instructions:
Please understand the above content and return an English description.`, fanyi_llm
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment