Skip to content

Commit

Permalink
ai.infer: anthropic types and adapters (#762)
Browse files Browse the repository at this point in the history
This add types from the Anthropic SDK to support Anthropic models.

---------

Co-authored-by: Jack Williams <1736957+jpwilliams@users.noreply.github.com>
Co-authored-by: Jack Williams <jack@inngest.com>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent efc6c79 commit 255416c
Show file tree
Hide file tree
Showing 7 changed files with 734 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-buttons-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": minor
---

Add `anthropic()` model for `step.ai.*()`
4 changes: 3 additions & 1 deletion packages/inngest/src/components/ai/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type AnthropicAiAdapter } from "./adapters/anthropic.js";
import { type OpenAiAiAdapter } from "./adapters/openai.js";

/**
Expand Down Expand Up @@ -91,7 +92,7 @@ export namespace AiAdapter {
/**
* Supported I/O formats for AI models.
*/
export type Format = "openai-chat"; // | "anthropic" | "gemini" | "bedrock";
export type Format = "openai-chat" | "anthropic";

/**
* A function that creates a model that adheres to an existng AI adapter
Expand All @@ -108,6 +109,7 @@ export namespace AiAdapter {
*/
const adapters = {
"openai-chat": null as unknown as OpenAiAiAdapter,
anthropic: null as unknown as AnthropicAiAdapter,
} satisfies Record<AiAdapter.Format, AiAdapter>;

/**
Expand Down
Loading

0 comments on commit 255416c

Please sign in to comment.