Skip to content

Comments

fix bedrock connection error due to missing description#311

Open
JoseCelis wants to merge 1 commit intoTimeCopilot:mainfrom
JoseCelis:fix_bedrock_connection
Open

fix bedrock connection error due to missing description#311
JoseCelis wants to merge 1 commit intoTimeCopilot:mainfrom
JoseCelis:fix_bedrock_connection

Conversation

@JoseCelis
Copy link

@JoseCelis JoseCelis commented Feb 21, 2026

Docstrings included in timecopilot/agent.py in tsfeatures_tool, cross_validation_tool and forecast_tool.
These docstrings are required by pydantic.
These changes solve the issue:

raise ModelHTTPError(status_code=status_code, model_name=self.model_name, body=e.response) from e
pydantic_ai.exceptions.ModelHTTPError: status_code: 400, model_name: '', body: {'Error': {'Message': 'The model returned the following errors: {"error":{"code":"validation_error","message":"ErrorEvent { error: APIError { type: \\"BadRequestError\\", code: Some(400), message: \\"1 validation error for ToolDescription\\\\ndescription\\\\n  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\\\\n    For further information visit [https://errors.pydantic.dev/2.12/v/string_type\\](https://errors.pydantic.dev/2.12/v/string_type%5C%5C)", param: None } }","param":null,"type":"invalid_request_error"}}', 'Code': 'ValidationException'}, 'ResponseMetadata': {'RequestId': '', 'HTTPStatusCode': 400, 'HTTPHeaders': {'date': 'Sat, 21 Feb 2026 15:21:32 GMT', 'content-type': 'application/json', 'content-length': '512', 'connection': 'keep-alive', 'x-amzn-requestid': '', 'x-amzn-errortype': 'ValidationException:http://internal.amazon.com/coral/com.amazon.bedrock/'}, 'RetryAttempts': 0}, 'message': 'The model returned the following errors: {"error":{"code":"validation_error","message":"ErrorEvent { error: APIError { type: \\"BadRequestError\\", code: Some(400), message: \\"1 validation error for ToolDescription\\\\ndescription\\\\n  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\\\\n    For further information visit [https://errors.pydantic.dev/2.12/v/string_type\\](https://errors.pydantic.dev/2.12/v/string_type%5C%5C)", param: None } }","param":null,"type":"invalid_request_error"}}'}

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

Successfully merging this pull request may close these issues.

1 participant