@t2000/engine 0.5.1 → 0.5.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.ts CHANGED
@@ -143,6 +143,7 @@ interface EngineConfig {
143
143
  model?: string;
144
144
  maxTurns?: number;
145
145
  maxTokens?: number;
146
+ temperature?: number;
146
147
  costTracker?: {
147
148
  budgetLimitUsd?: number;
148
149
  inputCostPerToken?: number;
@@ -158,6 +159,7 @@ interface ChatParams {
158
159
  tools: ToolDefinition[];
159
160
  model?: string;
160
161
  maxTokens?: number;
162
+ temperature?: number;
161
163
  signal?: AbortSignal;
162
164
  }
163
165
  interface ToolDefinition {
@@ -232,6 +234,7 @@ declare class QueryEngine {
232
234
  private readonly model;
233
235
  private readonly maxTurns;
234
236
  private readonly maxTokens;
237
+ private readonly temperature;
235
238
  private readonly agent;
236
239
  private readonly mcpManager;
237
240
  private readonly walletAddress;
package/dist/index.js CHANGED
@@ -1759,6 +1759,7 @@ var QueryEngine = class {
1759
1759
  model;
1760
1760
  maxTurns;
1761
1761
  maxTokens;
1762
+ temperature;
1762
1763
  agent;
1763
1764
  mcpManager;
1764
1765
  walletAddress;
@@ -1778,6 +1779,7 @@ var QueryEngine = class {
1778
1779
  this.model = config.model;
1779
1780
  this.maxTurns = config.maxTurns ?? DEFAULT_MAX_TURNS;
1780
1781
  this.maxTokens = config.maxTokens ?? DEFAULT_MAX_TOKENS;
1782
+ this.temperature = config.temperature;
1781
1783
  this.systemPrompt = config.systemPrompt ?? DEFAULT_SYSTEM_PROMPT;
1782
1784
  this.costTracker = new CostTracker(config.costTracker);
1783
1785
  this.tools = config.tools ?? (config.agent ? getDefaultTools() : []);
@@ -1921,6 +1923,7 @@ ${summary.join("\n")}`);
1921
1923
  tools: toolDefs,
1922
1924
  model: this.model,
1923
1925
  maxTokens: this.maxTokens,
1926
+ temperature: this.temperature,
1924
1927
  signal
1925
1928
  });
1926
1929
  for await (const event of stream) {
@@ -2683,7 +2686,8 @@ var AnthropicProvider = class {
2683
2686
  max_tokens: params.maxTokens ?? this.defaultMaxTokens,
2684
2687
  system: params.systemPrompt,
2685
2688
  messages,
2686
- tools: tools.length > 0 ? tools : void 0
2689
+ tools: tools.length > 0 ? tools : void 0,
2690
+ ...params.temperature !== void 0 && { temperature: params.temperature }
2687
2691
  };
2688
2692
  const stream = params.signal ? this.client.messages.stream(streamParams, { signal: params.signal }) : this.client.messages.stream(streamParams);
2689
2693
  const toolInputBuffers = /* @__PURE__ */ new Map();