下面王五的帖子说得蛮清楚的。

from openai import OpenAI

def send_messages(messages):
    response = client.chat.completions.create(
        model="deepseek-chat",//modifying the configuration 
        messages=messages,
        tools=tools
    )
    return response.choices[0].message

client = OpenAI(
    api_key="",
    base_url="https://api.deepseek.com", //modifying the configuration
)

 

The DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the DeepSeek API.

请您先登陆,再发跟帖!