Passing the output of one function call as input to another function

Hello!

Imagine I have two functions: get_city_weather and get_capital_by_country. When a user asks, “What’s the weather like in the UK?” the system sequentially executes two functions: get_capital_by_country followed by get_city_weather. This works well (but not always). However, I’m wondering if there’s a formal method to describe the output parameters of a function, similar to how we define input parameters. This would enhance the reliability of the function call chain.

Thank you!

Hey I am currently trying to find a viable solution for the same problem. Were you able to figure something out?

Your question is not too clear what do you mean by describing the output parameters?

I was thinking that describing the function’s return parameters would improve the consistency of sequential function calls. For example, in defining an action (such as ChatGPT actions), we can say:

      responses:
        '200':
          description: A paged array of pets
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:    
              schema:
                $ref: "#/components/schemas/Pets"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

No, in most cases it calls them correctly, so I’ve just stuck to a more thorough incoming parameters check.