@oh-my-pi/pi-agent-core 11.9.0 → 11.10.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.
- package/package.json +4 -4
- package/src/agent.ts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-agent-core",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.10.0",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"test": "bun test"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@oh-my-pi/pi-ai": "11.
|
|
28
|
-
"@oh-my-pi/pi-tui": "11.
|
|
29
|
-
"@oh-my-pi/pi-utils": "11.
|
|
27
|
+
"@oh-my-pi/pi-ai": "11.10.0",
|
|
28
|
+
"@oh-my-pi/pi-tui": "11.10.0",
|
|
29
|
+
"@oh-my-pi/pi-utils": "11.10.0"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"ai",
|
package/src/agent.ts
CHANGED
|
@@ -96,6 +96,11 @@ export interface AgentOptions {
|
|
|
96
96
|
*/
|
|
97
97
|
thinkingBudgets?: ThinkingBudgets;
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Sampling temperature for LLM calls. `undefined` uses provider default.
|
|
101
|
+
*/
|
|
102
|
+
temperature?: number;
|
|
103
|
+
|
|
99
104
|
/**
|
|
100
105
|
* Maximum delay in milliseconds to wait for a retry when the server requests a long wait.
|
|
101
106
|
* If the server's requested delay exceeds this value, the request fails immediately,
|
|
@@ -155,6 +160,7 @@ export class Agent {
|
|
|
155
160
|
#interruptMode: "immediate" | "wait";
|
|
156
161
|
#sessionId?: string;
|
|
157
162
|
#thinkingBudgets?: ThinkingBudgets;
|
|
163
|
+
#temperature?: number;
|
|
158
164
|
#maxRetryDelayMs?: number;
|
|
159
165
|
#getToolContext?: (toolCall?: ToolCallContext) => AgentToolContext | undefined;
|
|
160
166
|
#cursorExecHandlers?: CursorExecHandlers;
|
|
@@ -179,6 +185,7 @@ export class Agent {
|
|
|
179
185
|
this.streamFn = opts.streamFn || streamSimple;
|
|
180
186
|
this.#sessionId = opts.sessionId;
|
|
181
187
|
this.#thinkingBudgets = opts.thinkingBudgets;
|
|
188
|
+
this.#temperature = opts.temperature;
|
|
182
189
|
this.#maxRetryDelayMs = opts.maxRetryDelayMs;
|
|
183
190
|
this.getApiKey = opts.getApiKey;
|
|
184
191
|
this.#getToolContext = opts.getToolContext;
|
|
@@ -216,6 +223,20 @@ export class Agent {
|
|
|
216
223
|
this.#thinkingBudgets = value;
|
|
217
224
|
}
|
|
218
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Get the current sampling temperature.
|
|
228
|
+
*/
|
|
229
|
+
get temperature(): number | undefined {
|
|
230
|
+
return this.#temperature;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Set sampling temperature for LLM calls. `undefined` uses provider default.
|
|
235
|
+
*/
|
|
236
|
+
set temperature(value: number | undefined) {
|
|
237
|
+
this.#temperature = value;
|
|
238
|
+
}
|
|
239
|
+
|
|
219
240
|
/**
|
|
220
241
|
* Get the current max retry delay in milliseconds.
|
|
221
242
|
*/
|
|
@@ -564,6 +585,7 @@ export class Agent {
|
|
|
564
585
|
const config: AgentLoopConfig = {
|
|
565
586
|
model,
|
|
566
587
|
reasoning,
|
|
588
|
+
temperature: this.#temperature,
|
|
567
589
|
interruptMode: this.#interruptMode,
|
|
568
590
|
sessionId: this.#sessionId,
|
|
569
591
|
thinkingBudgets: this.#thinkingBudgets,
|