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

feat: Tool from OpenAPI spec #155

Open
hughlv opened this issue Aug 13, 2024 · 0 comments
Open

feat: Tool from OpenAPI spec #155

hughlv opened this issue Aug 13, 2024 · 0 comments

Comments

@hughlv
Copy link
Collaborator

hughlv commented Aug 13, 2024

Currently each tool is a python function. We can expand this to OpenAPI spec so no code is required at all.

The solution could be either generating a python function from the json/yaml, or perform a dynamic request at runtime. API key should be handled properly.

{
  "openapi": "3.1.0",
  "info": {
    "title": "Get weather data",
    "description": "Retrieves current weather data for a location.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://weather.example.com"
    }
  ],
  "paths": {
    "/location": {
      "get": {
        "description": "Get temperature for a specific location",
        "operationId": "GetCurrentWeather",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "description": "The city and state to retrieve the weather for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
      }
    }
  },
  "components": {
    "schemas": {}
  }
}
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