amazon-bedrock-samples icon indicating copy to clipboard operation
amazon-bedrock-samples copied to clipboard

text-2-sql-agent

Open orossant opened this issue 1 year ago • 1 comments

Agent was not able to answer correctly the question : "In what year did Hank Aaron hit the most home runs?"

Trace : "The query failed, so the batting table does not exist or does not contain home run data. Looking at the schema again, there is no batting table. I will try querying the player table instead which contains basic player information."

So the agent answer : "Based on the available data, Hank Aaron was born in the year 1934. The SQL query used was: SELECT p.name_first, p.name_last, p.birth_year AS yearid, 0 AS hr FROM player p WHERE p.name_first = 'Hank' AND p.name_last = 'Aaron' ORDER BY yearid DESC LIMIT 1;"

Root cause : the provided TheHistoryofBaseball.zip contains :

  • hall_of_fame.csv, player.csv,
  • player_award_csv,
  • salary.csv
  • but it seems that batting table is missing.

orossant avatar Feb 25 '24 16:02 orossant

the build_infrastructure.py is generating the following error:

TheHistoryOfBaseball Traceback (most recent call last): File "/root/amazon-bedrock-samples/agents-for-bedrock/use-case-examples/text-2-sql-agent/./dependencies/build_infrastructure.py", line 11, in s3bucket = s3_client.create_bucket( File "/opt/conda/lib/python3.10/site-packages/botocore/client.py", line 565, in _api_call return self._make_api_call(operation_name, kwargs) File "/opt/conda/lib/python3.10/site-packages/botocore/client.py", line 1017, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.

This workshop was deployed on the us-west-2 region which doesn't seem to be supported.

duverney-aws avatar Jul 26 '24 12:07 duverney-aws