<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[remote](../../) / [Exports](../modules) / HttpClient

# Class: HttpClient

Simple HTTP Client for Remote Communication

## Table of contents

### Constructors

- [constructor](HttpClient#constructor)

### Methods

- [post](HttpClient#post)
- [get](HttpClient#get)
- [chat](HttpClient#chat)
- [chatStream](HttpClient#chatstream)
- [validateConfig](HttpClient#validateconfig)

## Constructors

### constructor

• **new HttpClient**(`config`): [`HttpClient`](HttpClient)

#### Parameters

| Name     | Type                |
| :------- | :------------------ |
| `config` | `IHttpClientConfig` |

#### Returns

[`HttpClient`](HttpClient)

#### Defined in

[remote/src/client/http-client.ts:34](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/remote/src/client/http-client.ts#L34)

## Methods

### post

▸ **post**\<`TData`, `TResponse`\>(`endpoint`, `data`): `Promise`\<[`IHttpResponse`](../interfaces/IHttpResponse)\<`TResponse`\>\>

Send POST request with type safety

#### Type parameters

| Name        | Type                          |
| :---------- | :---------------------------- |
| `TData`     | extends `TDefaultRequestData` |
| `TResponse` | `TResponse`                   |

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `endpoint` | `string` |
| `data`     | `TData`  |

#### Returns

`Promise`\<[`IHttpResponse`](../interfaces/IHttpResponse)\<`TResponse`\>\>

#### Defined in

[remote/src/client/http-client.ts:42](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/remote/src/client/http-client.ts#L42)

---

### get

▸ **get**\<`TResponse`\>(`endpoint`): `Promise`\<[`IHttpResponse`](../interfaces/IHttpResponse)\<`TResponse`\>\>

Send GET request with type safety

#### Type parameters

| Name        |
| :---------- |
| `TResponse` |

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `endpoint` | `string` |

#### Returns

`Promise`\<[`IHttpResponse`](../interfaces/IHttpResponse)\<`TResponse`\>\>

#### Defined in

[remote/src/client/http-client.ts:60](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/remote/src/client/http-client.ts#L60)

---

### chat

▸ **chat**(`messages`, `provider`, `model`, `tools?`): `Promise`\<[`IResponseMessage`](../interfaces/IResponseMessage)\>

Execute chat request specifically

#### Parameters

| Name       | Type                                             |
| :--------- | :----------------------------------------------- |
| `messages` | [`IBasicMessage`](../interfaces/IBasicMessage)[] |
| `provider` | `string`                                         |
| `model`    | `string`                                         |
| `tools?`   | `any`[]                                          |

#### Returns

`Promise`\<[`IResponseMessage`](../interfaces/IResponseMessage)\>

#### Defined in

[remote/src/client/http-client.ts:75](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/remote/src/client/http-client.ts#L75)

---

### chatStream

▸ **chatStream**(`messages`, `provider`, `model`, `tools?`): `AsyncGenerator`\<[`IResponseMessage`](../interfaces/IResponseMessage), `any`, `any`\>

Execute streaming chat request

#### Parameters

| Name       | Type                                             |
| :--------- | :----------------------------------------------- |
| `messages` | [`IBasicMessage`](../interfaces/IBasicMessage)[] |
| `provider` | `string`                                         |
| `model`    | `string`                                         |
| `tools?`   | `any`[]                                          |

#### Returns

`AsyncGenerator`\<[`IResponseMessage`](../interfaces/IResponseMessage), `any`, `any`\>

#### Defined in

[remote/src/client/http-client.ts:134](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/remote/src/client/http-client.ts#L134)

---

### validateConfig

▸ **validateConfig**(): `boolean`

Validate configuration

#### Returns

`boolean`

#### Defined in

[remote/src/client/http-client.ts:279](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/remote/src/client/http-client.ts#L279)
