You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
787 B
27 lines
787 B
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
@Time : 2023/3/30 18:04
|
|
@Author :
|
|
@FileName:
|
|
@Software:
|
|
@Describe:
|
|
"""
|
|
import openai
|
|
import flask
|
|
|
|
def chat_drop():
|
|
openai.api_key = "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"
|
|
res = openai.ChatCompletion.create(
|
|
model="gpt-3.5-turbo",
|
|
messages=[
|
|
{"role": "user", "content": "请帮我改写这句话:在城市发展进程当中,逐渐呈现出一些综合性的大型建筑群。"},
|
|
{"role": "assistant", "content": "随着城市的发展,综合性大型建筑群正在逐渐出现。"},
|
|
{"role": "user", "content": "这句话我不满意,再改一下帮我"}
|
|
],
|
|
temperature=0.5,
|
|
top_p=1,
|
|
)
|
|
print(res.choices[0].message.content)
|
|
|
|
chat_drop()
|