This PR fixes a bug in the send function related to improper handling of the messages list, which led to a BadRequestError from the Anthropics API. The error message highlighted that text content blocks must contain non-whitespace text, which could happen if messages contained non-string objects or strings with only whitespace.
anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: text content blocks must contain non-whitespace text'}}
This PR fixes a bug in the send function related to improper handling of the messages list, which led to a BadRequestError from the Anthropics API. The error message highlighted that text content blocks must contain non-whitespace text, which could happen if messages contained non-string objects or strings with only whitespace.
anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: text content blocks must contain non-whitespace text'}}