@fiado/type-kit 3.308.0 → 3.309.0

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.
@@ -1,5 +1,12 @@
1
+ import { AiImageInput } from "./AiImageInput";
1
2
  export declare class AiAnalyzeRequest {
2
3
  prompt: string;
3
4
  systemPrompt?: string;
4
5
  modelId?: string;
6
+ maxTokens?: number;
7
+ /**
8
+ * Imagenes adjuntas al prompt. Se envian ANTES del texto, que es el orden en
9
+ * el que el modelo las asocia correctamente con la instruccion.
10
+ */
11
+ images?: AiImageInput[];
5
12
  }
@@ -11,6 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AiAnalyzeRequest = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const AiImageInput_1 = require("./AiImageInput");
14
16
  class AiAnalyzeRequest {
15
17
  }
16
18
  exports.AiAnalyzeRequest = AiAnalyzeRequest;
@@ -29,3 +31,16 @@ __decorate([
29
31
  (0, class_validator_1.IsOptional)(),
30
32
  __metadata("design:type", String)
31
33
  ], AiAnalyzeRequest.prototype, "modelId", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsInt)(),
36
+ (0, class_validator_1.Min)(1),
37
+ (0, class_validator_1.IsOptional)(),
38
+ __metadata("design:type", Number)
39
+ ], AiAnalyzeRequest.prototype, "maxTokens", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsArray)(),
42
+ (0, class_validator_1.ValidateNested)({ each: true }),
43
+ (0, class_transformer_1.Type)(() => AiImageInput_1.AiImageInput),
44
+ (0, class_validator_1.IsOptional)(),
45
+ __metadata("design:type", Array)
46
+ ], AiAnalyzeRequest.prototype, "images", void 0);
@@ -0,0 +1,7 @@
1
+ /** Una imagen que acompaña al prompt, para analisis multimodal. */
2
+ export declare class AiImageInput {
3
+ /** Contenido de la imagen en base64, SIN el prefijo `data:`. */
4
+ data: string;
5
+ /** MIME real de la imagen: `image/jpeg`, `image/png` o `image/webp`. */
6
+ mediaType: string;
7
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AiImageInput = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /** Una imagen que acompaña al prompt, para analisis multimodal. */
15
+ class AiImageInput {
16
+ }
17
+ exports.AiImageInput = AiImageInput;
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", String)
22
+ ], AiImageInput.prototype, "data", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsNotEmpty)(),
26
+ __metadata("design:type", String)
27
+ ], AiImageInput.prototype, "mediaType", void 0);
@@ -1,2 +1,3 @@
1
+ export * from './dtos/internal/AiImageInput';
1
2
  export * from './dtos/internal/AiAnalyzeRequest';
2
3
  export * from './dtos/internal/AiAnalyzeResponse';
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  //dtos/internal
18
+ __exportStar(require("./dtos/internal/AiImageInput"), exports);
18
19
  __exportStar(require("./dtos/internal/AiAnalyzeRequest"), exports);
19
20
  __exportStar(require("./dtos/internal/AiAnalyzeResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.308.0",
3
+ "version": "3.309.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,4 +1,6 @@
1
- import { IsNotEmpty, IsString, IsOptional } from "class-validator";
1
+ import { IsNotEmpty, IsString, IsOptional, IsArray, ValidateNested, IsInt, Min } from "class-validator";
2
+ import { Type } from "class-transformer";
3
+ import { AiImageInput } from "./AiImageInput";
2
4
 
3
5
  export class AiAnalyzeRequest {
4
6
  @IsString()
@@ -12,4 +14,19 @@ export class AiAnalyzeRequest {
12
14
  @IsString()
13
15
  @IsOptional()
14
16
  modelId?: string;
17
+
18
+ @IsInt()
19
+ @Min(1)
20
+ @IsOptional()
21
+ maxTokens?: number;
22
+
23
+ /**
24
+ * Imagenes adjuntas al prompt. Se envian ANTES del texto, que es el orden en
25
+ * el que el modelo las asocia correctamente con la instruccion.
26
+ */
27
+ @IsArray()
28
+ @ValidateNested({ each: true })
29
+ @Type(() => AiImageInput)
30
+ @IsOptional()
31
+ images?: AiImageInput[];
15
32
  }
@@ -0,0 +1,14 @@
1
+ import { IsNotEmpty, IsString } from "class-validator";
2
+
3
+ /** Una imagen que acompaña al prompt, para analisis multimodal. */
4
+ export class AiImageInput {
5
+ /** Contenido de la imagen en base64, SIN el prefijo `data:`. */
6
+ @IsString()
7
+ @IsNotEmpty()
8
+ data: string;
9
+
10
+ /** MIME real de la imagen: `image/jpeg`, `image/png` o `image/webp`. */
11
+ @IsString()
12
+ @IsNotEmpty()
13
+ mediaType: string;
14
+ }
@@ -1,3 +1,4 @@
1
1
  //dtos/internal
2
+ export * from './dtos/internal/AiImageInput';
2
3
  export * from './dtos/internal/AiAnalyzeRequest';
3
4
  export * from './dtos/internal/AiAnalyzeResponse';