Need help to understanding the code

SaeedP

Well-known member
Joined
Oct 21, 2020
Messages
113
Programming Experience
3-5
Hi,

This is part of a tutorial for OpenAI development:

Can you please help me to understand this part of the code:

C#:
Content = new StringContent("{\"model\": \"text-davinci-001\", \"prompt\": \"" +
                                            query +
                                            "\",\"temperature\": 1,\"max_tokens\": 100}",
                                            Encoding.UTF8,
                                            "application/json")

regards,

Saeed
 
This is the second time in a row that you've asked us to explain what is very basic code without any explanation of what the problem is. Please explain your actual issue.
 
All that is happening is that some manually create JSON is being passed to the StringContent class constructor. Read more about that class here:

You need to be more specific about your questions. I highly recommend also reading:

If you build up a reputation as someone who puts no effort into their posts, most of the forum regulars will also put very little effort into answering your questions.
 
If you are asking about the actual JSON payload, you should read the OpenAI documentation:

As an aside, the documentation doesn't seem to match the tutorial.
 

Latest posts

Back
Top Bottom