跳到正文
掘金 · 人工智能· 掘黄金的打工人·· 3 小时前AI 评分25

Python 调用 DeepSeek 构建基础 AI Agent

AI-Agent python

AI 导读

Python 通过 OpenAI SDK 调用 DeepSeek 的 deepseek-flash 模型,搭建可进行智能对话的基础 AI Agent。代码从环境变量读取 API Key 和 base_url,发送 system 与 user 消息,并以 reasoning_effort="high"、thinking enabled 开启深度思考,stream=False 一次性获取回复。

来源:掘金 · 人工智能 · juejin.cn