@bastani/atomic-ai 0.9.89 → 0.9.90
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/api/anthropic-messages.d.ts.map +1 -1
- package/dist/api/anthropic-messages.js +6 -1
- package/dist/api/anthropic-messages.js.map +1 -1
- package/dist/api/anthropic-serialized-body.d.ts +6 -0
- package/dist/api/anthropic-serialized-body.d.ts.map +1 -0
- package/dist/api/anthropic-serialized-body.js +43 -0
- package/dist/api/anthropic-serialized-body.js.map +1 -0
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/amazon-bedrock.json +1 -1
- package/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/dist/providers/data/github-copilot.json +1 -1
- package/dist/providers/data/google-vertex.json +1 -1
- package/dist/providers/data/google.json +1 -1
- package/dist/providers/data/huggingface.json +1 -1
- package/dist/providers/data/opencode-go.json +1 -1
- package/dist/providers/data/opencode.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/providers/github-copilot.d.ts +5 -0
- package/dist/providers/github-copilot.d.ts.map +1 -1
- package/dist/providers/github-copilot.js +3 -3
- package/dist/providers/github-copilot.js.map +1 -1
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/utils/version.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAkD,MAAM,mBAAmB,CAAC;AAqBnF,OAAO,KAAK,EASX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAMb,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAkD,MAAM,mBAAmB,CAAC;AAqBnF,OAAO,KAAK,EASX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAMb,MAAM,aAAa,CAAC;AA6LrB,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,SAAS,CAAC;AAgfhE,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACtD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAkOD,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CA4bzE,CAAC;AA+CF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,oBAAoB,EAAE,mBAAmB,CAgDlF,CAAC"}
|
|
@@ -27,6 +27,7 @@ import { getSystemMessageText, renderSystemMessageUpdate } from "../utils/text.j
|
|
|
27
27
|
import { appendThinkingOffFallbackDiagnostic, getThinkingOffFallbackLevel } from "../utils/thinking-off.js";
|
|
28
28
|
import { getCurrentTools, getInitialSystemMessage, resolveTranscript, } from "../utils/transcript.js";
|
|
29
29
|
import { convertAnthropicAssistantContent } from "./anthropic-assistant-content.js";
|
|
30
|
+
import { takeAnthropicSerializedBody } from "./anthropic-serialized-body.js";
|
|
30
31
|
import { ANTHROPIC_STRICT_JSON_SCHEMA_PROFILE, getJsonSchemaToolParameters, prefersJsonSchemaStrictSampling, resolveJsonSchemaStrictSampling, } from "./constrained-sampling.js";
|
|
31
32
|
import { buildCopilotDynamicHeaders, hasCopilotVisionInput, preserveCopilotIntegrationHeader, } from "./github-copilot-headers.js";
|
|
32
33
|
import { adjustMaxTokensForThinking, buildBaseOptions, clampMaxTokensToContext } from "./simple-options.js";
|
|
@@ -795,9 +796,12 @@ export const stream = (model, context, options) => {
|
|
|
795
796
|
...(options?.timeoutMs !== undefined ? { timeout: options.timeoutMs } : {}),
|
|
796
797
|
maxRetries: 0,
|
|
797
798
|
};
|
|
799
|
+
let serializedBody;
|
|
798
800
|
const send = (body) => retryProviderRequest(() => {
|
|
799
801
|
streamAttempt.begin();
|
|
800
|
-
|
|
802
|
+
const transport = serializedBody ? { ...requestOptions, middleware: [serializedBody] } : requestOptions;
|
|
803
|
+
serializedBody = undefined;
|
|
804
|
+
return client.beta.messages.create({ ...body, stream: true }, transport).asResponse();
|
|
801
805
|
}, {
|
|
802
806
|
maxRetries: options?.maxRetries,
|
|
803
807
|
maxRetryDelayMs: options?.maxRetryDelayMs,
|
|
@@ -818,6 +822,7 @@ export const stream = (model, context, options) => {
|
|
|
818
822
|
output.providerThinkingLevel = built.providerThinkingLevel;
|
|
819
823
|
params = built.params;
|
|
820
824
|
const nextParams = await options?.onPayload?.(params, model);
|
|
825
|
+
serializedBody = takeAnthropicSerializedBody(params);
|
|
821
826
|
if (nextParams !== undefined)
|
|
822
827
|
params = nextParams;
|
|
823
828
|
assertPayloadPreservesFastRoute(model, params);
|