@crestal/nation-sdk 0.1.30 → 0.1.32
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 +13 -10
- package/api.ts +308 -86
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +148 -49
- package/dist/api.js +364 -86
- 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 +56 -3
- package/docs/ChatApi.md +54 -1
- package/docs/GeneratorApi.md +12 -12
- package/docs/HealthApi.md +4 -4
- package/docs/LLMModelInfoWithProviderName.md +2 -2
- package/docs/MetadataApi.md +8 -8
- package/docs/OAuthApi.md +61 -8
- package/index.ts +1 -1
- package/package.json +1 -1
package/dist/base.d.ts
CHANGED
package/dist/base.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.32
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/common.d.ts
CHANGED
package/dist/common.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.32
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/configuration.d.ts
CHANGED
package/dist/configuration.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.32
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Nation IntentKit API
|
|
6
6
|
* API for Nation IntentKit services
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 0.1.
|
|
8
|
+
* The version of the OpenAPI document: 0.1.32
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/docs/AgentApi.md
CHANGED
|
@@ -9,6 +9,7 @@ All URIs are relative to *http://localhost*
|
|
|
9
9
|
|[**getAgent**](#getagent) | **GET** /agents/{agent_id} | Get Agent|
|
|
10
10
|
|[**getAgentStatistics**](#getagentstatistics) | **GET** /agents/{aid}/statistics | Get Agent Statistics|
|
|
11
11
|
|[**getAgents**](#getagents) | **GET** /agents | Get Agents|
|
|
12
|
+
|[**getSkillHistory**](#getskillhistory) | **GET** /agents/{aid}/skill/history | Skill History|
|
|
12
13
|
|[**importAgent**](#importagent) | **PUT** /agents/{agent_id}/import | Import Agent|
|
|
13
14
|
|[**overrideAgent**](#overrideagent) | **PUT** /agents/{agent_id} | Override Agent|
|
|
14
15
|
|[**updateAgent**](#updateagent) | **PATCH** /agents/{agent_id} | Update Agent|
|
|
@@ -18,7 +19,7 @@ All URIs are relative to *http://localhost*
|
|
|
18
19
|
# **createAgent**
|
|
19
20
|
> AgentResponse createAgent()
|
|
20
21
|
|
|
21
|
-
Create a new agent. **Request Body:** * `agent` - Agent configuration **Returns:** * `AgentResponse` - Created agent configuration with additional processed data **Raises:** * `HTTPException`: - 400: Invalid agent ID format or agent ID already exists - 500: Database error
|
|
22
|
+
Create a new agent. **Request Body:** * `agent` - Agent configuration **Returns:** * `AgentResponse` - Created agent configuration with additional processed data **Raises:** * `HTTPException`: - 400: Invalid agent ID format or agent ID already exists - 422: Invalid agent configuration from JSON schema validation - 500: Database error
|
|
22
23
|
|
|
23
24
|
### Example
|
|
24
25
|
|
|
@@ -277,6 +278,58 @@ No authorization required
|
|
|
277
278
|
- **Accept**: application/json
|
|
278
279
|
|
|
279
280
|
|
|
281
|
+
### HTTP response details
|
|
282
|
+
| Status code | Description | Response headers |
|
|
283
|
+
|-------------|-------------|------------------|
|
|
284
|
+
|**200** | Successful Response | - |
|
|
285
|
+
|**422** | Validation Error | - |
|
|
286
|
+
|
|
287
|
+
[[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)
|
|
288
|
+
|
|
289
|
+
# **getSkillHistory**
|
|
290
|
+
> Array<ChatMessageSkillCall> getSkillHistory()
|
|
291
|
+
|
|
292
|
+
Get last 50 skill calls for a specific agent. **Path Parameters:** * `aid` - Agent ID **Returns:** * `List[ChatMessageSkillCall]` - List of skill calls, ordered by creation time ascending **Raises:** * `404` - Agent not found
|
|
293
|
+
|
|
294
|
+
### Example
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
import {
|
|
298
|
+
AgentApi,
|
|
299
|
+
Configuration
|
|
300
|
+
} from '@crestal/nation-sdk';
|
|
301
|
+
|
|
302
|
+
const configuration = new Configuration();
|
|
303
|
+
const apiInstance = new AgentApi(configuration);
|
|
304
|
+
|
|
305
|
+
let aid: string; //Agent ID (default to undefined)
|
|
306
|
+
|
|
307
|
+
const { status, data } = await apiInstance.getSkillHistory(
|
|
308
|
+
aid
|
|
309
|
+
);
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Parameters
|
|
313
|
+
|
|
314
|
+
|Name | Type | Description | Notes|
|
|
315
|
+
|------------- | ------------- | ------------- | -------------|
|
|
316
|
+
| **aid** | [**string**] | Agent ID | defaults to undefined|
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
### Return type
|
|
320
|
+
|
|
321
|
+
**Array<ChatMessageSkillCall>**
|
|
322
|
+
|
|
323
|
+
### Authorization
|
|
324
|
+
|
|
325
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
326
|
+
|
|
327
|
+
### HTTP request headers
|
|
328
|
+
|
|
329
|
+
- **Content-Type**: Not defined
|
|
330
|
+
- **Accept**: application/json
|
|
331
|
+
|
|
332
|
+
|
|
280
333
|
### HTTP response details
|
|
281
334
|
| Status code | Description | Response headers |
|
|
282
335
|
|-------------|-------------|------------------|
|
|
@@ -343,7 +396,7 @@ const { status, data } = await apiInstance.importAgent(
|
|
|
343
396
|
# **overrideAgent**
|
|
344
397
|
> any overrideAgent()
|
|
345
398
|
|
|
346
|
-
Override an existing agent. Use input to override agent configuration. If some fields are not provided, they will be reset to default values. **Path Parameters:** * `agent_id` - ID of the agent to update **Request Body:** * `agent` - Agent update configuration **Returns:** * `AgentResponse` - Updated agent configuration with additional processed data **Raises:** * `HTTPException`: - 400: Invalid agent ID format - 404: Agent not found - 403: Permission denied (if owner mismatch) - 500: Database error
|
|
399
|
+
Override an existing agent. Use input to override agent configuration. If some fields are not provided, they will be reset to default values. **Path Parameters:** * `agent_id` - ID of the agent to update **Request Body:** * `agent` - Agent update configuration **Returns:** * `AgentResponse` - Updated agent configuration with additional processed data **Raises:** * `HTTPException`: - 400: Invalid agent ID format - 404: Agent not found - 403: Permission denied (if owner mismatch) - 422: Invalid agent configuration from JSON schema validation - 500: Database error
|
|
347
400
|
|
|
348
401
|
### Example
|
|
349
402
|
|
|
@@ -455,7 +508,7 @@ const { status, data } = await apiInstance.updateAgent(
|
|
|
455
508
|
# **validateAgentCreate**
|
|
456
509
|
> validateAgentCreate()
|
|
457
510
|
|
|
458
|
-
Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core - 500: Server error
|
|
511
|
+
Validate agent configuration. **Request Body:** * `agent` - Agent configuration **Returns:** * `204 No Content` - Agent configuration is valid **Raises:** * `HTTPException`: - 400: Invalid agent configuration - 422: Invalid agent configuration from intentkit core or JSON schema validation - 500: Server error
|
|
459
512
|
|
|
460
513
|
### Example
|
|
461
514
|
|
package/docs/ChatApi.md
CHANGED
|
@@ -8,6 +8,7 @@ All URIs are relative to *http://localhost*
|
|
|
8
8
|
|[**deleteChatThread**](#deletechatthread) | **DELETE** /agents/{aid}/chats/{chat_id} | Delete a chat thread|
|
|
9
9
|
|[**getChatThreadById**](#getchatthreadbyid) | **GET** /agents/{aid}/chats/{chat_id} | Get chat thread by ID|
|
|
10
10
|
|[**getMessageById**](#getmessagebyid) | **GET** /messages/{message_id} | Get message by ID|
|
|
11
|
+
|[**getSkillHistory**](#getskillhistory) | **GET** /agents/{aid}/skill/history | Skill History|
|
|
11
12
|
|[**listChatsForAgent**](#listchatsforagent) | **GET** /agents/{aid}/chats | List chat threads for an agent|
|
|
12
13
|
|[**listMessagesInChat**](#listmessagesinchat) | **GET** /agents/{aid}/chats/{chat_id}/messages | List messages in a chat thread|
|
|
13
14
|
|[**retryMessageInChat**](#retrymessageinchat) | **POST** /agents/{aid}/chats/{chat_id}/messages/retry | Retry a message in a chat thread|
|
|
@@ -220,6 +221,58 @@ const { status, data } = await apiInstance.getMessageById(
|
|
|
220
221
|
- **Accept**: application/json
|
|
221
222
|
|
|
222
223
|
|
|
224
|
+
### HTTP response details
|
|
225
|
+
| Status code | Description | Response headers |
|
|
226
|
+
|-------------|-------------|------------------|
|
|
227
|
+
|**200** | Successful Response | - |
|
|
228
|
+
|**422** | Validation Error | - |
|
|
229
|
+
|
|
230
|
+
[[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)
|
|
231
|
+
|
|
232
|
+
# **getSkillHistory**
|
|
233
|
+
> Array<ChatMessageSkillCall> getSkillHistory()
|
|
234
|
+
|
|
235
|
+
Get last 50 skill calls for a specific agent. **Path Parameters:** * `aid` - Agent ID **Returns:** * `List[ChatMessageSkillCall]` - List of skill calls, ordered by creation time ascending **Raises:** * `404` - Agent not found
|
|
236
|
+
|
|
237
|
+
### Example
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
import {
|
|
241
|
+
ChatApi,
|
|
242
|
+
Configuration
|
|
243
|
+
} from '@crestal/nation-sdk';
|
|
244
|
+
|
|
245
|
+
const configuration = new Configuration();
|
|
246
|
+
const apiInstance = new ChatApi(configuration);
|
|
247
|
+
|
|
248
|
+
let aid: string; //Agent ID (default to undefined)
|
|
249
|
+
|
|
250
|
+
const { status, data } = await apiInstance.getSkillHistory(
|
|
251
|
+
aid
|
|
252
|
+
);
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Parameters
|
|
256
|
+
|
|
257
|
+
|Name | Type | Description | Notes|
|
|
258
|
+
|------------- | ------------- | ------------- | -------------|
|
|
259
|
+
| **aid** | [**string**] | Agent ID | defaults to undefined|
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
### Return type
|
|
263
|
+
|
|
264
|
+
**Array<ChatMessageSkillCall>**
|
|
265
|
+
|
|
266
|
+
### Authorization
|
|
267
|
+
|
|
268
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
269
|
+
|
|
270
|
+
### HTTP request headers
|
|
271
|
+
|
|
272
|
+
- **Content-Type**: Not defined
|
|
273
|
+
- **Accept**: application/json
|
|
274
|
+
|
|
275
|
+
|
|
223
276
|
### HTTP response details
|
|
224
277
|
| Status code | Description | Response headers |
|
|
225
278
|
|-------------|-------------|------------------|
|
|
@@ -399,7 +452,7 @@ const { status, data } = await apiInstance.retryMessageInChat(
|
|
|
399
452
|
# **sendMessageToChat**
|
|
400
453
|
> Array<ChatMessage> sendMessageToChat(chatMessageRequest)
|
|
401
454
|
|
|
402
|
-
Send a new message to a specific chat thread.
|
|
455
|
+
Send a new message to a specific chat thread. The response is a list of messages generated by the agent.The response not include the original user message. It could be skill calls, agent messages, or system error messages. If the stream mode is requested, the response will be HTTP2 streaming response.
|
|
403
456
|
|
|
404
457
|
### Example
|
|
405
458
|
|
package/docs/GeneratorApi.md
CHANGED
|
@@ -4,12 +4,12 @@ All URIs are relative to *http://localhost*
|
|
|
4
4
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
-
|[**
|
|
8
|
-
|[**
|
|
9
|
-
|[**
|
|
7
|
+
|[**generateAgent**](#generateagent) | **POST** /generator/agent/generate | Generate Agent from Natural Language Prompt|
|
|
8
|
+
|[**getGenerationHistory**](#getgenerationhistory) | **GET** /generator/agent/generations/{project_id} | Get Generation Detail by Project ID|
|
|
9
|
+
|[**getGenerations**](#getgenerations) | **GET** /generator/agent/generations | Get Generations List by User|
|
|
10
10
|
|
|
11
|
-
# **
|
|
12
|
-
> AgentGenerateResponse
|
|
11
|
+
# **generateAgent**
|
|
12
|
+
> AgentGenerateResponse generateAgent(agentGenerateRequest)
|
|
13
13
|
|
|
14
14
|
Generate an agent schema from a natural language prompt. Converts plain English descriptions into complete, validated agent configurations. Automatically identifies required skills, sets up configurations, detects autonomous task patterns, and ensures everything works correctly with intelligent error correction. **Autonomous Task Detection:** The API can automatically detect scheduling patterns in prompts like: - \"Buy 0.1 ETH every hour\" → Creates 60-minute autonomous task with CDP trade skill - \"Check portfolio daily\" → Creates 24-hour autonomous task with portfolio skills - \"Post tweet every 30 minutes\" → Creates 30-minute autonomous task with Twitter skill **Request Body:** * `prompt` - Natural language description of the agent\'s desired capabilities and schedule * `existing_agent` - Optional existing agent to update (preserves current setup while adding capabilities) * `user_id` - Required user ID for logging and rate limiting * `project_id` - Optional project ID for conversation history **Returns:** * `AgentGenerateResponse` - Contains agent schema, autonomous tasks, activated skills, project ID, and summary **Response Fields:** * `agent` - Complete agent schema with skills and autonomous configurations * `autonomous_tasks` - List of autonomous tasks detected and configured * `activated_skills` - List of skills that were activated based on the prompt * `project_id` - Project ID for conversation tracking * `summary` - Human-readable summary of the generated agent * `tags` - Generated tags for categorization **Raises:** * `HTTPException`: - 400: Invalid request (missing user_id, invalid prompt format or length) - 500: Agent generation failed after retries
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ const apiInstance = new GeneratorApi(configuration);
|
|
|
27
27
|
|
|
28
28
|
let agentGenerateRequest: AgentGenerateRequest; //
|
|
29
29
|
|
|
30
|
-
const { status, data } = await apiInstance.
|
|
30
|
+
const { status, data } = await apiInstance.generateAgent(
|
|
31
31
|
agentGenerateRequest
|
|
32
32
|
);
|
|
33
33
|
```
|
|
@@ -61,8 +61,8 @@ const { status, data } = await apiInstance.generateAgentGeneratorAgentGeneratePo
|
|
|
61
61
|
|
|
62
62
|
[[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)
|
|
63
63
|
|
|
64
|
-
# **
|
|
65
|
-
> GenerationDetailResponse
|
|
64
|
+
# **getGenerationHistory**
|
|
65
|
+
> GenerationDetailResponse getGenerationHistory()
|
|
66
66
|
|
|
67
67
|
Get specific project conversation history. **Path Parameters:** * `project_id` - Project ID to get conversation history for **Query Parameters:** * `user_id` - Optional user ID for access validation **Returns:** * `GenerationDetailResponse` - Contains full conversation history for the project **Raises:** * `HTTPException`: - 404: Project not found or access denied - 500: Failed to retrieve generation detail
|
|
68
68
|
|
|
@@ -79,7 +79,7 @@ const apiInstance = new GeneratorApi(configuration);
|
|
|
79
79
|
|
|
80
80
|
let projectId: string; // (default to undefined)
|
|
81
81
|
|
|
82
|
-
const { status, data } = await apiInstance.
|
|
82
|
+
const { status, data } = await apiInstance.getGenerationHistory(
|
|
83
83
|
projectId
|
|
84
84
|
);
|
|
85
85
|
```
|
|
@@ -113,8 +113,8 @@ const { status, data } = await apiInstance.getGenerationDetailGeneratorAgentGene
|
|
|
113
113
|
|
|
114
114
|
[[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)
|
|
115
115
|
|
|
116
|
-
# **
|
|
117
|
-
> GenerationsListResponse
|
|
116
|
+
# **getGenerations**
|
|
117
|
+
> GenerationsListResponse getGenerations()
|
|
118
118
|
|
|
119
119
|
Get all projects/generations for a user. **Query Parameters:** * `user_id` - Optional user ID to filter projects * `limit` - Maximum number of recent projects to return (default: 50, max: 100) **Returns:** * `GenerationsListResponse` - Contains list of projects with their conversation history **Raises:** * `HTTPException`: - 400: Invalid parameters - 500: Failed to retrieve generations
|
|
120
120
|
|
|
@@ -131,7 +131,7 @@ const apiInstance = new GeneratorApi(configuration);
|
|
|
131
131
|
|
|
132
132
|
let limit: number; // (optional) (default to 50)
|
|
133
133
|
|
|
134
|
-
const { status, data } = await apiInstance.
|
|
134
|
+
const { status, data } = await apiInstance.getGenerations(
|
|
135
135
|
limit
|
|
136
136
|
);
|
|
137
137
|
```
|
package/docs/HealthApi.md
CHANGED
|
@@ -4,10 +4,10 @@ All URIs are relative to *http://localhost*
|
|
|
4
4
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
-
|[**
|
|
7
|
+
|[**healthCheck**](#healthcheck) | **GET** /health | Health check endpoint|
|
|
8
8
|
|
|
9
|
-
# **
|
|
10
|
-
> any
|
|
9
|
+
# **healthCheck**
|
|
10
|
+
> any healthCheck()
|
|
11
11
|
|
|
12
12
|
Returns the health status of the API server
|
|
13
13
|
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
const configuration = new Configuration();
|
|
23
23
|
const apiInstance = new HealthApi(configuration);
|
|
24
24
|
|
|
25
|
-
const { status, data } = await apiInstance.
|
|
25
|
+
const { status, data } = await apiInstance.healthCheck();
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
### Parameters
|
|
@@ -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-07-
|
|
31
|
-
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-07-
|
|
30
|
+
**created_at** | **string** | Timestamp when this data was created | [optional] [default to 2025-07-22T06:42:43.145+00:00]
|
|
31
|
+
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-07-22T06:42:43.145+00:00]
|
|
32
32
|
**provider_name** | **string** | | [default to undefined]
|
|
33
33
|
|
|
34
34
|
## Example
|
package/docs/MetadataApi.md
CHANGED
|
@@ -5,10 +5,10 @@ All URIs are relative to *http://localhost*
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
|[**getAgentSchema**](#getagentschema) | **GET** /metadata/agent/schema.json | Get agent schema|
|
|
8
|
-
|[**
|
|
8
|
+
|[**getLlms**](#getllms) | **GET** /metadata/llms | Get all LLM models|
|
|
9
9
|
|[**getSkillIcon**](#getskillicon) | **GET** /metadata/skills/{skill}/{icon_name}.{ext} | Get skill icon|
|
|
10
10
|
|[**getSkillSchema**](#getskillschema) | **GET** /metadata/skills/{skill}/schema.json | Get skill schema|
|
|
11
|
-
|[**
|
|
11
|
+
|[**getSkills**](#getskills) | **GET** /metadata/skills | Get all skills|
|
|
12
12
|
|
|
13
13
|
# **getAgentSchema**
|
|
14
14
|
> any getAgentSchema()
|
|
@@ -54,8 +54,8 @@ No authorization required
|
|
|
54
54
|
|
|
55
55
|
[[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)
|
|
56
56
|
|
|
57
|
-
# **
|
|
58
|
-
> Array<LLMModelInfoWithProviderName>
|
|
57
|
+
# **getLlms**
|
|
58
|
+
> Array<LLMModelInfoWithProviderName> getLlms()
|
|
59
59
|
|
|
60
60
|
Returns a list of all available LLM models in the system
|
|
61
61
|
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
const configuration = new Configuration();
|
|
71
71
|
const apiInstance = new MetadataApi(configuration);
|
|
72
72
|
|
|
73
|
-
const { status, data } = await apiInstance.
|
|
73
|
+
const { status, data } = await apiInstance.getLlms();
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### Parameters
|
|
@@ -212,8 +212,8 @@ No authorization required
|
|
|
212
212
|
|
|
213
213
|
[[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)
|
|
214
214
|
|
|
215
|
-
# **
|
|
216
|
-
> Array<Skill>
|
|
215
|
+
# **getSkills**
|
|
216
|
+
> Array<Skill> getSkills()
|
|
217
217
|
|
|
218
218
|
Returns a list of all available skills in the system
|
|
219
219
|
|
|
@@ -228,7 +228,7 @@ import {
|
|
|
228
228
|
const configuration = new Configuration();
|
|
229
229
|
const apiInstance = new MetadataApi(configuration);
|
|
230
230
|
|
|
231
|
-
const { status, data } = await apiInstance.
|
|
231
|
+
const { status, data } = await apiInstance.getSkills();
|
|
232
232
|
```
|
|
233
233
|
|
|
234
234
|
### Parameters
|
package/docs/OAuthApi.md
CHANGED
|
@@ -4,11 +4,12 @@ All URIs are relative to *http://localhost*
|
|
|
4
4
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
-
|[**
|
|
8
|
-
|[**
|
|
7
|
+
|[**getTwitterAuthUrl**](#gettwitterauthurl) | **GET** /oauth/twitter | Get Twitter Auth Url|
|
|
8
|
+
|[**twitterOauthCallback**](#twitteroauthcallback) | **GET** /oauth/twitter/callback | Twitter Oauth Callback|
|
|
9
|
+
|[**unlinkTwitter**](#unlinktwitter) | **PUT** /oauth/twitter/unlink | Unlink Twitter Endpoint|
|
|
9
10
|
|
|
10
|
-
# **
|
|
11
|
-
> TwitterAuthResponse
|
|
11
|
+
# **getTwitterAuthUrl**
|
|
12
|
+
> TwitterAuthResponse getTwitterAuthUrl()
|
|
12
13
|
|
|
13
14
|
Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
|
|
14
15
|
|
|
@@ -26,7 +27,7 @@ const apiInstance = new OAuthApi(configuration);
|
|
|
26
27
|
let agentId: string; // (default to undefined)
|
|
27
28
|
let redirectUri: string; // (default to undefined)
|
|
28
29
|
|
|
29
|
-
const { status, data } = await apiInstance.
|
|
30
|
+
const { status, data } = await apiInstance.getTwitterAuthUrl(
|
|
30
31
|
agentId,
|
|
31
32
|
redirectUri
|
|
32
33
|
);
|
|
@@ -62,8 +63,8 @@ const { status, data } = await apiInstance.getTwitterAuthUrlOauthTwitterGet(
|
|
|
62
63
|
|
|
63
64
|
[[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)
|
|
64
65
|
|
|
65
|
-
# **
|
|
66
|
-
> any
|
|
66
|
+
# **twitterOauthCallback**
|
|
67
|
+
> any twitterOauthCallback()
|
|
67
68
|
|
|
68
69
|
Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
|
|
69
70
|
|
|
@@ -82,7 +83,7 @@ let state: string; // (default to undefined)
|
|
|
82
83
|
let code: string; // (optional) (default to undefined)
|
|
83
84
|
let error: string; // (optional) (default to undefined)
|
|
84
85
|
|
|
85
|
-
const { status, data } = await apiInstance.
|
|
86
|
+
const { status, data } = await apiInstance.twitterOauthCallback(
|
|
86
87
|
state,
|
|
87
88
|
code,
|
|
88
89
|
error
|
|
@@ -120,3 +121,55 @@ No authorization required
|
|
|
120
121
|
|
|
121
122
|
[[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)
|
|
122
123
|
|
|
124
|
+
# **unlinkTwitter**
|
|
125
|
+
> unlinkTwitter()
|
|
126
|
+
|
|
127
|
+
Unlink X from an agent. **Path Parameters:** * `agent_id` - ID of the agent to unlink from X **Raises:** * `HTTPException`: - 404: Agent not found
|
|
128
|
+
|
|
129
|
+
### Example
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import {
|
|
133
|
+
OAuthApi,
|
|
134
|
+
Configuration
|
|
135
|
+
} from '@crestal/nation-sdk';
|
|
136
|
+
|
|
137
|
+
const configuration = new Configuration();
|
|
138
|
+
const apiInstance = new OAuthApi(configuration);
|
|
139
|
+
|
|
140
|
+
let agentId: string; //ID of the agent to unlink from X (default to undefined)
|
|
141
|
+
|
|
142
|
+
const { status, data } = await apiInstance.unlinkTwitter(
|
|
143
|
+
agentId
|
|
144
|
+
);
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Parameters
|
|
148
|
+
|
|
149
|
+
|Name | Type | Description | Notes|
|
|
150
|
+
|------------- | ------------- | ------------- | -------------|
|
|
151
|
+
| **agentId** | [**string**] | ID of the agent to unlink from X | defaults to undefined|
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Return type
|
|
155
|
+
|
|
156
|
+
void (empty response body)
|
|
157
|
+
|
|
158
|
+
### Authorization
|
|
159
|
+
|
|
160
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
161
|
+
|
|
162
|
+
### HTTP request headers
|
|
163
|
+
|
|
164
|
+
- **Content-Type**: Not defined
|
|
165
|
+
- **Accept**: application/json
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### HTTP response details
|
|
169
|
+
| Status code | Description | Response headers |
|
|
170
|
+
|-------------|-------------|------------------|
|
|
171
|
+
|**200** | Successful Response | - |
|
|
172
|
+
|**422** | Validation Error | - |
|
|
173
|
+
|
|
174
|
+
[[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)
|
|
175
|
+
|
package/index.ts
CHANGED