plugins-quickstart icon indicating copy to clipboard operation
plugins-quickstart copied to clipboard

How does ChatGPT consume the request?

Open feargswalsh92 opened this issue 1 year ago • 1 comments

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

image

but it doesn't log event details I pass in the prompt as the event_details as part of the request.

image

How does ChatGPT figure out what the request is when it identifies the correct route to associate with a prompt?

feargswalsh92 avatar Jun 08 '23 15:06 feargswalsh92

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?

that-one-arab avatar Jul 29 '23 03:07 that-one-arab