> For the complete documentation index, see [llms.txt](https://utca.knowledgator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utca.knowledgator.com/tasks/chat-tasks-utilities.md).

# Chat tasks utilities

***

***

## <mark style="color:green;">ChatInput</mark>

Subclass of [**IOModel**](/core/schemas.md#iomodel)**.**

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**prompt**</mark>**&#x20;(str)**

***

***

***

## <mark style="color:green;">ChatOutput</mark>

Subclass of [**IOModel**](/core/schemas.md#iomodel)**.**

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**message**</mark>**&#x20;(str)**

***

***

***

## <mark style="color:green;">ChatStreamOutput</mark>

Subclass of [**IOModel**](/core/schemas.md#iomodel)**.**

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**stream**</mark>**&#x20;(Generator\[str, None, None])**

***

***

***

## <mark style="color:green;">ChatAddContext</mark>

Add context to new messages. Subclass of [**Action**](/core/action.md). Type of [**Action**](/core/action.md)**\[Dict\[str, Any], Dict\[str, Any]**].

***

### <mark style="color:blue;">execute</mark>

#### Arguments:

* <mark style="color:orange;">**input\_data**</mark>**&#x20;(Dict\[str, Any]):** \
  Expected keys:
  * <mark style="color:red;">**"messages"**</mark>**&#x20;(Iterable\[ChatCompletionMessageParam]):** Input messages.
  * <mark style="color:red;">**"context"**</mark>**&#x20;(Iterable\[ChatCompletionMessageParam]):** Context messages.

#### Returns:

* **Dict\[str, Any]:** \
  Expected keys:
  * <mark style="color:red;">**"messages"**</mark>**&#x20;(Iterable\[ChatCompletionMessageParam]):** Context messages and input messages.

***

***

***

## <mark style="color:green;">ChatUpdateContext</mark>

Update chat context. Subclass of [**Action**](/core/action.md). Type of [**Action**](/core/action.md)**\[Dict\[str, Any], Dict\[str, Any]**].

***

### <mark style="color:blue;">execute</mark>

#### Arguments:

* <mark style="color:orange;">**input\_data**</mark>**&#x20;(Dict\[str, Any]):** \
  Expected keys:
  * <mark style="color:red;">**"message"**</mark>**&#x20;(str):** Response message.
  * <mark style="color:red;">**"context"**</mark>**&#x20;(Iterable\[ChatCompletionMessageParam]):** Context.

#### Returns:

* **Dict\[str, Any]:** \
  Expected keys:
  * <mark style="color:red;">**"context"**</mark>**&#x20;(Iterable\[ChatCompletionMessageParam]):** Updated context.

***

***
