# Request to GroqChat

This block allows you to send requests to the GroqChat generative models. 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 the use of this functionality.

<table data-header-hidden><thead><tr><th width="306.81671142578125" valign="top"></th><th width="322.44989013671875" 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, only one of the following values can be specified:</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 statements 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 the model for generating the response.</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 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 shorter requests on average, increase it for longer requests. Keep in mind that this number limits the length of the response, but the 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">Tools</td><td valign="top"><p>[Data Table] A table describing the tools that the neural network can choose to solve the task instead of a text response. This functionality is not supported by all models.</p><p>The data table must contain three columns:</p><ul><li>"name" - the name of the tool (Latin letters and numbers, no more than 64 characters),</li><li>"description" - a description of the tool (can be in languages other than English),</li><li>"parameters" - arguments passed to the tool when it is called in JSON format.</li></ul><p>Example JSON description of parameters: <code>"{\"type\": \"object\", \"properties\": { \"query\": { \"type\": \"string\", \"description\": \"Request for a Google search result\" } }, \"required\": [\"query\"] }"</code>.</p><p>When calling the tool, the neural network will select the appropriate tool from the available ones based on the description of the tools you provided, and will also fill (generate) the values of the parameters you specified for calling these tools.</p><p>More details about the mechanism for using tools can be found in the description of the output property CalledTools.</p></td></tr><tr><td valign="top">Timeout</td><td valign="top"><p>[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 load on the servers.</p><p>If the established waiting limit is exceeded, an error occurs.</p></td></tr><tr><td valign="top">Response Schema</td><td valign="top">[Text] The response schema in JSON format. For example:<br>{<br>"name": "weather",<br>"strict": true,<br>"schema": {<br>"type": "object",<br>"properties": {<br>"location": {<br>"type": "string",<br>"description": "City or location name"<br>},<br>"temperature": {<br>"type": "number",<br>"description": "Temperature in Celsius"<br>},<br>"conditions": {<br>"type": "string",<br>"description": "Weather conditions description"<br>}<br>},<br>"required": ["location", "temperature", "conditions"],<br>"additionalProperties": false<br>}<br>}</td></tr><tr><td valign="top">Number of Attempts</td><td valign="top">[Number] The number of attempts in case of a server connection error.</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">Reflections</td><td valign="top">[Text] The neural network's reflections (if they are present in the 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">Called Tools</td><td valign="top"><p>[List] A list of ToolItem objects.</p><p>If the neural network suggests using one or more tools instead of a text response after the request, the list of ToolItem objects will be returned in this property.</p><p>The object contains the following properties:</p><ul><li>id,</li><li>name,</li><li>arguments.</li></ul><p>The values of id and name should be used in the "Chat History" table. The arguments property is a dictionary where the key is the name of the parameter of the called tool, and the value is the value of that parameter generated by the neural network.</p><p>When using the tools mechanism, after calling this block, you must check whether the neural network selected any tool based on the contents of this list.</p><p>If the list is not empty, you must implement the functionality of the selected tool or tools in the Robot's scenario, and then in the next call of this block return the result of the tool's execution to the neural network, which the neural network will use in generating subsequent messages.</p><p>The result of the tool's execution must be recorded in the "Chat History" table as follows:</p><ul><li>the constant value "tool" is recorded in the "role" column,</li><li>the value of the tool's execution result (which you implemented in your scenario and now report this result to the neural network) is recorded in the "content" column,</li><li>the current ToolItem.id value is recorded in the "tool_call_id" column,</li><li>the current ToolItem.name value is recorded in the "name" column.</li></ul></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 handled.</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.</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-groqchat-groqchatrequest.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.
