Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

supported llm: aliyun qianwen

harry121ef12a74f7
diff --git a/README-en.md b/README-en.md
index 57a041ce..8f88a6ef 100644
--- a/README-en.md
+++ b/README-en.md
@@ -38,7 +38,8 @@ https://reccloud.com
supports `subtitle outlining`
- [x] Supports **background music**, either random or specified music files, with adjustable `background music volume`
- [x] Video material sources are **high-definition** and **royalty-free**
-- [x] Supports integration with various models such as **OpenAI**, **moonshot**, **Azure**, **gpt4free**, **one-api**,
+- [x] Supports integration with various models such as **OpenAI**, **moonshot**, **Azure**, **gpt4free**, **one-api**, *
+ *qianwen**
and more
### Future Plans 📅
@@ -258,7 +259,8 @@ Thanks to [@wangwenqiao666](https://github.com/wangwenqiao666) for their researc
## Feedback & Suggestions 📢
-- You can submit an [issue](https://github.com/harry0703/MoneyPrinterTurbo/issues) or a [pull request](https://github.com/harry0703/MoneyPrinterTurbo/pulls).
+- You can submit an [issue](https://github.com/harry0703/MoneyPrinterTurbo/issues) or
+ a [pull request](https://github.com/harry0703/MoneyPrinterTurbo/pulls).
## Reference Projects 📚
diff --git a/README.md b/README.md
index 3517e004..6e70077d 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@
- [x] 支持 **字幕生成**,可以调整 `字体`、`位置`、`颜色`、`大小`,同时支持`字幕描边`设置
- [x] 支持 **背景音乐**,随机或者指定音乐文件,可设置`背景音乐音量`
- [x] 视频素材来源 **高清**,而且 **无版权**
-- [x] 支持 **OpenAI**、**moonshot**、**Azure**、**gpt4free**、**one-api** 等多种模型接入
+- [x] 支持 **OpenAI**、**moonshot**、**Azure**、**gpt4free**、**one-api**、**通义千问** 等多种模型接入
### 后期计划 📅
diff --git a/app/services/llm.py b/app/services/llm.py
index 9cb05c61..ebcf127e 100644
--- a/app/services/llm.py
+++ b/app/services/llm.py
@@ -2,14 +2,12 @@ import logging
import re
import json
from typing import List
-import g4f
from loguru import logger
from openai import OpenAI
from openai import AzureOpenAI
from app.config import config
-
def _generate_response(prompt: str) -> str:
content = ""
llm_provider = config.app.get("llm_provider", "openai")
@@ -18,7 +16,7 @@ def _generate_response(prompt: str) -> str:
model_name = config.app.get("g4f_model_name", "")
if not model_name:
model_name = "gpt-3.5-turbo-16k-0613"
-
+ import g4f
content = g4f.ChatCompletion.create(
model=model_name,
messages=[{"role": "user", "content": prompt}],
@@ -57,21 +55,17 @@ def _generate_response(prompt: str) -> str:
raise ValueError(f"{llm_provider}: model_name is not set, please set it in the config.toml file.")
if not base_url:
raise ValueError(f"{llm_provider}: base_url is not set, please set it in the config.toml file.")
-
-
- import dashscope
if llm_provider == "qwen":
+ import dashscope
dashscope.api_key = api_key
response = dashscope.Generation.call(
model=model_name,
- messages=[{"role": "user", "content": prompt}]
+ messages=[{"role": "user", "content": prompt}]
)
- content=response["output"]["text"]
- print(content)
+ content = response["output"]["text"]
return content.replace("\n", "")
-
if llm_provider == "azure":
client = AzureOpenAI(
api_key=api_key,
diff --git a/requirements.txt b/requirements.txt
index 8bb62135..651f46a4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -12,4 +12,5 @@ aiohttp~=3.9.3
urllib3~=2.2.1
pillow~=9.5.0
pydantic~=2.6.3
-g4f~=0.2.5.4
\ No newline at end of file
+g4f~=0.2.5.4
+dashscope~=1.15.0
\ No newline at end of file