1

I am trying to use "text-davinci-002" model using "openai". The returned text is a single sentence while the same sentence returns a full text in openAI official example. This is the code used:

response = openai.Completion.create(
            model="email to ask for a promotion",
            prompt=userPrompt,
            temperature=0.76
            )

The output of this code is: *Hello [Employer],

I would like to request a promotion*

while the same sentence in OpenAI website here outputs: * Hello [Employer],

I would like to request a promotion to the position of [position you want]. I have been with the company for [amount of time] and I feel that I have the experience and qualifications needed for the position.*

Thank you in advance

1 Answers1

1
import openai
openai.api_key = "YOUR_API_KEY"
    
model_name = "text-davinci-002"
prompt = "email to ask for a promotion"

completion = openai.Completion.create(
    model=model_name,
    prompt=prompt,
    n=1,
    stop=None,
    temperature=0.5,
    max_tokens=150
)

generated_text = completion.choices[0].text
print(generated_text)

Model must be a correct model name, in your case "text-davinci-002"

seizu
  • 477
  • 4
  • 9