Mentioning the function name in the Assistant instruction

I have recently started to use function calling via Assistant API’s tools.
Haven’t found in the docs any recommendation regarding proper instructions for the model when and which function to call.

For example,
if I update/create my assistant passing the tool param:

client.beta.assistants.update(
        assistant_id=agent_id,
        instructions=instructions,
        name=name,
        tools=tools
)

where the tool is some function:

FUNC_TOOL_REPLY_TYPE = {
    "type": "function",
    "function": {
        "name": "rec_reply_type",
        "description": "Records the type of the user reply to the assistant question in terms of relevancy: 'relevant', 'off topic', 'question to clarify'",
        "parameters": {
            "type": "object",
            "properties": {
                "reply_type": {
                    "type": "string", 
                    "description": "one of the replies"
                },
            },
            "required": ["reply_type"]
        }
    }
}

Do I actually need to mention this name “rec_reply_type” and the maybe even the logic of the description in the assistant instruction?
i.e. “”" When the user replies to your question, you need to call the function ‘rec_reply_type’ with the type of the user reply: ‘relevant’, ‘off topic’, ‘question to clarify’.“”"

or the tool data structure should be enough for the model to use the tool in the right moment calling the right function?

My experience has been that I did not mention what functions to call under what conditions, in my instructions. I wanted to keep the instructions short and also keep the functions self-explanatory. I used functions to retrieve data and also functions to inform the system about the outcomes. I mentally refer to the latter as ‘callback functions’. What you described I think is a callback function. I did not mention about it in the instructions. LLM called the function sometimes and did not at other times. I prefer that it calls them consistently. The instruction set is premium in many ways and hence my preference is not to mention the functions in the instructions again.

1 Like