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

error with claude model #19

Open
alanzou opened this issue Sep 12, 2024 · 0 comments
Open

error with claude model #19

alanzou opened this issue Sep 12, 2024 · 0 comments

Comments

@alanzou
Copy link

alanzou commented Sep 12, 2024

I tried to run the testing claude code, if I do not interrupt the model, everything is working fine. If I interrupt during the conversation, I received following error:

Received interaction_type=response_required, response_id=1, last_transcript=Yes. I would like to make appointment
Transcript messages: [{'role': 'user', 'content': '\n ...\n '}, {'role': 'assistant', 'content': "Hey there, I'm your personal AI therapist, how can I help you?"}, {'role': 'user', 'content': 'Yes. I would like to make appointment'}]
request.response_id: 1
Stop reason: end_turn
Received interaction_type=response_required, response_id=2, last_transcript=an appointment. Can you tell me what day and time
Transcript messages: [{'role': 'user', 'content': '\n ...\n '}, {'role': 'assistant', 'content': "Hey there, I'm your personal AI therapist, how can I help you?"}, {'role': 'user', 'content': 'Yes. I would like to make appointment'}, {'role': 'assistant', 'content': "Absolutely! I'd be happy to help you schedule "}, {'role': 'user', 'content': 'What time'}, {'role': 'assistant', 'content': 'an appointment. Can you tell me what day and time '}]
request.response_id: 2
Task exception was never retrieved
future: <Task finished name='Task-56' coro=<websocket_handler..handle_message() done, defined at D:\Project-AI-Retell\retell-custom-llm-python-demo\app\server.py:153> exception=BadRequestError("Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: final assistant content cannot end with trailing whitespace'}}")>
Traceback (most recent call last):
File "D:\Project-AI-Retell\retell-custom-llm-python-demo\app\server.py", line 185, in handle_message
async for event in llm_client.draft_response(request):
File "D:\Project-AI-Retell\retell-custom-llm-python-demo\app\claude_with_func_calling.py", line 264, in draft_response
stream = await self.client.messages.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\envs\retell\Lib\site-packages\anthropic\resources\messages.py", line 1799, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "D:\miniconda3\envs\retell\Lib\site-packages\anthropic_base_client.py", line 1816, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\envs\retell\Lib\site-packages\anthropic_base_client.py", line 1510, in request
return await self._request(
^^^^^^^^^^^^^^^^^^^^
File "D:\miniconda3\envs\retell\Lib\site-packages\anthropic_base_client.py", line 1611, in _request
raise self._make_status_error_from_response(err.response) from None
anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: final assistant content cannot end with trailing whitespace'}}
Received interaction_type=response_required, response_id=3, last_transcript=is the today?

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