I am using the Python Open AI API to give definitions for words automatically and return the text result, but it is giving too much text.
response = openai.Completion.create(
model="text-davinci-003",
prompt="give a definition for "+str(definition),
temperature=0.7,
max_tokens=50,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
print( str(response['choices'][0]['text']))
However, it would return something like this:
1. Definition: A statement that explains the meaning of a word or phrase.
2. High-definition Television: A type of television system that provides a much higher resolution than a standard-definition television.
3. Standard
It is giving me too much text; how can I narrow it down to just give the first result?