diff --git a/dsRag/Config/Config.py b/dsRag/Config/Config.py index 79a46e78..520bee08 100644 --- a/dsRag/Config/Config.py +++ b/dsRag/Config/Config.py @@ -10,5 +10,6 @@ ES_CONFIG = { # 词向量模型路径 WORD2VEC_MODEL_PATH = r"D:\Tencent_AILab_ChineseEmbedding\Tencent_AILab_ChineseEmbedding.txt" -# DeepSeek API KEY +# DeepSeek DEEPSEEK_API_KEY = 'sk-44ae895eeb614aa1a9c6460579e322f1' +DEEPSEEK_URL = 'https://api.deepseek.com' diff --git a/dsRag/Config/__pycache__/Config.cpython-310.pyc b/dsRag/Config/__pycache__/Config.cpython-310.pyc index 753a22ba..b4871591 100644 Binary files a/dsRag/Config/__pycache__/Config.cpython-310.pyc and b/dsRag/Config/__pycache__/Config.cpython-310.pyc differ diff --git a/dsRag/T8_CallDeepSeek.py b/dsRag/T8_CallDeepSeek.py index 80c99488..31790512 100644 --- a/dsRag/T8_CallDeepSeek.py +++ b/dsRag/T8_CallDeepSeek.py @@ -1,9 +1,10 @@ # 安装 OpenAI SDK: # pip install openai from openai import OpenAI -from Config.Config import * +from Config import Config + # 创建 API 客户端 -client = OpenAI(api_key=DEEPSEEK_API_KEY, base_url="https://api.deepseek.com") +client = OpenAI(api_key=Config.DEEPSEEK_API_KEY, base_url=Config.DEEPSEEK_URL) # 调用 deepseek-chat 模型 response = client.chat.completions.create( @@ -16,4 +17,4 @@ response = client.chat.completions.create( ) # 输出响应内容 -print(response.choices[0].message.content) \ No newline at end of file +print(response.choices[0].message.content)