@tinyweb_dev/agent-framework-llm 0.3.0 → 0.4.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/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/protocols/openai-chat.cjs +12 -0
- package/dist/protocols/openai-chat.cjs.map +1 -1
- package/dist/protocols/openai-chat.d.ts +2 -0
- package/dist/protocols/openai-chat.d.ts.map +1 -1
- package/dist/protocols/openai-chat.js +12 -0
- package/dist/protocols/openai-chat.js.map +1 -1
- package/dist/protocols/openai-compatible-chat.cjs +12 -0
- package/dist/protocols/openai-compatible-chat.cjs.map +1 -1
- package/dist/protocols/openai-compatible-chat.js +12 -0
- package/dist/protocols/openai-compatible-chat.js.map +1 -1
- package/dist/providers/openai-compatible.cjs +12 -0
- package/dist/providers/openai-compatible.cjs.map +1 -1
- package/dist/providers/openai-compatible.js +12 -0
- package/dist/providers/openai-compatible.js.map +1 -1
- package/dist/providers/openai.cjs +12 -0
- package/dist/providers/openai.cjs.map +1 -1
- package/dist/providers/openai.js +12 -0
- package/dist/providers/openai.js.map +1 -1
- package/package.json +2 -2
|
@@ -202,6 +202,7 @@ export declare const protocol: Protocol<{
|
|
|
202
202
|
}, string, {
|
|
203
203
|
readonly choices: readonly {
|
|
204
204
|
readonly delta?: {
|
|
205
|
+
readonly reasoning?: string | null | undefined;
|
|
205
206
|
readonly content?: string | null | undefined;
|
|
206
207
|
readonly tool_calls?: readonly {
|
|
207
208
|
readonly index: number;
|
|
@@ -211,6 +212,7 @@ export declare const protocol: Protocol<{
|
|
|
211
212
|
} | null | undefined;
|
|
212
213
|
readonly id?: string | null | undefined;
|
|
213
214
|
}[] | null | undefined;
|
|
215
|
+
readonly reasoning_content?: string | null | undefined;
|
|
214
216
|
} | null | undefined;
|
|
215
217
|
readonly finish_reason?: string | null | undefined;
|
|
216
218
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-chat.d.ts","sourceRoot":"","sources":["../../src/protocols/openai-chat.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,YAAY,EAMlB,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGhD,eAAO,MAAM,gBAAgB,8BAA8B,CAAA;AAC3D,eAAO,MAAM,IAAI,sBAAsB,CAAA;AA8DvC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBtB,CAAA;AACD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAA;AAChD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"openai-chat.d.ts","sourceRoot":"","sources":["../../src/protocols/openai-chat.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAIvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,YAAY,EAMlB,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,UAAU,EAAE,MAAM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ct({
|
|
|
2162
2162
|
});
|
|
2163
2163
|
var OpenAIChatDelta = Schema.Struct({
|
|
2164
2164
|
content: optionalNull(Schema.String),
|
|
2165
|
+
/**
|
|
2166
|
+
* Thinking / chain-of-thought stream. DeepSeek + MiniMax native and
|
|
2167
|
+
* LiteLLM-normalized gateways use `reasoning_content`; OpenRouter (and some
|
|
2168
|
+
* Grok mirrors) use `reasoning`. Either must become `reasoning-delta` so
|
|
2169
|
+
* UIs are not stuck on a pre-text thinking spinner while the wire is live.
|
|
2170
|
+
*/
|
|
2171
|
+
reasoning_content: optionalNull(Schema.String),
|
|
2172
|
+
reasoning: optionalNull(Schema.String),
|
|
2165
2173
|
tool_calls: optionalNull(Schema.Array(OpenAIChatToolCallDelta))
|
|
2166
2174
|
});
|
|
2167
2175
|
var OpenAIChatChoice = Schema.Struct({
|
|
@@ -2338,6 +2346,10 @@ var step = (state, event) => Effect.gen(function* () {
|
|
|
2338
2346
|
const toolDeltas = delta?.tool_calls ?? [];
|
|
2339
2347
|
let tools = state.tools;
|
|
2340
2348
|
let textAcc = state.textAcc;
|
|
2349
|
+
const reasoningChunk = delta?.reasoning_content ?? delta?.reasoning;
|
|
2350
|
+
if (reasoningChunk) {
|
|
2351
|
+
events.push(LLMEvent.reasoningDelta({ id: "reasoning-0", text: reasoningChunk }));
|
|
2352
|
+
}
|
|
2341
2353
|
if (delta?.content) {
|
|
2342
2354
|
const normalised = normaliseTextDelta(textAcc, delta.content);
|
|
2343
2355
|
textAcc = normalised.textAcc;
|