Skip to content

Commit

Permalink
Added petstore3 example
Browse files Browse the repository at this point in the history
  • Loading branch information
Romamo committed Feb 7, 2025
1 parent d2d9b3c commit a1b9072
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Empty file added examples/__init__.py
Empty file.
Empty file added examples/petstore3/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions examples/petstore3/invoke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from openapi_llm.client.openapi import OpenAPIClient

# Create the client from a spec URL (or file path, or raw string)
service_api = OpenAPIClient.from_spec(
openapi_spec="https://petstore3.swagger.io/api/v3/openapi.json",
url="https://petstore3.swagger.io/api/v3"
)
response = {
"arguments": {
"petId": 1
},
"name": "getPetById"
}
service_response = service_api.invoke(response)
print(service_response)

0 comments on commit a1b9072

Please sign in to comment.