Skip to content

tools: incomplete dataset parameter specification by user returns 404 error #25

@annav-gov

Description

@annav-gov

Describe the bug
If the input for the dataset parameter in the fetch-dataset-geography tool is incomplete (based on the information that the user provided in the prompt), then the tool/API will return a 404 error.

To Reproduce
Steps to reproduce the behavior:

  1. Input prompt: "What levels of geography are available for 2023 planning database (PDB)?"
  2. Client correctly identifies that it needs to use fetch-dataset-geography tool and identifies the inputs as {"dataset": "pdb", "year": 2023}.
  3. The above returns a 404 error, because dataset should be either "pdb/tract" or "pdb/blockgroup."

Expected behavior
I would like the tool to return an error that say that the dataset "pdb" doesn't exist AND suggest what the user may have meant. For example, for client to ask if the user meant "pdb/tract" or "pdb/blockgroup" and continue the interaction with the updated information.

The challenge here will be to know if the dataset parameter or the year parameter failed (the latter meaning the dataset doesn't exist for that year).

Screenshots

Image

Desktop:

  • OS: iOS Sequoia 15.5
  • IDE: VSCode 1.101.0
  • Client: Github Copilot
  • Model Version: GPT4.1
  • Latest repo commit: 5475422

Additional context
In the API, dataset can have more than one "description/identifier" (for lack of a better term). For example, /cbp/ has one, acs/acs1 has two, and cps/basic/dec has three.

Image

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions