GPT API: Difference between revisions

657 bytes added ,  15 July 2023
 
(3 intermediate revisions by the same user not shown)
Line 53: Line 53:


'''Uses:'''
'''Uses:'''
#When you receive responses from the model you can append the response to the ''messages'' array before the next ''user'' message.
#When you receive responses from the model you can append the response to the ''[[#messages|messages]]'' array before the next ''[[#user|user]]'' message.
#You can supply the ''assistant'' messages to show the model examples.
#You can supply the ''assistant'' messages to show the model examples.


Line 90: Line 90:


===n===
===n===
n is a number value that allows you to get multiple responses. Each response will be a different object inside the ''[[#choices|choices]]'' array.
'''n''' is a number value that allows you to get multiple responses. Each response will be a different object inside the ''[[#choices|choices]]'' array.
*Note that the content of each choice may be the same, especially for short answers or if you're using a low ''[[#temperature|temperature]]''.<ref name="”1”"></ref>
*Note that the content of each choice may be the same, especially for short answers or if you're using a low ''[[#temperature|temperature]]''.<ref name="”1”"></ref>
===stop===
'''stop''' is an array of strings that tells the model to stop generating text when it encounters one of the strings. You can provide up to 4 strings to the stop array. The stop string found will Not be included in the response.
===max_tokens===
<pre>
max_tokens: 100,
</pre>
'''max_tokens''' is a number value that indicates the maximum number of [[tokens]] the model will generate before stopping. For example, if the max_tokens is 100, the model will generate 100 tokens (approximately 75 words) before stopping.
===presence_penalty===
'''presence_penalty'''
===frequency_penalty===
'''frequency_penalty'''


==Response Fields==
==Response Fields==
223

edits