How can I add documentation to function?

Hi all

in Function in Ontology Manager,

There is documentation section

But how can I add description there?

Please let me know if there is someone who knows how to do it thanks

Hi Limon,

The function pages in Ontology Manager are read-only for metadata. Adding a description in the function documentation section depends on the type of function.

For functions defined in code, documentation is added directly in your function code using comments (ie, JSDoc docstring/decorator metadata).

For Typescript:

/**
 * Adds two integers together and returns the result.
 * Use this function in Workshop to compute the sum of two numeric inputs.
 * 
 * @param a - first integer to add // Add descriptions for parameters 
 * @param b - second integer to add
 */

@Function()
  public addIntegers(a: Integer, b: Integer): Integer {
  return a + b;
}

For Python:

from functions.api import function, Integer

@function
def add_integers(a: Integer, b: Integer) -> Integer:
    """
    Adds two integers together and returns the result.
    Use this function in Workshop to compute the sum of two numeric inputs.
    """
    return a + b

For functions defined in AIP Logic, you can add documentation description through the AIP Logic UI. Open the Function configuration sidebar (the gear / “Configure function” panel) and use the Function details section. You set the display name, description, and longer documentation there.