@theokit/sdk 2.11.1 → 2.11.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/CHANGELOG.md +6 -0
- package/dist/a2a/index.cjs +13 -6
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +13 -6
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-CZlMLA1K.d.ts → cron-BRfFPEKY.d.ts} +1 -1
- package/dist/{cron-BNI8pyn_.d.cts → cron-DOw-Hqol.d.cts} +1 -1
- package/dist/cron.cjs +13 -6
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +13 -6
- package/dist/cron.js.map +1 -1
- package/dist/{errors-FKoM44Mj.d.cts → errors-9yw4UQwX.d.cts} +1 -1
- package/dist/{errors-C8EVGqje.d.ts → errors-DFiY-NHK.d.ts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +13 -6
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +13 -6
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/llm/types.d.ts +8 -0
- package/dist/{run-D22b53SU.d.cts → run-TMdc7gmo.d.cts} +7 -0
- package/dist/{run-D22b53SU.d.ts → run-TMdc7gmo.d.ts} +7 -0
- package/dist/types/run.d.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8b411c5: Add `SendOptions.toolChoice` (`"auto" | "none" | "required"`), forwarded to the OpenAI/OpenRouter `tool_choice` request field. `"none"` forces a text answer even when the agent has tools registered — this lets an agent loop force a closing summary at its step ceiling (a cached agent's tools cannot be un-registered, so the gate must be applied per-send, not at agent creation). `tool_choice` is emitted only alongside a non-empty `tools` array. Additive and backward-compatible (absent ⇒ provider default).
|
|
8
|
+
|
|
3
9
|
## 2.11.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/a2a/index.cjs
CHANGED
|
@@ -7108,6 +7108,9 @@ async function streamLlmTurn(inputs, ctx) {
|
|
|
7108
7108
|
const effort = reasoningEffortFromParams(inputs.model.params);
|
|
7109
7109
|
return effort !== void 0 ? { reasoning: { effort } } : {};
|
|
7110
7110
|
})(),
|
|
7111
|
+
// Step-cap force-close: forward the per-run tool gate (`"none"` on a ceiling round forces a
|
|
7112
|
+
// text close even though tools are advertised). Absent ⇒ provider default (auto).
|
|
7113
|
+
...inputs.toolChoice !== void 0 ? { toolChoice: inputs.toolChoice } : {},
|
|
7111
7114
|
messages: ctx.messages,
|
|
7112
7115
|
tools: ctx.tools.map(toLlmTool)
|
|
7113
7116
|
},
|
|
@@ -10114,6 +10117,14 @@ function applyReasoningRequest(body, effort, providerName) {
|
|
|
10114
10117
|
}
|
|
10115
10118
|
body.reasoning = { effort };
|
|
10116
10119
|
}
|
|
10120
|
+
function applyToolsRequest(body, request) {
|
|
10121
|
+
if (request.tools === void 0 || request.tools.length === 0) return;
|
|
10122
|
+
body.tools = request.tools.map((tool) => ({
|
|
10123
|
+
type: "function",
|
|
10124
|
+
function: { name: tool.name, description: tool.description, parameters: tool.inputSchema }
|
|
10125
|
+
}));
|
|
10126
|
+
if (request.toolChoice !== void 0) body.tool_choice = request.toolChoice;
|
|
10127
|
+
}
|
|
10117
10128
|
function buildOpenAIBody(request, providerName) {
|
|
10118
10129
|
const messages = [];
|
|
10119
10130
|
const systemText = openAISystemText(request.system);
|
|
@@ -10135,12 +10146,7 @@ function buildOpenAIBody(request, providerName) {
|
|
|
10135
10146
|
if (request.temperature !== void 0) body.temperature = request.temperature;
|
|
10136
10147
|
if (request.reasoning?.effort !== void 0)
|
|
10137
10148
|
applyReasoningRequest(body, request.reasoning.effort, providerName);
|
|
10138
|
-
|
|
10139
|
-
body.tools = request.tools.map((tool) => ({
|
|
10140
|
-
type: "function",
|
|
10141
|
-
function: { name: tool.name, description: tool.description, parameters: tool.inputSchema }
|
|
10142
|
-
}));
|
|
10143
|
-
}
|
|
10149
|
+
applyToolsRequest(body, request);
|
|
10144
10150
|
const responseFormat = encodeOpenAIResponseFormat(request.responseFormat);
|
|
10145
10151
|
if (responseFormat !== void 0) body.response_format = responseFormat;
|
|
10146
10152
|
return body;
|
|
@@ -11211,6 +11217,7 @@ function buildLoopInputs(options, runId, userText) {
|
|
|
11211
11217
|
...options.systemPrompt !== void 0 ? { systemPrompt: options.systemPrompt } : {},
|
|
11212
11218
|
...options.onStep !== void 0 ? { onStep: options.onStep } : {},
|
|
11213
11219
|
...options.onDelta !== void 0 ? { onDelta: options.onDelta } : {},
|
|
11220
|
+
...options.sendOptions.toolChoice !== void 0 ? { toolChoice: options.sendOptions.toolChoice } : {},
|
|
11214
11221
|
...options.priorMessages !== void 0 ? { priorMessages: options.priorMessages } : {},
|
|
11215
11222
|
...options.memoryTools !== void 0 && options.memoryTools.length > 0 ? { memoryTools: options.memoryTools } : {},
|
|
11216
11223
|
...buildCustomToolsInput(
|