Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Issue using anthropic through llm-polyglot #173

Closed
bbauman1 opened this issue May 8, 2024 · 2 comments · Fixed by #182
Closed

Type Issue using anthropic through llm-polyglot #173

bbauman1 opened this issue May 8, 2024 · 2 comments · Fixed by #182

Comments

@bbauman1
Copy link

bbauman1 commented May 8, 2024

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<...>;
        };
    };
}

CleanShot 2024-05-08 at 12 06 15@2x

@roodboi
Copy link
Collaborator

roodboi commented May 17, 2024

what versions of each package are you on?

@pdlug
Copy link

pdlug commented May 23, 2024

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).

@roodboi roodboi linked a pull request Jun 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants