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

running the sample code raises errors with anthropic with "pip install aisuite[all] #153

Open
echohive42 opened this issue Dec 15, 2024 · 1 comment

Comments

@echohive42
Copy link

echohive42 commented Dec 15, 2024

a/Desktop/echo_hive_all/openai swarm/test.py"
Why did the pirate bring a ladder to the bar? Because he heard the drinks were on the house! Arrr!
Traceback (most recent call last):
File "c:\Users\memoa\Desktop\echo_hive_all\openai swarm\test.py", line 12, in
response = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\memoa\miniconda3\envs\basic3\Lib\site-packages\aisuite\client.py", line 108, in create
self.client.providers[provider_key] = ProviderFactory.create_provider(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\memoa\miniconda3\envs\basic3\Lib\site-packages\aisuite\provider.py", line 46, in create_provider
return provider_class(**config)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\memoa\miniconda3\envs\basic3\Lib\site-packages\aisuite\providers\anthropic_provider.py", line 16, in init
self.client = anthropic.Anthropic(**config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\memoa\miniconda3\envs\basic3\Lib\site-packages\anthropic_client.py", line 121, in init
super().init(
File "C:\Users\memoa\miniconda3\envs\basic3\Lib\site-packages\anthropic_base_client.py", line 835, in init
self._client = http_client or SyncHttpxClientWrapper(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\memoa\miniconda3\envs\basic3\Lib\site-packages\anthropic_base_client.py", line 733, in init
super().init(**kwargs)
TypeError: Client.init() got an unexpected keyword argument 'proxies'

C:\Users\memoa\Desktop\echo_hive_all\openai swarm>




CODE I RAN:

`import aisuite as ai
client = ai.Client()

models = ["openai:gpt-4o", "anthropic:claude-3-5-sonnet-latest"]

messages = [
{"role": "system", "content": "Respond in Pirate English."},
{"role": "user", "content": "Tell me a joke."},
]

for model in models:
response = client.chat.completions.create(
model=model,
messages=messages,
temperature=0.75
)
print(response.choices[0].message.content)
`

@rohitprasad15
Copy link
Collaborator

Thanks for reporting this.
This is a dup of #110
This has been fixed.
We will release a patch shortly with the fix into PyPI.
The fix is already merged in github.

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

2 participants