Openai
जनवरी 15, 2023
0
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
start_sequence = "\nAI:"
restart_sequence = "\nHuman: "
response = openai.Completion.create(
model="text-davinci-003",
prompt="The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.\n\nHuman: Hello, who are you?\nAI: I am an AI created by OpenAI. How can I help you today?\nHuman: \nAI: What kind of help do you have in mind?\nHuman: what are your a \nAI: I am an Artificial Intelligence system, capable of answering questions and performing tasks. I am here to help you with whatever you need!\nHuman: aap hame English shikha shakti \nAI: Yes, I can help you learn English! What would you like to know?\nHuman: mujhe English nahi ati hay mujhe Hindi aati No problem! I can help you learn English from Hindi. Would you like me to help you get started or do you have any questions for me?",
temperature=0.9,
max_tokens=150,
top_p=1,
frequency_penalty=0,
presence_penalty=0.6,
stop=[" Human:", " AI:"]
)
अन्य ऐप में शेयर करें