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

anthropic_api.py:23 -> TypeError: Anthropic.__init__() takes 1 positional argument but 2 were given #10

Open
drnic opened this issue Oct 22, 2023 · 0 comments

Comments

@drnic
Copy link

drnic commented Oct 22, 2023

I was running through notebooks/QueryOpenAI.ipynb and I get the following error during from prompt_lib.backends import openai_api:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/QueryOpenAI.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/QueryOpenAI.ipynb) Cell 5 line 1
----> [1](vscode-notebook-cell:/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/QueryOpenAI.ipynb#W4sZmlsZQ%3D%3D?line=0) from prompt_lib.backends import openai_api

File [~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:11](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:11)
      [9](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:9) from prompt_lib.backends.wrapper import BaseAPIWrapper
     [10](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:10) from prompt_lib.backends.self_hosted import OpenSourceAPIWrapper
---> [11](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:11) from prompt_lib.backends.anthropic_api import AnthropicAPIWrapper
     [13](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:13) openai.api_key = os.getenv("OPENAI_API_KEY")
     [15](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/openai_api.py:15) # check if orgainization is set

File [~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:11](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:11)
      [8](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:8) from prompt_lib.backends.wrapper import BaseAPIWrapper
     [10](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:10) ANTHROPIC_API_KEY = os.environ.get("ANTHROPIC_API_KEY", "Your_Default_Value")
---> [11](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:11) client = anthropic.Client(ANTHROPIC_API_KEY)
     [14](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:14) class AnthropicAPIWrapper(BaseAPIWrapper):
     [15](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:15)     @staticmethod
     [16](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:16)     def _call_api(
     [17](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:17)         prompt: str,
ref='~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:0'>0</a>;32m   (...)
     [22](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:22)         num_completions: int = 1,
     [23](https://file+.vscode-resource.vscode-cdn.net/Users/drnic/workspace/aiagents/self-refine/prompt-lib/notebooks/~/workspace/aiagents/self-refine/prompt-lib/prompt_lib/backends/anthropic_api.py:23)     ) -> dict:

TypeError: Anthropic.__init__() takes 1 positional argument but 2 were given
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

No branches or pull requests

1 participant