@crestal/nation-sdk 0.7.16 → 0.7.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/api.ts +245 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +112 -1
- package/dist/api.js +299 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/AgentApi.md +53 -0
- package/docs/ChatApi.md +116 -0
- package/docs/LLMModelInfoWithProviderName.md +2 -2
- package/index.ts +1 -1
- package/package.json +1 -1
package/docs/ChatApi.md
CHANGED
|
@@ -12,8 +12,10 @@ All URIs are relative to *http://localhost*
|
|
|
12
12
|
|[**getSkillHistory**](#getskillhistory) | **GET** /agents/{aid}/skill/history | Skill History|
|
|
13
13
|
|[**listChatsForAgent**](#listchatsforagent) | **GET** /agents/{aid}/chats | List chat threads for an agent|
|
|
14
14
|
|[**listMessagesInChat**](#listmessagesinchat) | **GET** /agents/{aid}/chats/{chat_id}/messages | List messages in a chat thread|
|
|
15
|
+
|[**listMessagesInDraft**](#listmessagesindraft) | **GET** /agents/{aid}/draft/messages | List messages in an agent draft session|
|
|
15
16
|
|[**retryMessageInChat**](#retrymessageinchat) | **POST** /agents/{aid}/chats/{chat_id}/messages/retry | Retry a message in a chat thread|
|
|
16
17
|
|[**sendMessageToChat**](#sendmessagetochat) | **POST** /agents/{aid}/chats/{chat_id}/messages | Send a message to a chat thread|
|
|
18
|
+
|[**sendMessageToDraft**](#sendmessagetodraft) | **POST** /agents/{aid}/draft/messages | Send a message to an agent draft session|
|
|
17
19
|
|[**updateChatThread**](#updatechatthread) | **PATCH** /agents/{aid}/chats/{chat_id} | Update a chat thread|
|
|
18
20
|
|
|
19
21
|
# **clearChatThreadMemory**
|
|
@@ -434,6 +436,64 @@ const { status, data } = await apiInstance.listMessagesInChat(
|
|
|
434
436
|
| **limit** | [**number**] | Maximum number of messages to return | (optional) defaults to 20|
|
|
435
437
|
|
|
436
438
|
|
|
439
|
+
### Return type
|
|
440
|
+
|
|
441
|
+
**ChatMessagesResponse**
|
|
442
|
+
|
|
443
|
+
### Authorization
|
|
444
|
+
|
|
445
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
446
|
+
|
|
447
|
+
### HTTP request headers
|
|
448
|
+
|
|
449
|
+
- **Content-Type**: Not defined
|
|
450
|
+
- **Accept**: application/json
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
### HTTP response details
|
|
454
|
+
| Status code | Description | Response headers |
|
|
455
|
+
|-------------|-------------|------------------|
|
|
456
|
+
|**200** | Successful Response | - |
|
|
457
|
+
|**422** | Validation Error | - |
|
|
458
|
+
|
|
459
|
+
[[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)
|
|
460
|
+
|
|
461
|
+
# **listMessagesInDraft**
|
|
462
|
+
> ChatMessagesResponse listMessagesInDraft()
|
|
463
|
+
|
|
464
|
+
Retrieve the message history for the draft chat session of an agent with cursor-based pagination.
|
|
465
|
+
|
|
466
|
+
### Example
|
|
467
|
+
|
|
468
|
+
```typescript
|
|
469
|
+
import {
|
|
470
|
+
ChatApi,
|
|
471
|
+
Configuration
|
|
472
|
+
} from '@crestal/nation-sdk';
|
|
473
|
+
|
|
474
|
+
const configuration = new Configuration();
|
|
475
|
+
const apiInstance = new ChatApi(configuration);
|
|
476
|
+
|
|
477
|
+
let aid: string; //Agent ID (default to undefined)
|
|
478
|
+
let cursor: string; //Cursor for pagination (message id) (optional) (default to undefined)
|
|
479
|
+
let limit: number; //Maximum number of messages to return (optional) (default to 20)
|
|
480
|
+
|
|
481
|
+
const { status, data } = await apiInstance.listMessagesInDraft(
|
|
482
|
+
aid,
|
|
483
|
+
cursor,
|
|
484
|
+
limit
|
|
485
|
+
);
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Parameters
|
|
489
|
+
|
|
490
|
+
|Name | Type | Description | Notes|
|
|
491
|
+
|------------- | ------------- | ------------- | -------------|
|
|
492
|
+
| **aid** | [**string**] | Agent ID | defaults to undefined|
|
|
493
|
+
| **cursor** | [**string**] | Cursor for pagination (message id) | (optional) defaults to undefined|
|
|
494
|
+
| **limit** | [**number**] | Maximum number of messages to return | (optional) defaults to 20|
|
|
495
|
+
|
|
496
|
+
|
|
437
497
|
### Return type
|
|
438
498
|
|
|
439
499
|
**ChatMessagesResponse**
|
|
@@ -548,6 +608,62 @@ const { status, data } = await apiInstance.sendMessageToChat(
|
|
|
548
608
|
| **chatId** | [**string**] | Chat ID | defaults to undefined|
|
|
549
609
|
|
|
550
610
|
|
|
611
|
+
### Return type
|
|
612
|
+
|
|
613
|
+
**Array<ChatMessage>**
|
|
614
|
+
|
|
615
|
+
### Authorization
|
|
616
|
+
|
|
617
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
618
|
+
|
|
619
|
+
### HTTP request headers
|
|
620
|
+
|
|
621
|
+
- **Content-Type**: application/json
|
|
622
|
+
- **Accept**: application/json
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
### HTTP response details
|
|
626
|
+
| Status code | Description | Response headers |
|
|
627
|
+
|-------------|-------------|------------------|
|
|
628
|
+
|**200** | Successful Response | - |
|
|
629
|
+
|**422** | Validation Error | - |
|
|
630
|
+
|
|
631
|
+
[[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)
|
|
632
|
+
|
|
633
|
+
# **sendMessageToDraft**
|
|
634
|
+
> Array<ChatMessage> sendMessageToDraft(chatMessageRequest)
|
|
635
|
+
|
|
636
|
+
Send a message to the draft chat session of an agent. The response contains the messages generated by the agent for the draft session. If streaming is requested, the response will be a Server-Sent Events (SSE) stream with event type \'message\'.
|
|
637
|
+
|
|
638
|
+
### Example
|
|
639
|
+
|
|
640
|
+
```typescript
|
|
641
|
+
import {
|
|
642
|
+
ChatApi,
|
|
643
|
+
Configuration,
|
|
644
|
+
ChatMessageRequest
|
|
645
|
+
} from '@crestal/nation-sdk';
|
|
646
|
+
|
|
647
|
+
const configuration = new Configuration();
|
|
648
|
+
const apiInstance = new ChatApi(configuration);
|
|
649
|
+
|
|
650
|
+
let aid: string; //Agent ID (default to undefined)
|
|
651
|
+
let chatMessageRequest: ChatMessageRequest; //
|
|
652
|
+
|
|
653
|
+
const { status, data } = await apiInstance.sendMessageToDraft(
|
|
654
|
+
aid,
|
|
655
|
+
chatMessageRequest
|
|
656
|
+
);
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
### Parameters
|
|
660
|
+
|
|
661
|
+
|Name | Type | Description | Notes|
|
|
662
|
+
|------------- | ------------- | ------------- | -------------|
|
|
663
|
+
| **chatMessageRequest** | **ChatMessageRequest**| | |
|
|
664
|
+
| **aid** | [**string**] | Agent ID | defaults to undefined|
|
|
665
|
+
|
|
666
|
+
|
|
551
667
|
### Return type
|
|
552
668
|
|
|
553
669
|
**Array<ChatMessage>**
|
|
@@ -27,8 +27,8 @@ Name | Type | Description | Notes
|
|
|
27
27
|
**supports_presence_penalty** | **boolean** | | [optional] [default to true]
|
|
28
28
|
**api_base** | **string** | | [optional] [default to undefined]
|
|
29
29
|
**timeout** | **number** | | [optional] [default to 180]
|
|
30
|
-
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-09-
|
|
31
|
-
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-09-
|
|
30
|
+
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-09-26T08:41:26.444+00:00]
|
|
31
|
+
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-09-26T08:41:26.444+00:00]
|
|
32
32
|
**provider_name** | **string** | | [default to undefined]
|
|
33
33
|
|
|
34
34
|
## Example
|
package/index.ts
CHANGED