优化代码,提高解耦
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from config import OPENAI_API_KEY
|
||||
from openai import OpenAI
|
||||
import json
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
def create_client():
|
||||
api_key = os.getenv("OPENAI_API_KEY")
|
||||
return OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
|
||||
return OpenAI(api_key=OPENAI_API_KEY, base_url="https://api.deepseek.com")
|
||||
|
||||
def get_weather(location):
|
||||
# 模拟获得天气信息
|
||||
|
||||
Reference in New Issue
Block a user