题意:使用 openai-api 时出现 TypeError(类型错误)
问题背景:
Using the code below and openai version 0.28.0 i get an error which i can't resolve:
使用以下代码和 openai 版本 0.28.0 时,我遇到了一个无法解决的错误:
File "", line 11, in TypeError: string indices must be integers, not 'str'
文件“”,第 11 行,出现 TypeError:字符串索引必须是整数,而不是 'str'
Which indice is it complaining about. Seems I'm a little blind today...
它在抱怨哪个索引呢?看来我今天有点盲目…
import requests
from bs4 import BeautifulSoup
from docx import Document
import openai
# Set your OpenAI API key
openai.api_key = "xxxxx