diff --git a/dsRag/T8_CallDeepSeek.py b/dsRag/T8_CallDeepSeek.py new file mode 100644 index 00000000..80c99488 --- /dev/null +++ b/dsRag/T8_CallDeepSeek.py @@ -0,0 +1,19 @@ +# 安装 OpenAI SDK: +# pip install openai +from openai import OpenAI +from Config.Config import * +# 创建 API 客户端 +client = OpenAI(api_key=DEEPSEEK_API_KEY, base_url="https://api.deepseek.com") + +# 调用 deepseek-chat 模型 +response = client.chat.completions.create( + model="deepseek-chat", + messages=[ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "什么是CNN神经网络?"}, + ], + stream=False # 设置为 True 可启用流式输出 +) + +# 输出响应内容 +print(response.choices[0].message.content) \ No newline at end of file diff --git a/dsRag/T8_RAG.py b/dsRag/T9_RAG.py similarity index 100% rename from dsRag/T8_RAG.py rename to dsRag/T9_RAG.py