mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:00:54 +00:00
test(agents): share google extra params setup
This commit is contained in:
@@ -21,6 +21,22 @@ afterEach(() => {
|
||||
extraParamsTesting.resetProviderRuntimeDepsForTest();
|
||||
});
|
||||
|
||||
function runGoogleExtraParamsCase(params?: { cfg?: unknown }) {
|
||||
return runExtraParamsCase({
|
||||
...(params?.cfg ? { cfg: params.cfg as never } : {}),
|
||||
applyProvider: "google",
|
||||
applyModelId: "gemini-2.5-pro",
|
||||
model: {
|
||||
api: "google-generative-ai",
|
||||
provider: "google",
|
||||
id: "gemini-2.5-pro",
|
||||
} as unknown as Model<"openai-completions">,
|
||||
payload: {
|
||||
contents: [],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
describe("extra-params: Google thinking payload compatibility", () => {
|
||||
it("strips negative thinking budgets and fills Gemini 3.1 thinkingLevel", () => {
|
||||
const payload = runExtraParamsCase({
|
||||
@@ -51,7 +67,7 @@ describe("extra-params: Google thinking payload compatibility", () => {
|
||||
});
|
||||
|
||||
it("passes cachedContent through Google extra params", () => {
|
||||
const { options } = runExtraParamsCase({
|
||||
const { options } = runGoogleExtraParamsCase({
|
||||
cfg: {
|
||||
agents: {
|
||||
defaults: {
|
||||
@@ -64,16 +80,6 @@ describe("extra-params: Google thinking payload compatibility", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
applyProvider: "google",
|
||||
applyModelId: "gemini-2.5-pro",
|
||||
model: {
|
||||
api: "google-generative-ai",
|
||||
provider: "google",
|
||||
id: "gemini-2.5-pro",
|
||||
} as unknown as Model<"openai-completions">,
|
||||
payload: {
|
||||
contents: [],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -83,7 +89,7 @@ describe("extra-params: Google thinking payload compatibility", () => {
|
||||
});
|
||||
|
||||
it("lets higher-precedence cachedContent override lower-precedence cached_content", () => {
|
||||
const { options } = runExtraParamsCase({
|
||||
const { options } = runGoogleExtraParamsCase({
|
||||
cfg: {
|
||||
agents: {
|
||||
defaults: {
|
||||
@@ -99,16 +105,6 @@ describe("extra-params: Google thinking payload compatibility", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
applyProvider: "google",
|
||||
applyModelId: "gemini-2.5-pro",
|
||||
model: {
|
||||
api: "google-generative-ai",
|
||||
provider: "google",
|
||||
id: "gemini-2.5-pro",
|
||||
} as unknown as Model<"openai-completions">,
|
||||
payload: {
|
||||
contents: [],
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user