instructor-js
instructor-js copied to clipboard
Type Issue using anthropic through llm-polyglot
I believe I'm following the documentation exactly, but receiving a typing error. Am I doing something wrong?
Type 'Anthropic & { [key: string]: unknown; chat: { completions: { create: <P extends AnthropicChatCompletionParams>(params: P) => P extends { stream: true; } ? Promise<...> : Promise<...>; }; }; }' does not satisfy the constraint 'OpenAI | GenericClient'.
Type 'Anthropic & { [key: string]: unknown; chat: { completions: { create: <P extends AnthropicChatCompletionParams>(params: P) => P extends { stream: true; } ? Promise<...> : Promise<...>; }; }; }' is missing the following properties from type 'OpenAI': organization, project, embeddings, files, and 6 more.ts(2344)
const anthropicClient: Anthropic & {
[key: string]: unknown;
chat: {
completions: {
create: <P extends AnthropicChatCompletionParams>(params: P) => P extends {
stream: true;
} ? Promise<...> : Promise<...>;
};
};
}
what versions of each package are you on?
I'm seeing this issue with:
@anthropic-ai/sdk 0.21.1
@instructor-ai/instructor 1.3.0
llm-polyglot 1.0.0
Also had the same issue with previous versions of @anthropic-ai/sdk (0.20.x) and @instructor-ai/instructor (1.2.1).