@zenmux/rosetta-ai 1.0.28 → 1.0.30

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,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChatCompletionToMessagesConverter = void 0;
4
+ const sanitize_anthropic_schema_1 = require("../sanitize-anthropic-schema");
4
5
  const DEFAULT_MAX_TOKENS = 4096;
5
6
  class ChatCompletionToMessagesConverter {
6
7
  streamState;
@@ -524,9 +525,9 @@ class ChatCompletionToMessagesConverter {
524
525
  type: "custom",
525
526
  name: tool.function.name,
526
527
  description: tool.function.description,
527
- input_schema: (tool.function.parameters ?? {
528
+ input_schema: (0, sanitize_anthropic_schema_1.sanitizeAnthropicInputSchema)((tool.function.parameters ?? {
528
529
  type: "object",
529
- }),
530
+ })),
530
531
  };
531
532
  }
532
533
  this.customToolNames.add(tool.custom.name);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GeminiToMessagesConverter = void 0;
4
+ const sanitize_anthropic_schema_1 = require("../sanitize-anthropic-schema");
4
5
  class GeminiToMessagesConverter {
5
6
  streamState;
6
7
  constructor() {
@@ -277,8 +278,8 @@ class GeminiToMessagesConverter {
277
278
  result.push({
278
279
  name: fd.name ?? "",
279
280
  description: fd.description,
280
- input_schema: (fd.parametersJsonSchema ??
281
- fd.parameters ?? { type: "object" }),
281
+ input_schema: (0, sanitize_anthropic_schema_1.sanitizeAnthropicInputSchema)((fd.parametersJsonSchema ??
282
+ fd.parameters ?? { type: "object" })),
282
283
  });
283
284
  }
284
285
  }
@@ -9,9 +9,10 @@ export declare class ResponsesToGeminiConverter {
9
9
  convertResponse(response: GenerateContentResponse): RespResponse;
10
10
  convertStream(stream: AsyncIterable<GenerateContentResponse>): AsyncIterable<RespStreamEvent>;
11
11
  convertStreamChunk(chunk: GenerateContentResponse): RespStreamEvent[];
12
+ private convertFunctionPart;
12
13
  private convertInput;
13
14
  private extractText;
14
- private convertInputContent;
15
+ private convertMessageContent;
15
16
  private convertTools;
16
17
  private isWebSearch;
17
18
  private convertToolChoice;
@@ -20,6 +21,11 @@ export declare class ResponsesToGeminiConverter {
20
21
  private finishReasonToStatus;
21
22
  private extractGroundingAnnotations;
22
23
  private generateId;
24
+ private convertUsage;
25
+ private applyGrounding;
26
+ private finishFunction;
27
+ private finishReasoning;
28
+ private finishResponse;
23
29
  private createStreamState;
24
30
  private makeSkeletonResponse;
25
31
  }