@purpleschool/ai-proxy 0.1.17 → 0.2.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.
@@ -234,4 +234,19 @@ exports.ERRORS = {
234
234
  message: 'Задание на генерацию изображения не найдено',
235
235
  httpCode: 404,
236
236
  },
237
+ IMAGE_EDITOR_JOB_SAVE_ERROR: {
238
+ code: 'A047',
239
+ message: 'Произошла ошибка при сохранении задания на редактирование изображения',
240
+ httpCode: 500,
241
+ },
242
+ IMAGE_EDITOR_JOB_NOT_FOUND: {
243
+ code: 'A048',
244
+ message: 'Задание на редактирование изображения не найдено',
245
+ httpCode: 404,
246
+ },
247
+ IMAGE_EDITOR_JOB_FIND_ERROR: {
248
+ code: 'A049',
249
+ message: 'Ошибка при нахождении задание на редактирование изображения',
250
+ httpCode: 500,
251
+ },
237
252
  };
@@ -6,4 +6,5 @@ var IMAGE_GENERATION_RESPONSE_TYPE;
6
6
  IMAGE_GENERATION_RESPONSE_TYPE["URL"] = "url";
7
7
  IMAGE_GENERATION_RESPONSE_TYPE["BASE64"] = "base64";
8
8
  IMAGE_GENERATION_RESPONSE_TYPE["JOB"] = "job";
9
+ IMAGE_GENERATION_RESPONSE_TYPE["ERROR"] = "error";
9
10
  })(IMAGE_GENERATION_RESPONSE_TYPE || (exports.IMAGE_GENERATION_RESPONSE_TYPE = IMAGE_GENERATION_RESPONSE_TYPE = {}));
@@ -235,4 +235,19 @@ export const ERRORS = {
235
235
  message: 'Задание на генерацию изображения не найдено',
236
236
  httpCode: 404,
237
237
  },
238
+ IMAGE_EDITOR_JOB_SAVE_ERROR: {
239
+ code: 'A047',
240
+ message: 'Произошла ошибка при сохранении задания на редактирование изображения',
241
+ httpCode: 500,
242
+ },
243
+ IMAGE_EDITOR_JOB_NOT_FOUND: {
244
+ code: 'A048',
245
+ message: 'Задание на редактирование изображения не найдено',
246
+ httpCode: 404,
247
+ },
248
+ IMAGE_EDITOR_JOB_FIND_ERROR: {
249
+ code: 'A049',
250
+ message: 'Ошибка при нахождении задание на редактирование изображения',
251
+ httpCode: 500,
252
+ },
238
253
  };
@@ -2,4 +2,5 @@ export enum IMAGE_GENERATION_RESPONSE_TYPE {
2
2
  URL = 'url',
3
3
  BASE64 = 'base64',
4
4
  JOB = 'job',
5
+ ERROR = 'error',
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/ai-proxy",
3
- "version": "0.1.17",
3
+ "version": "0.2.18",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,5 +1,4 @@
1
1
  syntax = "proto3";
2
- import "google/protobuf/timestamp.proto";
3
2
  import "google/protobuf/struct.proto";
4
3
  package AiProxy;
5
4
 
@@ -8,6 +7,7 @@ service AiProxyService {
8
7
  rpc TextGenerationUnary (TextGenerationUnaryRequest) returns (TextGenerationUnaryResponse);
9
8
 
10
9
  rpc ImageGeneration (ImageGenerationRequest) returns (ImageGenerationResponse);
10
+ rpc ImageEditor (ImageEditorRequest) returns (ImageEditorResponse);
11
11
 
12
12
  rpc VideoGeneration (VideoGenerationRequest) returns (VideoGenerationResponse);
13
13
  rpc VideoEditor (VideoEditorRequest) returns (VideoEditorResponse);
@@ -34,14 +34,9 @@ message TextGenerationRequest {
34
34
  }
35
35
 
36
36
  message Message {
37
- optional string uuid = 1;
38
- string role = 2;
39
- string text = 3;
40
- repeated File files = 4;
41
- optional string status = 5;
42
- optional string externalId = 6;
43
- google.protobuf.Timestamp createdAt = 7;
44
- google.protobuf.Timestamp updatedAt = 8;
37
+ string role = 1;
38
+ string content = 2;
39
+ repeated File files = 3;
45
40
  }
46
41
 
47
42
  message WebSearchParams {
@@ -56,8 +51,7 @@ message UserLocation {
56
51
 
57
52
  message File {
58
53
  string url = 1;
59
- string type = 2;
60
- string mimeType = 3;
54
+ string mimeType = 2;
61
55
  }
62
56
 
63
57
  message TextGenerationResponse {
@@ -87,23 +81,37 @@ message TextGenerationUnaryResponse {
87
81
  message ImageGenerationRequest {
88
82
  string model = 1;
89
83
  string prompt = 2;
90
- optional int32 width = 3;
91
- optional int32 height = 4;
92
- repeated Message messages = 5;
84
+ string aspectRatio = 3;
85
+ optional string resolution = 4;
86
+ repeated string attachedImages = 5;
93
87
  optional string callbackUrl = 6;
94
88
  }
95
89
 
96
90
  message ImageGenerationResponse {
97
91
  string model = 1;
98
- ImageGenerationData data = 2;
92
+ ImageGenerationData response = 2;
99
93
  }
100
94
 
101
95
  message ImageGenerationData {
102
- optional string data = 1;
103
- optional string externalId = 2;
96
+ repeated string data = 1;
97
+ string externalId = 2;
104
98
  string type = 3;
99
+ optional string errorMsg = 4;
105
100
  }
106
101
 
102
+ // Image Editor
103
+ message ImageEditorRequest {
104
+ string model = 1;
105
+ string prompt = 2;
106
+ repeated string imageUrls = 3;
107
+ string callbackUrl = 4;
108
+ }
109
+
110
+ message ImageEditorResponse {
111
+ string jobId = 1;
112
+ optional string imageUrl = 2;
113
+ optional string error = 3;
114
+ }
107
115
  // Video Generation
108
116
  message VideoGenerationRequest {
109
117
  string model = 1;