feat(packages): Add selective pi-ai base entrypoints (#5348)

This commit is contained in:
Fred K. Schott
2026-06-18 15:41:49 -07:00
committed by GitHub
parent 1a418ad223
commit 0d89a33373
78 changed files with 671 additions and 495 deletions

View File

@@ -7,6 +7,7 @@ import type {
RawMessageStreamEvent,
RefusalStopDetails,
} from "@anthropic-ai/sdk/resources/messages.js";
import { registerApiProvider } from "../api-registry.ts";
import { calculateCost } from "../models.ts";
import type {
AnthropicMessagesCompat,
@@ -786,6 +787,14 @@ export const streamSimpleAnthropic: StreamFunction<"anthropic-messages", SimpleS
} satisfies AnthropicOptions);
};
export function register(): void {
registerApiProvider({
api: "anthropic-messages",
stream: streamAnthropic,
streamSimple: streamSimpleAnthropic,
});
}
function isOAuthToken(apiKey: string): boolean {
return apiKey.includes("sk-ant-oat");
}