OpenAI API 調(diào)用
獲取 openai api api-key
https://platform.openai.com/account/api-keys文章來源:http://www.zghlxwxcb.cn/news/detail-665695.html
利用 python requests 請(qǐng)求 openai
參考 openai 接口說明:https://platform.openai.com/docs/api-reference/chat/create文章來源地址http://www.zghlxwxcb.cn/news/detail-665695.html
import json # 導(dǎo)入json包
import requests # 導(dǎo)入requests包
url = 'https://api.openai.com/v1/chat/completions' # 你的API URL
api_key = 'xxx' # 你的API KEY
headers = {
到了這里,關(guān)于【大模型AIGC系列課程 1-2】創(chuàng)建并部署自己的ChatGPT機(jī)器人的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!