#Can chat completion functions chain from each other? Output from one into the next, in a single go?

10 messages · Page 1 of 1 (latest)

acoustic epoch
#

I also couldn't find any information on this in the documentation. If it's possible could someone provide an example on how to do that?

steel smelt
#

If your request is set to FunctionCall=auto, it decides whether to call a followup function or respond to the user, after you give it the results of the first one.
It is expected that you repeatedly query it for a response until it gives a non function response, and only then can the user give their next input

acoustic epoch
#

Well, I was more so thinking of providing a series of functions to act as a pipeline. Often times a single function is not granular enough. I suppose I'll have to find an alternative way to do that.

steel smelt
#

You can show it only functions that are available from its current state (also saves tokens)

acoustic epoch
#

i was only using post requests.. are you talking about the sdk? does the sdk allow you to save tokens in that way? i wasn't aware. NOTED

misty heath
#

It is totally possible to chain function calls. It is totally possible to chain function calls. Here is a good example.

User: Turn on the light of the living room, take a picture, and turn it off

FunctionCall: control_light(location=living room, switch=on)
FunctionCall: take_picture(location=living room)
FunctionCall: control_light(location=living room, switch=off)

Assistant: I have turned on the light of the living room, taken a picture, and turned off the light. Is there anything else I can help you with?

This is a part of open source project, SlashGPT. Please take a look.

https://github.com/snakajima/SlashGPT

GitHub

Contribute to snakajima/SlashGPT development by creating an account on GitHub.

acoustic epoch
#

@misty heath this is all within the same request?

misty heath
acoustic epoch
#

gotcha, makes sense, i was hoping there were a way, it would be pretty cool, i often find myself creating pipelines for data

bold frigate
#

Hey!
Kinda got the same question but may need some help. I'm currently trying to use GPT to manage my google calendar. But to update an event I would need the correct eventID. I made a function to get the the eventIDs in a given timeframe. Now I want GPT to choose the right event and then update it. Any idea on how to realize that?

def updateEvent(self, lookUpDate, eventID = None, lookUpTime = "00:00", calendar_id='primary', title=None, startDate=None, startTime=None, endDate=None, endTime=None, location=None, attendees=None): [...] if eventID is not None: [...] return "The event {title} has successfully been ." else: [...] if events is not None: for event in events: [...] event_strs.append(f"ID {event['id']} with {event['summary']} from {start} till {end}") return { "content": "FUpcoming events are: " + ", ".join(event_strs), "function_call": { "name": "updateEvent", "arguments": {"eventID": "ID of the event to update"} } } else: return "There are no upcoming events."
(handling the text returns somewhere else)