@hiper2d/ai-agents 0.19.1 → 0.19.2
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.
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1486,6 +1486,13 @@ declare class Gpt5Agent extends AbstractAgent {
|
|
|
1486
1486
|
|
|
1487
1487
|
declare class GoogleAgent extends AbstractAgent {
|
|
1488
1488
|
private readonly client;
|
|
1489
|
+
/**
|
|
1490
|
+
* Sampling temperature to send, or undefined to send none. Google deprecated custom sampling
|
|
1491
|
+
* (notice of 2026-10): since Gemini 3.6 Flash temperature/top_p/top_k are ignored, and its
|
|
1492
|
+
* upcoming models reject them with a 400. So it is sent only for a catalog entry that sets
|
|
1493
|
+
* `temperature` (the pre-3.6 models, to keep their behaviour) — never by default.
|
|
1494
|
+
*/
|
|
1495
|
+
private readonly samplingTemperature;
|
|
1489
1496
|
private readonly defaultConfig;
|
|
1490
1497
|
private readonly logTemplates;
|
|
1491
1498
|
private readonly errorMessages;
|
package/dist/index.d.ts
CHANGED
|
@@ -1486,6 +1486,13 @@ declare class Gpt5Agent extends AbstractAgent {
|
|
|
1486
1486
|
|
|
1487
1487
|
declare class GoogleAgent extends AbstractAgent {
|
|
1488
1488
|
private readonly client;
|
|
1489
|
+
/**
|
|
1490
|
+
* Sampling temperature to send, or undefined to send none. Google deprecated custom sampling
|
|
1491
|
+
* (notice of 2026-10): since Gemini 3.6 Flash temperature/top_p/top_k are ignored, and its
|
|
1492
|
+
* upcoming models reject them with a 400. So it is sent only for a catalog entry that sets
|
|
1493
|
+
* `temperature` (the pre-3.6 models, to keep their behaviour) — never by default.
|
|
1494
|
+
*/
|
|
1495
|
+
private readonly samplingTemperature;
|
|
1489
1496
|
private readonly defaultConfig;
|
|
1490
1497
|
private readonly logTemplates;
|
|
1491
1498
|
private readonly errorMessages;
|
package/dist/index.js
CHANGED
|
@@ -1139,6 +1139,10 @@ var SupportedAiModels = {
|
|
|
1139
1139
|
apiKeyName: API_KEY_CONSTANTS.GOOGLE,
|
|
1140
1140
|
hasThinking: true,
|
|
1141
1141
|
reasoningEffort: "high",
|
|
1142
|
+
// Pre-3.6: still honours sampling params, so it keeps the 0.2 GoogleAgent always sent
|
|
1143
|
+
// before 2026-10-07. 3.6+ ignore them and future Gemini models reject them — leave
|
|
1144
|
+
// `temperature` unset on every newer Gemini entry (GoogleAgent then sends none).
|
|
1145
|
+
temperature: 0.2,
|
|
1142
1146
|
tags: ["expensive"]
|
|
1143
1147
|
},
|
|
1144
1148
|
[LLM_CONSTANTS.GEMINI_FLASH]: {
|
|
@@ -1158,6 +1162,8 @@ var SupportedAiModels = {
|
|
|
1158
1162
|
apiKeyName: API_KEY_CONSTANTS.GOOGLE,
|
|
1159
1163
|
hasThinking: true,
|
|
1160
1164
|
reasoningEffort: "minimal",
|
|
1165
|
+
// Pre-3.6, same as Pro: keeps the 0.2 it always had.
|
|
1166
|
+
temperature: 0.2,
|
|
1161
1167
|
tags: ["fast", "cheap"]
|
|
1162
1168
|
},
|
|
1163
1169
|
// Always-on reasoning — no non-thinking sibling. Bumped 4.6 → 4.7 on 2026-09-22 (id verified
|
|
@@ -3235,6 +3241,13 @@ function throwForEmptyGeminiResponse(model, response, fallback) {
|
|
|
3235
3241
|
}
|
|
3236
3242
|
var GoogleAgent = class extends AbstractAgent {
|
|
3237
3243
|
client;
|
|
3244
|
+
/**
|
|
3245
|
+
* Sampling temperature to send, or undefined to send none. Google deprecated custom sampling
|
|
3246
|
+
* (notice of 2026-10): since Gemini 3.6 Flash temperature/top_p/top_k are ignored, and its
|
|
3247
|
+
* upcoming models reject them with a 400. So it is sent only for a catalog entry that sets
|
|
3248
|
+
* `temperature` (the pre-3.6 models, to keep their behaviour) — never by default.
|
|
3249
|
+
*/
|
|
3250
|
+
samplingTemperature;
|
|
3238
3251
|
defaultConfig = {
|
|
3239
3252
|
responseMimeType: "application/json"
|
|
3240
3253
|
};
|
|
@@ -3250,7 +3263,9 @@ var GoogleAgent = class extends AbstractAgent {
|
|
|
3250
3263
|
unsupportedRole: (role) => `Unsupported role type: ${role}`
|
|
3251
3264
|
};
|
|
3252
3265
|
constructor(name, instruction, model, apiKey, enableThinking = false, agentLoggingConfig = DEFAULT_LOGGING_CONFIG.agents) {
|
|
3253
|
-
|
|
3266
|
+
const samplingTemperature = getModelConfigByApiName(model)?.temperature;
|
|
3267
|
+
super(name, instruction, model, samplingTemperature ?? 0, enableThinking, agentLoggingConfig);
|
|
3268
|
+
this.samplingTemperature = samplingTemperature;
|
|
3254
3269
|
this.client = new import_genai3.GoogleGenAI({
|
|
3255
3270
|
apiKey
|
|
3256
3271
|
});
|
|
@@ -3349,7 +3364,7 @@ var GoogleAgent = class extends AbstractAgent {
|
|
|
3349
3364
|
try {
|
|
3350
3365
|
const googleSchema = ZodSchemaConverter.toGoogleSchema(zodSchema);
|
|
3351
3366
|
const config = {
|
|
3352
|
-
temperature: this.
|
|
3367
|
+
...this.samplingTemperature !== void 0 ? { temperature: this.samplingTemperature } : {},
|
|
3353
3368
|
responseMimeType: "application/json",
|
|
3354
3369
|
responseSchema: googleSchema,
|
|
3355
3370
|
maxOutputTokens: this.maxOutputTokens,
|
|
@@ -3439,7 +3454,7 @@ var GoogleAgent = class extends AbstractAgent {
|
|
|
3439
3454
|
const contents = this.convertToContents(messages);
|
|
3440
3455
|
try {
|
|
3441
3456
|
const config = {
|
|
3442
|
-
temperature: this.
|
|
3457
|
+
...this.samplingTemperature !== void 0 ? { temperature: this.samplingTemperature } : {},
|
|
3443
3458
|
maxOutputTokens: this.maxOutputTokens,
|
|
3444
3459
|
systemInstruction: this.instruction
|
|
3445
3460
|
};
|