|
|
|
@ -1,18 +1,18 @@
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
import time
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
from typing import Iterator, Optional
|
|
|
|
|
from D1_Config import *
|
|
|
|
|
|
|
|
|
|
import dashscope
|
|
|
|
|
from dashscope import Generation
|
|
|
|
|
from dashscope.api_entities.dashscope_response import DashScopeAPIResponse
|
|
|
|
|
from D1_Config import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MarkdownGenerator:
|
|
|
|
|
"""Markdown教学大纲生成器"""
|
|
|
|
|
|
|
|
|
|
# 固定配置项
|
|
|
|
|
# MODEL_R1 = "deepseek-r1"
|
|
|
|
|
MODEL_R1 = "deepseek-r1"
|
|
|
|
|
MODEL_V3 = "deepseek-v3"
|
|
|
|
|
API_KEY = "sk-01d13a39e09844038322108ecdbd1bbc"
|
|
|
|
|
|
|
|
|
@ -61,7 +61,7 @@ class MarkdownGenerator:
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return Generation.call(
|
|
|
|
|
model=self.MODEL_V3,
|
|
|
|
|
model=self.MODEL_R1,
|
|
|
|
|
api_key=self.API_KEY,
|
|
|
|
|
messages=[
|
|
|
|
|
{"role": "system", "content": system_prompt},
|
|
|
|
@ -137,3 +137,15 @@ if __name__ == "__main__":
|
|
|
|
|
course_name="小学数学三角形面积",
|
|
|
|
|
output_path=mdWorkingPath / '5.md'
|
|
|
|
|
)
|
|
|
|
|
# 生成PPT
|
|
|
|
|
# 硬编码配置参数
|
|
|
|
|
FIXED_MD_PATH = str(mdWorkingPath) + '/5.md'
|
|
|
|
|
# 模板名称
|
|
|
|
|
TEMPLATE_NAME = "通用"
|
|
|
|
|
# 输出路径
|
|
|
|
|
OUTPUT_PATH = "D:\dsWork\QingLong\output5.pptx"
|
|
|
|
|
# 执行生成
|
|
|
|
|
generate(TEMPLATE_NAME, OUTPUT_PATH, FIXED_MD_PATH)
|
|
|
|
|
print(f"PPT生成成功!保存路径:{OUTPUT_PATH}")
|
|
|
|
|
|
|
|
|
|
# 生成 DOCX
|
|
|
|
|