Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenAPI client for endpoints with uppercase Query variables #266

Open
rjambrecic opened this issue Sep 23, 2024 · 0 comments
Open

Fix OpenAPI client for endpoints with uppercase Query variables #266

rjambrecic opened this issue Sep 23, 2024 · 0 comments
Assignees

Comments

@rjambrecic
Copy link
Contributor

rjambrecic commented Sep 23, 2024

@app.get("/gifs", response_model=list[Gif], tags=["gifs"])
def get_gifs_for_topic(topic: str = fastapi.Query(..., alias="Topic")) -> list[Gif]:
    """Get GIFs for a topic."""
    return [
        Gif(id=1, title="Gif 1", url=f"https://gif.example.com/gif1?topic={topic}"),
        Gif(id=2, title="Gif 2", url=f"https://gif.example.com/gif2?topic={topic}"),
    ]

Tool call error:

***** Suggested tool call (call_8X6Nbo0sCpGgg9oxYUKA0U2w): get_gifs_for_topic_gifs_get *****
Arguments: 
{
  "topic": "funny"
}
********************************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION get_gifs_for_topic_gifs_get...
INFO:     127.0.0.1:36802 - "GET /gifs?topic=funny HTTP/1.1" 422 Unprocessable Entity
user_proxy (to agent):

user_proxy (to agent):

***** Response from calling tool (call_8X6Nbo0sCpGgg9oxYUKA0U2w) *****
{"detail": [{"type": "missing", "loc": ["query", "Topic"], "msg": "Field required", "input": null}]}
**********************************************************************
@rjambrecic rjambrecic self-assigned this Sep 23, 2024
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

No branches or pull requests

1 participant