import openai
import time
import os
from multiprocessing import Pool, cpu_count
from tqdm import tqdm
openai.api_key = "123123"
PROMPT = """请从文章中抽取出所有的航空航天领域科学技术术语,以列表形式给出。\n
输出格式:\n
1. xxx \n
2. xxx \n
"""
def get_response(content, temperature=0.1, max_tokens=2048):
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
temperature=0,
top_p=0,
# max_tokens=max_tokens,
messages=[
{ "role": "system", "content": f"{PROMPT}"},
{ "role": "user", "content": f"{content}" }
]
)
print(completion)
return completion.choices[0]['message']['content']
#
res = get_response("这三种在设计、任务
openai的api使用教程
最新推荐文章于 2025-04-30 19:15:49 发布