# 下面是python_LLM的环境变量,要引用的时候直接复制就行了
import openai
import pandas as pd
openai.api_key="sk_GbP"#这里填API
#定义好询问函数
def get_completion(prompt, model="gpt-3.5-turbo"):
messages = [{"role": "user", "content": prompt}]
response = openai.ChatCompletion.create(
model=model,
messages=messages,
temperature=0, # this is the degree of randomness of the model's output
)
return response.choices[0].message["content"]
# 如何快速的应用chatgpt
get_completion("""告诉我setiment是什么意思""")#几乎可以说是最为简单的版本了