# AIChatApi

All URIs are relative to *http://localhost:8081*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**apply**](#apply) | **POST** /api/v1/ai/reorganization/{planId}/apply | Apply a proposed reorganisation plan|
|[**chat**](#chat) | **POST** /api/v1/ai/chat | Chat with AI assistant|
|[**deleteConversation**](#deleteconversation) | **DELETE** /api/v1/ai/conversations/{conversationId} | Delete conversation|
|[**discard**](#discard) | **POST** /api/v1/ai/reorganization/{planId}/discard | Discard a proposed reorganisation plan|
|[**get3**](#get3) | **GET** /api/v1/ai/reorganization/{planId} | Get a reorganisation plan proposed by the AI assistant|
|[**getConversationHistory**](#getconversationhistory) | **GET** /api/v1/ai/conversations/{conversationId} | Get conversation history|
|[**listConversations**](#listconversations) | **GET** /api/v1/ai/conversations | List conversations|
|[**proposeByKind**](#proposebykind) | **POST** /api/v1/ai/reorganization/by-kind | Propose a reorganisation by kind of document — no model involved|

# **apply**
> ReorganizationApplyResult apply()

Creates the missing folders and moves the selected items (all applicable items when none is given).

### Example

```typescript
import {
    AIChatApi,
    Configuration,
    ReorganizationApplyRequest
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let planId: string; // (default to undefined)
let reorganizationApplyRequest: ReorganizationApplyRequest; // (optional)

const { status, data } = await apiInstance.apply(
    planId,
    reorganizationApplyRequest
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **reorganizationApplyRequest** | **ReorganizationApplyRequest**|  | |
| **planId** | [**string**] |  | defaults to undefined|


### Return type

**ReorganizationApplyResult**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **chat**
> Array<AiChatResponse> chat(aiChatRequest)

Send a message and receive a streaming response. The AI can answer questions about documents, search, summarize, and reorganize files.

### Example

```typescript
import {
    AIChatApi,
    Configuration,
    AiChatRequest
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let aiChatRequest: AiChatRequest; //

const { status, data } = await apiInstance.chat(
    aiChatRequest
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **aiChatRequest** | **AiChatRequest**|  | |


### Return type

**Array<AiChatResponse>**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: text/event-stream


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **deleteConversation**
> deleteConversation()

Delete a conversation and all its messages

### Example

```typescript
import {
    AIChatApi,
    Configuration
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let conversationId: string; // (default to undefined)

const { status, data } = await apiInstance.deleteConversation(
    conversationId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **conversationId** | [**string**] |  | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **discard**
> ReorganizationPlanView discard()


### Example

```typescript
import {
    AIChatApi,
    Configuration
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let planId: string; // (default to undefined)

const { status, data } = await apiInstance.discard(
    planId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **planId** | [**string**] |  | defaults to undefined|


### Return type

**ReorganizationPlanView**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get3**
> ReorganizationPlanView get3()

The plan\'s items (what moves where), which are applicable, and its status.

### Example

```typescript
import {
    AIChatApi,
    Configuration
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let planId: string; // (default to undefined)

const { status, data } = await apiInstance.get3(
    planId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **planId** | [**string**] |  | defaults to undefined|


### Return type

**ReorganizationPlanView**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getConversationHistory**
> Array<AiChatResponse> getConversationHistory()

Get all messages in a conversation

### Example

```typescript
import {
    AIChatApi,
    Configuration
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let conversationId: string; // (default to undefined)

const { status, data } = await apiInstance.getConversationHistory(
    conversationId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **conversationId** | [**string**] |  | defaults to undefined|


### Return type

**Array<AiChatResponse>**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **listConversations**
> Array<AiChatConversation> listConversations()

Get all AI chat conversations for the current user

### Example

```typescript
import {
    AIChatApi,
    Configuration
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

const { status, data } = await apiInstance.listConversations();
```

### Parameters
This endpoint does not have any parameters.


### Return type

**Array<AiChatConversation>**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **proposeByKind**
> ReorganizationPlanView proposeByKind()

Every folder of the scope holding documents of several kinds (their insight category) gets one sub-folder per kind, named like the existing folders (Invoices / Factures…) or else in the request\'s language, and the files move there. The answer is a stored plan to review and apply; a plan without an id means nothing needs splitting.

### Example

```typescript
import {
    AIChatApi,
    Configuration,
    ReorganizationByKindRequest
} from '@openfilz-sdk/typescript';

const configuration = new Configuration();
const apiInstance = new AIChatApi(configuration);

let reorganizationByKindRequest: ReorganizationByKindRequest; // (optional)

const { status, data } = await apiInstance.proposeByKind(
    reorganizationByKindRequest
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **reorganizationByKindRequest** | **ReorganizationByKindRequest**|  | |


### Return type

**ReorganizationPlanView**

### Authorization

[keycloak_auth](../README.md#keycloak_auth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

