import os
import openai
text=input("intrebare : ")


#os.remove('raspuns.txt')
#os.remove('audio.mp3')


openai.api_key = "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"

# list engines
engine="text-davinci-003"

# print the first engine's id
#print(engines.data[9].id)

# create a completion
completion = response = openai.Completion.create(
  engine="text-davinci-003",
  prompt=(text),
  temperature=0,
  max_tokens=175,
  top_p=1,
  frequency_penalty=1,
  presence_penalty=0
)

# print the completion
print(completion.choices[0].text)
#repeta tot blocul pana se inchide programul
while True:
    text=input("intrebare : ")
    completion = response = openai.Completion.create(
      engine="text-davinci-003",
      prompt=(text),
      temperature=0.7,
      max_tokens=170,
      top_p=1,
      frequency_penalty=3,
      presence_penalty=0,
    )

    print(completion.choices[0].text)
    print()

    #text-davinci-003
  
    
