plugins-quickstart
plugins-quickstart copied to clipboard
How does ChatGPT consume the request?
I'm working on a plugin to create a calendar event with Google via the text interface. I wrote a function with the route /create-calendar-event
@app.route("/create-calendar-event", methods=['POST'])
async def create_calendar_event():
# Get the event details from the request
event_details = await request.get_json()
print('event_details', event_details)
# Authenticate and get the Google Calendar service
service = authenticate_and_get_service()
print('event_details', event_details)
# Now you can use the service object to create a calendar event
# You will need to implement the create_event function
# This function should use the Google Calendar API to create an event with the provided details
# create_event(service, event_details)
return quart.Response("Event created successfully", status=200)
When I write "create calendar event" in the ChatGPT interface it successfully identifies the calendar event route as the appropriate route to call
but it doesn't log event details I pass in the prompt as the event_details
as part of the request.
How does ChatGPT figure out what the request is when it identifies the correct route to associate with a prompt?
I could not understand what your question was. Are you saying that Chat GPT is calling the correct POST route but missing the POST route's request body parameters? Or are you asking a general technical question on how Chat GPT does what it does?