AI & MLLLMOpenAIPython

Moving from Chat Responses to Function Calling

A chat response is easy to display. Connecting that response to a useful action requires another boundary: the application needs to know what operation is requested and which arguments belong to it.

A function-calling notebook retained in my experiments explores that boundary through tool schemas and Chat Completions calls. It is a cookbook-style learning example, rather than a complete autonomous application.

Describing the available operation

A tool definition describes an operation and its arguments in a structured form. The model can then return a request that the application interprets.

The application still owns execution. It needs to validate arguments, check whether the operation is appropriate, run the relevant code, and decide how to handle the result.

This separates a proposed action from an executed one. That distinction matters for calendar writes, external requests, database changes, and any operation with consequences beyond the chat window.

The surrounding control loop

A useful loop includes the user's request, the model's tool request, the application's result, and the final response. Errors and missing arguments need to fit into that loop too.

For example, a model might identify the right operation but omit a time zone. Software can detect the missing field and ask for clarification before creating a calendar entry.

The schema makes the boundary visible; it does not replace validation or permission checks.

A precursor to later application patterns

This notebook is useful context for a later project that analyzes wearable fitness-device data and produces reports. Its assistant uses the same broad division of responsibility: the model proposes analytics operations, code calculates evidence, and the answer uses the resulting data.

The notebook's personal execution date is not established, so I would not attach it to a later API announcement as if that were its creation date. Its contribution to the history is the application pattern.

Related project