DEV Community

Thom
Thom

Posted on

3

Skill kit: use output from LLM and save to custom field

The newly released skill kit to build your own Now Assist (Gen AI) skills is amazing. If you had that chance to test it already, I'm sure you agree! :)

The newly created skill can then be used via a UI action in your forms. This means you may also want to store the output from the LLM in a field on your form.

An easy way is to already apply a postprocessing script first in the skill kit:

(function(payload) {
var response = JSON.parse(payload.response);
payload.response[0] = response["model_output"];
return payload;
})(payload);

And then, in your UI Action, you can add directly in the try part:

var returnObj = sn_one_extend.OneExtendUtil.execute(request);
current.u_custom_field = returnObj.capabilities["capabilitySysId"].response;
current.update();

Please also replace the "capabilitySysId" with the sysId of your capability. You find it in the generated UI action.
You can then also replace the 'u_custom_field' with the field on your form you want to save the output into. For one skill I told the LLM to output me HTML and saved it into a HTML field. Worked very well!

Happy coding! :)

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

ACI image

ACI.dev: Fully Open-source AI Agent Tool-Use Infra (Composio Alternative)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Check out our GitHub!

Join the Runner H "AI Agent Prompting" Challenge: $10,000 in Prizes for 20 Winners!

Runner H is the AI agent you can delegate all your boring and repetitive tasks to - an autonomous agent that can use any tools you give it and complete full tasks from a single prompt.

Check out the challenge

DEV is bringing live events to the community. Dismiss if you're not interested. ❤️