How to add parameter from the client side to server in openAI API

I need to display the sentiment and tone of a prompt in the response body of POSTMAN API. I am restricted to use the prompt like this "'Generate subject line for ‘Black Friday’.\n Display correctly mood of the prompt in 'Tone: ’ ". Only I have to use “Generate subject line for ‘Black Friday’.” and with other parameters like temperature, Freq_penalty etc I want to add a parameter which which display’s mood(happy, sad, angry etc), sentiment in the response body. Kindly provide me the answer.

I’m not sure I 100% understand your question, but it sounds like you’re wanting sentiment analysis…


Curie is extremely powerful, yet very fast. While Davinci is stronger when it comes to analyzing complicated text, Curie is quite capable for many nuanced tasks like sentiment classification and summarization. Curie is also quite good at answering questions and performing Q&A and as a general service chatbot.

Good at: Language translation, complex classification, text sentiment, summarization

What do you have as your complete prompt now… and what are you trying to do exactly?

Hello Paul,

Thanks for the reply. I am posting the screenshot from Postman API which will show the JSON response body. In body there is only Prompt: " Generate subject line for ‘Black Friday’ " with all the required parameters with n=5. In the response body it generated 5 subject texts. But, in response body I also want to see sentiment or Tone= Happy, Sad, Exited from the generated prompt as a separate response. For that I need a parameter extra in the OpenAI Text Completion API which can also easily understand the sentiment for the prompt. Like-

“text”: “\n\nDon’t Miss Out on the Best Deals of the Year - Black Friday!”,
“Sentiment or Tone”: Happy or Sad or Exited etc

         "index": 0,
        "logprobs": null,
        "finish_reason": "stop"

You need to run the resulting headlines through the API a second time (probably with a smaller model like in the link I dropped…) The second time, when you send the headline, you can ask for the sentiment.

There’s no way to do it all in one API call, I believe.

Maybe you could give it a few examples, though, in your prompt…

Generate subject line for ‘Black Friday

  1. \n\nDon’t Miss Out on the Best Deals of the Year - Black Friday!
    Sentiment: Excited
    Generate subject line for XXXXXX

So, the prompt would then know you want sentiment also. It might not be as good of a result as sending it by itself, though.

Hope this helps!


Can you please help out, I’m finding it difficult to use the “chat” preset with the text davinci 003 model as an API