Follow these steps to create a function in the assistant:

Step-by-Step Guide

  1. Find “Functions” on the Sidebar

    • In the assistant main page, locate “Functions” on the sidebar.
  2. Click “Add Function”

    • Click “Add function” on the left side of the page.
  3. Define the Function Name

    • At the top of the page, you can define the function name. Note that the function name can only contain alphanumeric characters and underscores.
  4. Provide a Description

    • In the “Description” field, provide an accurate description of what your function does. This helps the model understand when to call this function. Be as descriptive as possible about the function’s purpose.
  5. Define LLM Parameters

    • In the “LLM Parameters” field, list the parameters that you expect the LLM model to collect and use in the function.
      • Name: The name of the parameter. A good name improves the accuracy of the LLM result.
      • Context Description: Provides vital context for the LLM to accurately understand and extract the parameter from the caller.
      • Type: Specifies the type of the parameter. It can be “string”, “number”, “integer”, or “boolean”. Note that “number” supports decimal values while “integer” does not.
  6. Define the Function

    • In the “Function Definition” field, define the function using Python syntax. You may retrieve “Secrets” in your Python definition. Refer to the “How to Retrieve Secret” page for more details.
    • The function should return a string, which will be provided as additional information back to the LLM to continue the conversation. It’s important to return a natural language string that fills the knowledge gap for the LLM model.
  7. Save the Function

    • Click “Save” once you’re done to create your first function.

By following these steps, you will successfully create a function in the assistant. For further assistance, please refer to our Support Page or contact our support team.