AIP Studio Agent Ad-Hoc Tool

I tired creating a custom typescript function that generates an ontology-edit (see code below for reference purposes). However, I can’t use it as a tool neither in AIP Agent Studio nor in AIP Logic. Will this be supported any time soon? or am I doing something wrong?

import { Edits, OntologyEditFunction } from "@foundry/functions-api";
import { Objects, PictureCollection } from "@foundry/ontology-api";
import { Uuid } from "@foundry/functions-utils";

export class MyFunctions {

    @Edits(PictureCollection)
    @OntologyEditFunction()
    public async executeChange(image: string, imageMetadata: string): Promise<void> {
        // Generate a unique identifier for the new object
        const uniqueId = Uuid.random();

        // Create Picture Collection
        const pictureCollection = Objects.create().pictureCollection(uniqueId);
        pictureCollection.image_name = image + "my_check";
        pictureCollection.imageMetadata = imageMetadata;
    }
}

Hey @AtWorkDS

Ontology edit functions are not supported by the function tool - you will instead need to wrap your function in a custom action type, and should then be able to provide this to your AIP Agent or AIP Logic using the action tool instead.

We have added an improved error message in agent studio to make this restriction clearer when saving your agent with an unsupported function type for the function tool - you should see this update in the next week!

Thank you. Would that be an example of how to to wrap a function in a custom action type?

The updated validation message should specify that you need to provide ontology edit functions via actions, rather than an example of how to do this - you can find an example of how to create a function-backed example in the docs here: https://www.palantir.com/docs/foundry/action-types/function-actions-getting-started/

1 Like

Thank you, i found a way to make it work.