@veryfront/ext-llm-anthropic 0.1.1281 → 0.1.1282
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-request-builder.d.ts","sourceRoot":"","sources":["../src/anthropic-request-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"anthropic-request-builder.d.ts","sourceRoot":"","sources":["../src/anthropic-request-builder.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,uBAAuB,EAEvB,0BAA0B,EAE3B,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EACL,KAAK,iCAAiC,EAUvC,MAAM,+BAA+B,CAAC;AAEvC,KAAK,gBAAgB,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;AA6E9C,KAAK,0BAA0B,GAAG;IAChC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,+BAAgC,SAAQ,uBAAuB;IAC9E,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACjD;AAED,gGAAgG;AAChG,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAE/D,KAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,OAAO,EAAE;QACZ,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC;QACtC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,CAAC;IACT,KAAK,IAAI,KAAK,CAAC;QACb,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC;QACtC,OAAO,CAAC,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ACpB,OAAO,EAAE,+BAA+B,EACxC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,gBAAgB,GACzB,0BAA0B,CAQ5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { canIdentifyProxyWithoutHooks, closeSchemaForOutputConfig, isProxyWithoutHooks, jsonValuesEqual, readProviderOptions, readRecord, snapshotProviderJsonValue, stringifyToolResultValue, unwrapToolInputSchema, } from "veryfront/provider/shared";
|
|
1
|
+
import { canIdentifyProxyWithoutHooks, closeSchemaForOutputConfig, isImageFileInput, isProxyWithoutHooks, jsonValuesEqual, readInlineFileData, readProviderOptions, readRecord, readRemoteFileUrl, snapshotProviderJsonValue, stringifyToolResultValue, unsupportedFileInputError, unwrapToolInputSchema, } from "veryfront/provider/shared";
|
|
2
2
|
import { assertAnthropicMcpRequestContract, normalizeAnthropicMcpServers, normalizeAnthropicMcpToolsetArgs, } from "./anthropic-mcp-request.js";
|
|
3
3
|
import { isAnthropicProviderToolResultBlockType, MAX_ANTHROPIC_RAW_ASSISTANT_BLOCKS, MAX_ANTHROPIC_REPLAY_ASSISTANT_MESSAGES, parseAnthropicProviderToolUse, parseAnthropicServerToolResult, snapshotAnthropicRawAssistantMetadata, validateAnthropicRawAssistantMessages, } from "./anthropic-native-content.js";
|
|
4
4
|
const apply = Reflect.apply;
|
|
@@ -664,20 +664,21 @@ function toAnthropicUserContent(parts) {
|
|
|
664
664
|
const content = [];
|
|
665
665
|
for (const part of parts) {
|
|
666
666
|
if (part.type === "text") {
|
|
667
|
-
if (part.text.length > 0)
|
|
667
|
+
if (part.text.length > 0)
|
|
668
668
|
content.push({ type: "text", text: part.text });
|
|
669
|
-
}
|
|
670
669
|
continue;
|
|
671
670
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
671
|
+
const mediaType = part.mediaType.toLowerCase();
|
|
672
|
+
const image = isImageFileInput(part);
|
|
673
|
+
if (!image && mediaType !== "application/pdf") {
|
|
674
|
+
throw unsupportedFileInputError("Anthropic", part, "Use an image or a PDF file.");
|
|
675
|
+
}
|
|
676
|
+
const data = readInlineFileData(part);
|
|
677
|
+
const source = data === undefined
|
|
678
|
+
? { type: "url", url: readRemoteFileUrl("Anthropic", part) }
|
|
679
|
+
// Anthropic accepts only the standard `image/jpeg` spelling.
|
|
680
|
+
: { type: "base64", media_type: mediaType === "image/jpg" ? "image/jpeg" : mediaType, data };
|
|
681
|
+
content.push({ type: image ? "image" : "document", source });
|
|
681
682
|
}
|
|
682
683
|
return content;
|
|
683
684
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryfront/ext-llm-anthropic",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1282",
|
|
4
4
|
"description": "Veryfront first-party extension package for ext-llm-anthropic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"veryfront",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"capabilities": []
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"veryfront": "^0.1.
|
|
48
|
+
"veryfront": "^0.1.1282"
|
|
49
49
|
},
|
|
50
50
|
"type": "module",
|
|
51
51
|
"types": "./esm/index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"NOTICE",
|
|
56
56
|
"README.md"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ca25ee51eda291759fb26352fe07d64f46fd8753"
|
|
59
59
|
}
|