I recently discovered that I can deploy an Agent created by me in Agent Studio as a function.
My approach is to use it in AIP Logic, but it requires two parameters, the first one, is the prompt and the second one is the sessionRID. My issue is that I don’t know how to obtain this parameter.
It would be great if someone could guide on how to fill in this parameter or how to use the Agents in AIP Logic as a function.
If you omit the session rid in your first execution of the agent (that is, do not pass a value), you will receive a session rid to use in subsequent Agent function executions.
Here are the docs: https://www.palantir.com/docs/foundry/agent-studio/agents-as-functions/#function-inputs
As for how to use this in Logic, currently there is no way in Logic to omit optional fields on functions (like the session rid in this case). The workaround here would be to wrap your Agent function in a Typescript function, calling the Agent function without the session rid in that Typescript. We are tracking this limitation as product.
To fully work around the AIP Logic optional limitation, you might need to create two of these wrapper functions, one of which takes in the session RID string, and the other does not!
I was trying to implement the code that you share with me and read the doc, but I have 2 doubts, the first, how I indicate to the code which Agent i want to use (In any place I put the agent rid or something), and the second, how I import “Queries” of the line 3 (This is not working for me)
how I indicate to the code which Agent i want to use
Sure! My example was a notional one; I used agentFunctionName, but this should be the api name of your function. Once you import queries, it should be a method on that Queries object, so it should autocomplete for you! Each function you import as a query will show up on the Queries.
how I import “Queries” of the line 3
You need something like this at the top of your file
Sure! My example was a notional one; I used agentFunctionName , but this should be the api name of your function. Once you import queries, it should be a method on that Queries object, so it should autocomplete for you! Each function you import as a query will show up on the Queries.
Okey, done
You need something like this at the top of your file
Yes, I already doing this, but I have the error Module '"@foundry/ontology-api"' has no exported member 'Queries'.typescript(2305)
And I try to install it from the libraries Tab of the left side of the screen
Yes, I have already imported the agent as a function and set the EnableQueries to TRUE, but the main issue is still there, I can’t import the “Queries” function