Skip to content

Commit 63e8d61

Browse files
committed
fix: remove unrelated toGoogle changes from this PR
1 parent 4fc5216 commit 63e8d61

File tree

3 files changed

+163
-43
lines changed

3 files changed

+163
-43
lines changed

packages/__tests__/cost/__snapshots__/registrySnapshots.test.ts.snap

Lines changed: 163 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,6 +2752,101 @@ exports[`Registry Snapshots endpoint configurations snapshot 1`] = `
27522752
],
27532753
},
27542754
},
2755+
"google/gemini-3.1-pro": {
2756+
"gemini-3.1-pro-preview:google-ai-studio": {
2757+
"context": 1048576,
2758+
"crossRegion": false,
2759+
"maxTokens": 65536,
2760+
"modelId": "gemini-3.1-pro-preview",
2761+
"parameters": [
2762+
"include_reasoning",
2763+
"max_tokens",
2764+
"reasoning",
2765+
"response_format",
2766+
"seed",
2767+
"stop",
2768+
"structured_outputs",
2769+
"temperature",
2770+
"tool_choice",
2771+
"tools",
2772+
"top_p",
2773+
],
2774+
"provider": "google-ai-studio",
2775+
"ptbEnabled": true,
2776+
"regions": [
2777+
"*",
2778+
],
2779+
},
2780+
"gemini-3.1-pro-preview:helicone": {
2781+
"context": 1048576,
2782+
"crossRegion": false,
2783+
"maxTokens": 65536,
2784+
"modelId": "pa/gemini-3.1-pro-preview",
2785+
"parameters": [
2786+
"include_reasoning",
2787+
"max_tokens",
2788+
"reasoning",
2789+
"response_format",
2790+
"seed",
2791+
"stop",
2792+
"structured_outputs",
2793+
"temperature",
2794+
"tool_choice",
2795+
"tools",
2796+
"top_p",
2797+
],
2798+
"provider": "helicone",
2799+
"ptbEnabled": true,
2800+
"regions": [
2801+
"*",
2802+
],
2803+
},
2804+
"gemini-3.1-pro-preview:openrouter": {
2805+
"context": 1048576,
2806+
"crossRegion": false,
2807+
"maxTokens": 65536,
2808+
"modelId": "google/gemini-3.1-pro-preview",
2809+
"parameters": [
2810+
"max_tokens",
2811+
"response_format",
2812+
"seed",
2813+
"stop",
2814+
"temperature",
2815+
"tool_choice",
2816+
"tools",
2817+
"top_p",
2818+
],
2819+
"provider": "openrouter",
2820+
"ptbEnabled": true,
2821+
"regions": [
2822+
"*",
2823+
],
2824+
},
2825+
"gemini-3.1-pro-preview:vertex": {
2826+
"context": 1048576,
2827+
"crossRegion": true,
2828+
"maxTokens": 65536,
2829+
"modelId": "gemini-3.1-pro-preview",
2830+
"parameters": [
2831+
"include_reasoning",
2832+
"max_tokens",
2833+
"reasoning",
2834+
"response_format",
2835+
"seed",
2836+
"stop",
2837+
"structured_outputs",
2838+
"temperature",
2839+
"tool_choice",
2840+
"tools",
2841+
"top_p",
2842+
],
2843+
"provider": "vertex",
2844+
"ptbEnabled": true,
2845+
"regions": [
2846+
"global",
2847+
],
2848+
},
2849+
},
27552850
"google/gemini-3.1-pro-preview": {
27562851
"gemini-3.1-pro-preview:helicone": {
27572852
"context": 1048576,
@@ -7200,6 +7295,12 @@ exports[`Registry Snapshots model coverage snapshot 1`] = `
72007295
"openrouter",
72017296
"vertex",
72027297
],
7298+
"google/gemini-3.1-pro": [
7299+
"google-ai-studio",
7300+
"helicone",
7301+
"openrouter",
7302+
"vertex",
7303+
],
72037304
"google/gemini-3.1-pro-preview": [
72047305
"helicone",
72057306
"openrouter",
@@ -8874,6 +8975,64 @@ exports[`Registry Snapshots pricing snapshot 1`] = `
88748975
},
88758976
],
88768977
},
8978+
"google/gemini-3.1-pro": {
8979+
"google-ai-studio": [
8980+
{
8981+
"cacheMultipliers": {
8982+
"cachedInput": 0.1,
8983+
},
8984+
"cacheStoragePerHour": 0.0000045,
8985+
"input": 0.000002,
8986+
"output": 0.000012,
8987+
"threshold": 0,
8988+
},
8989+
{
8990+
"input": 0.000004,
8991+
"output": 0.000018,
8992+
"threshold": 200000,
8993+
},
8994+
],
8995+
"helicone": [
8996+
{
8997+
"input": 0.000002,
8998+
"output": 0.000012,
8999+
"threshold": 0,
9000+
},
9001+
{
9002+
"input": 0.000004,
9003+
"output": 0.000018,
9004+
"threshold": 200000,
9005+
},
9006+
],
9007+
"openrouter": [
9008+
{
9009+
"input": 0.00000211,
9010+
"output": 0.00001266,
9011+
"threshold": 0,
9012+
},
9013+
{
9014+
"input": 0.00000422,
9015+
"output": 0.00001899,
9016+
"threshold": 200000,
9017+
},
9018+
],
9019+
"vertex": [
9020+
{
9021+
"cacheMultipliers": {
9022+
"cachedInput": 0.1,
9023+
},
9024+
"cacheStoragePerHour": 0.0000045,
9025+
"input": 0.000002,
9026+
"output": 0.000012,
9027+
"threshold": 0,
9028+
},
9029+
{
9030+
"input": 0.000004,
9031+
"output": 0.000018,
9032+
"threshold": 200000,
9033+
},
9034+
],
9035+
},
88779036
"google/gemini-3.1-pro-preview": {
88789037
"helicone": [
88799038
{
@@ -9839,6 +9998,7 @@ exports[`Registry Snapshots verify registry state 1`] = `
98399998
{
98409999
"model": "gemini-3.1-pro-preview",
984110000
"providers": [
10001+
"google-ai-studio",
984210002
"helicone",
984310003
"openrouter",
984410004
"vertex",
@@ -10465,7 +10625,7 @@ exports[`Registry Snapshots verify registry state 1`] = `
1046510625
"provider": "fireworks",
1046610626
},
1046710627
{
10468-
"modelCount": 7,
10628+
"modelCount": 8,
1046910629
"provider": "google-ai-studio",
1047010630
},
1047110631
{
@@ -10625,8 +10785,8 @@ exports[`Registry Snapshots verify registry state 1`] = `
1062510785
"claude-3.5-haiku:anthropic:*",
1062610786
],
1062710787
"totalArchivedConfigs": 0,
10628-
"totalEndpoints": 317,
10629-
"totalModelProviderConfigs": 317,
10788+
"totalEndpoints": 318,
10789+
"totalModelProviderConfigs": 318,
1063010790
"totalModelsWithPtb": 105,
1063110791
"totalProviders": 21,
1063210792
}

packages/__tests__/llm-mapper/openai-to-google-response-format.test.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -260,36 +260,4 @@ describe("toGoogle response_format transformation", () => {
260260
type: "string",
261261
});
262262
});
263-
264-
it("should throw error when request only has system messages", () => {
265-
const openAIRequest = {
266-
model: "gemini-2.5-flash",
267-
messages: [
268-
{
269-
role: "system" as const,
270-
content: "You are a helpful assistant.",
271-
},
272-
{
273-
role: "system" as const,
274-
content: "Additional context here.",
275-
},
276-
],
277-
response_format: {
278-
type: "json_schema" as const,
279-
json_schema: {
280-
name: "result",
281-
schema: {
282-
type: "object",
283-
properties: {
284-
feedback: { type: "string" },
285-
},
286-
},
287-
},
288-
},
289-
};
290-
291-
expect(() => toGoogle(openAIRequest)).toThrow(
292-
"Gemini requires at least one non-system message"
293-
);
294-
});
295263
});

packages/llm-mapper/transform/providers/openai/request/toGoogle.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ export function toGoogle(
8282
});
8383
}
8484

85-
// Google Gemini requires at least one item in contents (system messages go to system_instruction)
86-
if (contents.length === 0) {
87-
throw new Error(
88-
"Gemini requires at least one non-system message. The request only contains system/developer messages, " +
89-
"which are converted to system_instruction. Add a user message to the request."
90-
);
91-
}
92-
9385
const geminiBody: GeminiGenerateContentRequest = {
9486
contents,
9587
};

0 commit comments

Comments
 (0)