Function calling an undefined function

Copilot rewrote my code to this to help me get structured output. This function “classify_user” isn’t defined anywhere. Normally, classify_user should be defined as a call to GPT to do the actual classification.
But this code works well - It calls this undefined function, does the actual classification, and output the result in format I required.
Is this hallucination in a desired way?

you are using function calling like a completions api wherein the ai fills in the categories based on your input.

1 Like

I guess so. In terms of function calling, it’s hallucinating. In terms of completion it outputs json.