-
Notifications
You must be signed in to change notification settings - Fork 55
Description
I am getting error while prompting for anything. Is there anything I can do for this issue?
I am using manjaro linux and have other setup. App opens properly but for any prompt
I get Unexpected error: 'ascii' codec can't encode character '\u201c' in position 0: ordinal not in range
`2025-03-20 16:39:43,521 - ERROR - Unexpected error during agent run: Unexpected error: 'ascii' codec can't encode character '\u201c' in position 0: ordinal not in range(128)
Traceback (most recent call last):
File "/data/hen/test/computer-agent/src/anthropic.py", line 36, in get_next_action
response = self.client.beta.messages.create(
model="claude-3-5-sonnet-20241022",
...<30 lines>...
betas=["computer-use-2024-10-22"],
)
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/_utils/_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/resources/beta/messages/messages.py", line 958, in create
return self._post(
~~~~~~~~~~^
"/v1/messages?beta=true",
^^^^^^^^^^^^^^^^^^^^^^^^^
...<23 lines>...
stream_cls=Stream[BetaRawMessageStreamEvent],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/_base_client.py", line 1336, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/_base_client.py", line 1013, in request
return self._request(
~~~~~~~~~~~~~^
cast_to=cast_to,
^^^^^^^^^^^^^^^^
...<3 lines>...
retries_taken=retries_taken,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/_base_client.py", line 1039, in _request
request = self._build_request(options, retries_taken=retries_taken)
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/_base_client.py", line 487, in _build_request
headers = self._build_headers(options, retries_taken=retries_taken)
File "/data/hen/test/linux-env/lib/python3.13/site-packages/anthropic/_base_client.py", line 431, in _build_headers
headers = httpx.Headers(headers_dict)
File "/data/hen/test/linux-env/lib/python3.13/site-packages/httpx/_models.py", line 156, in init
bytes_value = _normalize_header_value(v, encoding)
File "/data/hen/test/linux-env/lib/python3.13/site-packages/httpx/_models.py", line 82, in _normalize_header_value
return value.encode(encoding or "ascii")
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode character '\u201c' in position 0: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/hen/test/computer-agent/src/store.py", line 44, in run_agent
message = self.anthropic_client.get_next_action(self.run_history)
File "/data/hen/test/computer-agent/src/anthropic.py", line 92, in get_next_action
raise Exception(f"Unexpected error: {str(e)}")
Exception: Unexpected error: 'ascii' codec can't encode character '\u201c' in position 0: ordinal not in range(128)
`