workers-ai-provider
Version:
Workers AI Provider for the vercel AI SDK
21 lines (20 loc) • 594 B
JavaScript
import { createAnthropic } from "@ai-sdk/anthropic";
//#region src/anthropic.ts
/**
* Anthropic-wire provider plugin for the gateway delegate. Pass to
* `createGatewayDelegate({ providers: [anthropic] })` to handle
* `"anthropic/<model>"` slugs.
*
* Requires `@ai-sdk/anthropic` (an optional peer dependency — install it yourself).
*/
const anthropic = {
wireFormat: "anthropic",
create: ({ modelId, fetch, baseURL }) => createAnthropic({
apiKey: "unused",
fetch,
...baseURL ? { baseURL } : {}
})(modelId)
};
//#endregion
export { anthropic };
//# sourceMappingURL=anthropic.mjs.map