@jaypie/llm 1.2.8 → 1.3.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.
@@ -992,6 +992,10 @@ class AnthropicAdapter extends BaseProviderAdapter {
992
992
  if (request.providerOptions) {
993
993
  Object.assign(anthropicRequest, request.providerOptions);
994
994
  }
995
+ // First-class temperature takes precedence over providerOptions
996
+ if (request.temperature !== undefined) {
997
+ anthropicRequest.temperature = request.temperature;
998
+ }
995
999
  return anthropicRequest;
996
1000
  }
997
1001
  formatTools(toolkit, outputSchema) {
@@ -1417,6 +1421,13 @@ class GeminiAdapter extends BaseProviderAdapter {
1417
1421
  ...request.providerOptions,
1418
1422
  };
1419
1423
  }
1424
+ // First-class temperature takes precedence over providerOptions
1425
+ if (request.temperature !== undefined) {
1426
+ geminiRequest.config = {
1427
+ ...geminiRequest.config,
1428
+ temperature: request.temperature,
1429
+ };
1430
+ }
1420
1431
  return geminiRequest;
1421
1432
  }
1422
1433
  formatTools(toolkit, outputSchema) {
@@ -2068,6 +2079,10 @@ class OpenAiAdapter extends BaseProviderAdapter {
2068
2079
  if (request.providerOptions) {
2069
2080
  Object.assign(openaiRequest, request.providerOptions);
2070
2081
  }
2082
+ // First-class temperature takes precedence over providerOptions
2083
+ if (request.temperature !== undefined) {
2084
+ openaiRequest.temperature = request.temperature;
2085
+ }
2071
2086
  return openaiRequest;
2072
2087
  }
2073
2088
  formatTools(toolkit, _outputSchema) {
@@ -2498,6 +2513,11 @@ class OpenRouterAdapter extends BaseProviderAdapter {
2498
2513
  if (request.providerOptions) {
2499
2514
  Object.assign(openRouterRequest, request.providerOptions);
2500
2515
  }
2516
+ // First-class temperature takes precedence over providerOptions
2517
+ if (request.temperature !== undefined) {
2518
+ openRouterRequest.temperature =
2519
+ request.temperature;
2520
+ }
2501
2521
  return openRouterRequest;
2502
2522
  }
2503
2523
  formatTools(toolkit, outputSchema) {
@@ -3907,6 +3927,7 @@ class OperateLoop {
3907
3927
  model: options.model ?? this.adapter.defaultModel,
3908
3928
  providerOptions: options.providerOptions,
3909
3929
  system: options.system,
3930
+ temperature: options.temperature,
3910
3931
  tools: state.formattedTools,
3911
3932
  user: options.user,
3912
3933
  };
@@ -3986,6 +4007,7 @@ class OperateLoop {
3986
4007
  model: options.model ?? this.adapter.defaultModel,
3987
4008
  providerOptions: options.providerOptions,
3988
4009
  system: options.system,
4010
+ temperature: options.temperature,
3989
4011
  tools: state.formattedTools,
3990
4012
  user: options.user,
3991
4013
  };
@@ -4316,6 +4338,7 @@ class StreamLoop {
4316
4338
  model: options.model ?? this.adapter.defaultModel,
4317
4339
  providerOptions: options.providerOptions,
4318
4340
  system: options.system,
4341
+ temperature: options.temperature,
4319
4342
  tools: state.formattedTools,
4320
4343
  user: options.user,
4321
4344
  };
@@ -4382,6 +4405,7 @@ class StreamLoop {
4382
4405
  model: options.model ?? this.adapter.defaultModel,
4383
4406
  providerOptions: options.providerOptions,
4384
4407
  system: options.system,
4408
+ temperature: options.temperature,
4385
4409
  tools: state.formattedTools,
4386
4410
  user: options.user,
4387
4411
  };