# Request to GigaChat

This block allows you to send requests to the generative models of GigaChat. 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 using 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="311.2833251953125" valign="top"></th><th width="323.56671142578125" valign="top"></th></tr></thead><tbody><tr><td valign="top">Chat History</td><td valign="top"><p>[Data Table] Add the chat history, based on the context of which the neural network should generate a response. The specified data table must contain columns named "role" and "content".</p><p>If such columns are absent, the first column of the table will be used as "role" and the second column as "content". In the "role" column, you can specify only one of the following values:</p><ul><li>system,</li><li>assistant,</li><li>user.</li></ul><p>The system role is intended for setting the tone and basic settings of the neural network, for example:</p><ul><li>with the "system" role, you can write <code>"You are a helpful assistant on used cars selection. You know everything on how to choose the best deal for a used car"</code>;</li><li>with the "assistant" role, it is recommended to include previous messages generated by the neural network itself;</li><li>with the "user" role, it is recommended to include utterances written by the user-interlocutor.</li></ul><p>Older messages should be placed at the beginning of the table, newer ones at the end. The "content" column should contain the message itself.</p><p>This property can be left empty, in which case generation will be performed only based on the contents of the "Role" and "Request" properties.</p><p>If the "Tools" property is used, then the table must have 4 columns:</p><ul><li>"role",</li><li>"content",</li><li>"tool_call_id",</li><li>"name".</li></ul></td></tr><tr><td valign="top">System Request</td><td valign="top">[Text] Enter the text of the new request to the neural network. The request will be executed with the system role.</td></tr><tr><td valign="top">User Request</td><td valign="top">[Text] Enter the text of the new request to the neural network. The request will be executed with the user role.</td></tr><tr><td valign="top">Model</td><td valign="top">Select a model for generating a response.</td></tr><tr><td valign="top">Temperature</td><td valign="top"><p>[Number] A decimal number from 0 to 2 that indicates the degree of "randomness" or "creativity" of the result, where:</p><ul><li>0 - least creative result,</li><li>2 - 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 response 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 the English language, 1 token is 4 characters, for most other languages, 1 token is 1 character.</p><p>Reduce this number if you want to receive, on average, shorter requests, increase it for longer requests. Keep in mind that this number limits the length of the response; however, the received response may not necessarily be of the length you specified - depending on the content of the request, it may be shorter.</p></td></tr><tr><td valign="top">Auto Length Limiting</td><td valign="top">When enabled, the specified maximum length will be automatically adjusted. This is done by calculating the number of tokens in the request and considering the maximum possible number of tokens for the selected model.</td></tr><tr><td valign="top">Timeout</td><td valign="top">[Number] The maximum waiting time for a response in seconds. The actual waiting time depends on the selected model, the length of your request, and the anticipated length of the response, as well as the current server load. If the set timeout limit is exceeded, an error occurs.</td></tr><tr><td valign="top">Response Role</td><td valign="top">[Text] The role with which the neural network responded.</td></tr><tr><td valign="top">Response</td><td valign="top">[Text] The text of the neural network's response.</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" - by default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are processed.</li></ul><p>If "Default" is selected, the value of 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" - by default;</li><li>"Release" - output is disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</li></ul><p>If "Default" is selected, the value of 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-gigachat-sbergigachatrequest.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.
