@crestal/nation-sdk 0.1.28 → 0.1.29
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/.openapi-generator/FILES +5 -0
- package/README.md +9 -2
- package/api.ts +398 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +264 -1
- package/dist/api.js +324 -2
- 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/AgentGenerateRequest.md +25 -0
- package/docs/AgentGenerateResponse.md +31 -0
- package/docs/GenerationDetailResponse.md +35 -0
- package/docs/GenerationsListResponse.md +21 -0
- package/docs/GeneratorApi.md +167 -0
- package/docs/LLMModelInfoWithProviderName.md +2 -2
- package/index.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# GeneratorApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**generateAgentGeneratorAgentGeneratePost**](#generateagentgeneratoragentgeneratepost) | **POST** /generator/agent/generate | Generate Agent from Natural Language Prompt|
|
|
8
|
+
|[**getGenerationDetailGeneratorAgentGenerationsProjectIdGet**](#getgenerationdetailgeneratoragentgenerationsprojectidget) | **GET** /generator/agent/generations/{project_id} | Get Generation Detail by Project ID|
|
|
9
|
+
|[**getGenerationsGeneratorAgentGenerationsGet**](#getgenerationsgeneratoragentgenerationsget) | **GET** /generator/agent/generations | Get Generations List by User|
|
|
10
|
+
|
|
11
|
+
# **generateAgentGeneratorAgentGeneratePost**
|
|
12
|
+
> AgentGenerateResponse generateAgentGeneratorAgentGeneratePost(agentGenerateRequest)
|
|
13
|
+
|
|
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
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import {
|
|
20
|
+
GeneratorApi,
|
|
21
|
+
Configuration,
|
|
22
|
+
AgentGenerateRequest
|
|
23
|
+
} from '@crestal/nation-sdk';
|
|
24
|
+
|
|
25
|
+
const configuration = new Configuration();
|
|
26
|
+
const apiInstance = new GeneratorApi(configuration);
|
|
27
|
+
|
|
28
|
+
let agentGenerateRequest: AgentGenerateRequest; //
|
|
29
|
+
|
|
30
|
+
const { status, data } = await apiInstance.generateAgentGeneratorAgentGeneratePost(
|
|
31
|
+
agentGenerateRequest
|
|
32
|
+
);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Parameters
|
|
36
|
+
|
|
37
|
+
|Name | Type | Description | Notes|
|
|
38
|
+
|------------- | ------------- | ------------- | -------------|
|
|
39
|
+
| **agentGenerateRequest** | **AgentGenerateRequest**| | |
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Return type
|
|
43
|
+
|
|
44
|
+
**AgentGenerateResponse**
|
|
45
|
+
|
|
46
|
+
### Authorization
|
|
47
|
+
|
|
48
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
49
|
+
|
|
50
|
+
### HTTP request headers
|
|
51
|
+
|
|
52
|
+
- **Content-Type**: application/json
|
|
53
|
+
- **Accept**: application/json
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### HTTP response details
|
|
57
|
+
| Status code | Description | Response headers |
|
|
58
|
+
|-------------|-------------|------------------|
|
|
59
|
+
|**200** | Successful Response | - |
|
|
60
|
+
|**422** | Validation Error | - |
|
|
61
|
+
|
|
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
|
+
|
|
64
|
+
# **getGenerationDetailGeneratorAgentGenerationsProjectIdGet**
|
|
65
|
+
> GenerationDetailResponse getGenerationDetailGeneratorAgentGenerationsProjectIdGet()
|
|
66
|
+
|
|
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
|
+
|
|
69
|
+
### Example
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import {
|
|
73
|
+
GeneratorApi,
|
|
74
|
+
Configuration
|
|
75
|
+
} from '@crestal/nation-sdk';
|
|
76
|
+
|
|
77
|
+
const configuration = new Configuration();
|
|
78
|
+
const apiInstance = new GeneratorApi(configuration);
|
|
79
|
+
|
|
80
|
+
let projectId: string; // (default to undefined)
|
|
81
|
+
|
|
82
|
+
const { status, data } = await apiInstance.getGenerationDetailGeneratorAgentGenerationsProjectIdGet(
|
|
83
|
+
projectId
|
|
84
|
+
);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Parameters
|
|
88
|
+
|
|
89
|
+
|Name | Type | Description | Notes|
|
|
90
|
+
|------------- | ------------- | ------------- | -------------|
|
|
91
|
+
| **projectId** | [**string**] | | defaults to undefined|
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Return type
|
|
95
|
+
|
|
96
|
+
**GenerationDetailResponse**
|
|
97
|
+
|
|
98
|
+
### Authorization
|
|
99
|
+
|
|
100
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
101
|
+
|
|
102
|
+
### HTTP request headers
|
|
103
|
+
|
|
104
|
+
- **Content-Type**: Not defined
|
|
105
|
+
- **Accept**: application/json
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### HTTP response details
|
|
109
|
+
| Status code | Description | Response headers |
|
|
110
|
+
|-------------|-------------|------------------|
|
|
111
|
+
|**200** | Successful Response | - |
|
|
112
|
+
|**422** | Validation Error | - |
|
|
113
|
+
|
|
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
|
+
|
|
116
|
+
# **getGenerationsGeneratorAgentGenerationsGet**
|
|
117
|
+
> GenerationsListResponse getGenerationsGeneratorAgentGenerationsGet()
|
|
118
|
+
|
|
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
|
+
|
|
121
|
+
### Example
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import {
|
|
125
|
+
GeneratorApi,
|
|
126
|
+
Configuration
|
|
127
|
+
} from '@crestal/nation-sdk';
|
|
128
|
+
|
|
129
|
+
const configuration = new Configuration();
|
|
130
|
+
const apiInstance = new GeneratorApi(configuration);
|
|
131
|
+
|
|
132
|
+
let limit: number; // (optional) (default to 50)
|
|
133
|
+
|
|
134
|
+
const { status, data } = await apiInstance.getGenerationsGeneratorAgentGenerationsGet(
|
|
135
|
+
limit
|
|
136
|
+
);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Parameters
|
|
140
|
+
|
|
141
|
+
|Name | Type | Description | Notes|
|
|
142
|
+
|------------- | ------------- | ------------- | -------------|
|
|
143
|
+
| **limit** | [**number**] | | (optional) defaults to 50|
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
### Return type
|
|
147
|
+
|
|
148
|
+
**GenerationsListResponse**
|
|
149
|
+
|
|
150
|
+
### Authorization
|
|
151
|
+
|
|
152
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
153
|
+
|
|
154
|
+
### HTTP request headers
|
|
155
|
+
|
|
156
|
+
- **Content-Type**: Not defined
|
|
157
|
+
- **Accept**: application/json
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### HTTP response details
|
|
161
|
+
| Status code | Description | Response headers |
|
|
162
|
+
|-------------|-------------|------------------|
|
|
163
|
+
|**200** | Successful Response | - |
|
|
164
|
+
|**422** | Validation Error | - |
|
|
165
|
+
|
|
166
|
+
[[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)
|
|
167
|
+
|
|
@@ -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-20T00:41:06.819+00:00]
|
|
31
|
+
**updated_at** | **string** | Timestamp when this data was updated | [optional] [default to 2025-07-20T00:41:06.819+00:00]
|
|
32
32
|
**provider_name** | **string** | | [default to undefined]
|
|
33
33
|
|
|
34
34
|
## Example
|
package/index.ts
CHANGED