mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
Rename file, polish code and generalize
This commit is contained in:
parent
fc03f188e9
commit
0efcfc3eb9
File diff suppressed because one or more lines are too long
1
examples/Function_calling_with_an_OpenAPI_spec.ipynb
Normal file
1
examples/Function_calling_with_an_OpenAPI_spec.ipynb
Normal file
File diff suppressed because one or more lines are too long
184
examples/data/example_events_openapi.json
Normal file
184
examples/data/example_events_openapi.json
Normal file
@ -0,0 +1,184 @@
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"version": "1.0.0",
|
||||
"title": "Event Management API",
|
||||
"description": "An API for managing event data"
|
||||
},
|
||||
"paths": {
|
||||
"/events": {
|
||||
"get": {
|
||||
"summary": "List all events",
|
||||
"operationId": "listEvents",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A list of events",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"summary": "Create a new event",
|
||||
"operationId": "createEvent",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "The event was created",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/events/{id}": {
|
||||
"get": {
|
||||
"summary": "Retrieve an event by ID",
|
||||
"operationId": "getEventById",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The event",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"summary": "Delete an event by ID",
|
||||
"operationId": "deleteEvent",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "The event was deleted"
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"summary": "Update an event's details by ID",
|
||||
"operationId": "updateEventDetails",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"location": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"date",
|
||||
"location"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "The event's details were updated",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Event"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"Event": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"date": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"location": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"date",
|
||||
"location"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1053,10 +1053,11 @@
|
||||
tags: []
|
||||
|
||||
- title: Chained Function Calling with OpenAPI Spec
|
||||
path: examples/Chained_function_calling_with_OpenAPI_spec.ipynb
|
||||
path: examples/Function_calling_with_an_OpenAPI_spec.ipynb
|
||||
date: 2023-10-15
|
||||
authors:
|
||||
- shyamal-anadkat
|
||||
- simonpfish
|
||||
tags:
|
||||
- completions
|
||||
- functions
|
||||
|
Loading…
x
Reference in New Issue
Block a user