Skip to content

fix bedrock connection error due to missing description#311

Merged
AzulGarza merged 1 commit intoTimeCopilot:mainfrom
JoseCelis:fix_bedrock_connection
Feb 23, 2026
Merged

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

Conversation

@JoseCelis
Copy link
Contributor

@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"}}'}

@AzulGarza AzulGarza self-requested a review February 23, 2026 18:56
Copy link
Member

@AzulGarza AzulGarza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @JoseCelis! thanks so much for the contribution. lgtm:)

@AzulGarza AzulGarza merged commit 3ac5a5c into TimeCopilot:main Feb 23, 2026
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.

2 participants