# Request to GPT Model

This block allows you to send requests to classic generative models from Open AI prior to ChatGPT. With it, you can create new texts on demand, perform various tasks:

* classification,
* summarization,
* translation and rewriting of texts,
* writing code prototypes in different programming languages,
* parsing semi-structured and unstructured data,
* extracting and processing facts,
* maintaining a dialogue on various topics, and much more.

Payment for the use of this functionality is deducted from the client's account on the platform. For testing purposes, each new User is given the opportunity to test this functionality free of charge. After the development of the Robot is completed, payment is required for using this functionality.

<table data-header-hidden><thead><tr><th width="283.36663818359375" valign="top"></th><th width="314.63336181640625" valign="top"></th></tr></thead><tbody><tr><td valign="top">Request</td><td valign="top">[Text] Enter your request in natural language.</td></tr><tr><td valign="top">Model</td><td valign="top">Select a model for text generation. The "text-davinci-003" model offers the highest quality generation, but its use is the most expensive and slowest. Other models may provide cheaper and faster results at the cost of some loss in generation quality. Use trial and error to find the model that best suits your tasks.</td></tr><tr><td valign="top">Your model name</td><td valign="top">[Text] Specify your model name supported by Sherpa AI Server.</td></tr><tr><td valign="top">Stop words</td><td valign="top">[Text/List] A string or list containing no more than 4 lines that will stop further generation. The returned text will not contain these words.</td></tr><tr><td valign="top">Temperature</td><td valign="top"><p>[Number] A decimal number from 0 to 1 indicating the degree of "randomness" or "creativity" of the result, where:</p><ul><li>0 - least creative result,</li><li>1 - most random.</li></ul><p>For most creative tasks, a value of 0.7 is more suitable, and if you want to receive the same answer for the same request every time, set the value to 0.</p></td></tr><tr><td valign="top">Maximum length</td><td valign="top"><p>[Number] The maximum length of the result, expressed in conditional tokens.</p><p>For English, 1 token is 4 characters, for most other languages, 1 token is 1 character.</p><p>Reduce this number if you want to receive shorter responses on average, increase it for longer responses. Note that this number limits the length of the response, but the response may not necessarily be the length you specified - depending on the content of the request, it may be shorter.</p></td></tr><tr><td valign="top">Auto-length limit</td><td valign="top"><p>When enabled, the specified maximum length will be automatically adjusted.</p><p>This is calculated based on the number of tokens in the request and the maximum possible number of tokens for the selected model.</p></td></tr><tr><td valign="top">Timeout</td><td valign="top"><p>[Number] The maximum wait time for a response in seconds. The actual wait time depends on the selected model, the length of your request, and the expected length of the response, as well as the current load on the servers.</p><p>If the set timeout limit is exceeded, an error occurs.</p></td></tr><tr><td valign="top">Number of attempts</td><td valign="top">[Number] The number of attempts in case of a connection error with the server.</td></tr><tr><td valign="top">Response</td><td valign="top">[Text] The response of the generative model to the request.</td></tr><tr><td valign="top">Final length</td><td valign="top">[Number] The final length of the request and result (combined), expressed in conditional tokens.</td></tr><tr><td valign="top">Error handling level</td><td valign="top"><p>Select the error handling level. Possible values:</p><ul><li>"Default" - default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are handled.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Message level</td><td valign="top"><p>Select the message level that the blocks will output during operation. Possible values:</p><ul><li>"Default" - default;</li><li>"Release" - output disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Error text</td><td valign="top">[Text] Returns detailed information about the error in case of incorrect execution of the block's work.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/spravochnik-blokov/mashinnoe-obuchenie-machine-learning/zapros-k-gpt-modeli-chatgptrequest.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
