veryfront 0.1.658 → 0.1.659
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/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-stream.d.ts","sourceRoot":"","sources":["../../../../src/extensions/ext-llm-anthropic/src/anthropic-stream.ts"],"names":[],"mappings":"AAOA,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic-stream.d.ts","sourceRoot":"","sources":["../../../../src/extensions/ext-llm-anthropic/src/anthropic-stream.ts"],"names":[],"mappings":"AAOA,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAsBF,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,OAAO,GACX,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgBlD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAsBhF;AAED,wBAAuB,8BAA8B,CACnD,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,aAAa,CAAC,OAAO,CAAC,CA0PxB"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { mergeUsage, parseSseChunk, readRecord, stringifyJsonValue, } from "../../../src/provider/shared/index.js";
|
|
2
|
+
function isEmptyRecord(value) {
|
|
3
|
+
return Boolean(value &&
|
|
4
|
+
typeof value === "object" &&
|
|
5
|
+
!Array.isArray(value) &&
|
|
6
|
+
Object.keys(value).length === 0);
|
|
7
|
+
}
|
|
2
8
|
export function normalizeAnthropicFinishReason(raw) {
|
|
3
9
|
if (typeof raw !== "string") {
|
|
4
10
|
return null;
|
|
@@ -115,7 +121,7 @@ export async function* streamAnthropicCompatibleParts(stream) {
|
|
|
115
121
|
...(providerExecuted ? { providerExecuted } : {}),
|
|
116
122
|
};
|
|
117
123
|
const initialInput = contentBlock.input;
|
|
118
|
-
if (initialInput !== undefined) {
|
|
124
|
+
if (initialInput !== undefined && !isEmptyRecord(initialInput)) {
|
|
119
125
|
const serializedInput = stringifyJsonValue(initialInput);
|
|
120
126
|
current.input += serializedInput;
|
|
121
127
|
yield {
|