main
黄海 5 months ago
parent 261cbaed8b
commit 1f53e1fa28

@ -1,12 +1,10 @@
import os
from openai import OpenAI
# https://help.aliyun.com/zh/model-studio/developer-reference/deepseek?spm=a2c4g.11186623.0.0.274b1d1c4GY0Zd
from pathlib import Path
# https://help.aliyun.com/zh/model-studio/developer-reference/deepseek?spm=a2c4g.11186623.0.0.274b1d1c4GY0Zd
API_KEY = "sk-01d13a39e09844038322108ecdbd1bbc"
client = OpenAI(
# 若没有配置环境变量请用百炼API Key将下行替换为api_key="sk-xxx",
api_key=API_KEY, # 如何获取API Keyhttps://help.aliyun.com/zh/model-studio/developer-reference/get-api-key
api_key=API_KEY,
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)
@ -20,19 +18,11 @@ else:
print(f"文件 {file_path} 不存在")
exit(0)
# Send request.
completion = client.chat.completions.create(
model="deepseek-v3", # 此处以 deepseek-r1 为例,可按需更换模型名称。
messages=[
{'role': 'user', 'content': "帮我梳理:这节课分了几个部分,每部分的名称和开始的时间是多少:"+content}
]
)
# 通过reasoning_content字段打印思考过程
#print("思考过程:")
#print(completion.choices[0].message.reasoning_content)
# 通过content字段打印最终答案
print("最终答案:")
print(completion.choices[0].message.content)

@ -1,5 +1,4 @@
from pptx.dml.color import RGBColor
from run import default
# 模板配置

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save