swarmauri / swarmauri-sdk

https://swarmauri.com
Apache License 2.0
69 stars 40 forks source link

[Test Case Failure]: tests/unit/llms/AnthropicToolModel_unit_test.py #691

Closed 3rd-Son closed 1 day ago

3rd-Son commented 2 weeks ago

Test Case

tests/unit/llms/AnthropicToolModel_unit_test.py

Pytest Logs

FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_predict[claude-3-haiku-20240307] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_predict[claude-3-opus-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_predict[claude-3-5-sonnet-20240620] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_predict[claude-3-sonnet-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_stream[claude-3-haiku-20240307] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_stream[claude-3-opus-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_stream[claude-3-5-sonnet-20240620] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_stream[claude-3-sonnet-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_apredict[claude-3-haiku-20240307] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_apredict[claude-3-opus-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_apredict[claude-3-5-sonnet-20240620] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_apredict[claude-3-sonnet-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_astream[claude-3-haiku-20240307] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_astream[claude-3-opus-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_astream[claude-3-5-sonnet-20240620] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_astream[claude-3-sonnet-20240229] - anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your API request included an `assistant` message in the final position, which would pre-fill the `assistant` response. When using tools, pre-filling the `assistant` response is not supported.'}}
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_abatch[claude-3-haiku-20240307] - TypeError: object Message can't be used in 'await' expression
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_abatch[claude-3-opus-20240229] - TypeError: object Message can't be used in 'await' expression
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_abatch[claude-3-5-sonnet-20240620] - TypeError: object Message can't be used in 'await' expression
FAILED tests/unit/llms/AnthropicToolModel_unit_test.py::test_abatch[claude-3-sonnet-20240229] - TypeError: object Message can't be used in 'await' expression

Root Cause

Badrequest and Type error

Potential Solutions

No response

Additional Context (optional)

No response

Type of Test Case

Unit

asiftech001 commented 1 week ago

Was it solved ??? Please let me know, I am facing the same issue

3rd-Son commented 1 week ago

Was it solved ??? Please let me know, I am facing the same issue

Yes, it has been solved. The next release will have the update

asiftech001 commented 1 week ago

Can you let me know what was the exact issue ??

3rd-Son commented 1 week ago

Are you getting the error while using swarmauri package or?

asiftech001 commented 1 week ago

I am using AnthropicVertex, when I am passing the tool calls using role as assistant. I am facing this error Your API request included anassistantmessage in the final position, which would pre-fill theassistantresponse. When using tools, pre-filling theassistantresponse is not supported.' Can you help me out, what needs to be done to resolve this issue

asiftech001 commented 1 week ago

Also can you explain how can we pass tools calling history in the chat history of AnthropicVertex with some claude model