Create and test an Action
Build a content summarizer in Studio, test variable inputs, save it to an App, and deploy a version to an environment.
Prerequisites
You need a Klu workspace with at least one model available under Connections. If you have not set that up, complete Build your first Klu app first.
Understand Apps and Actions
An App organizes related product functionality. An Action is the callable unit inside an App: it combines messages, a provider and model, model settings, optional Context or Skills, and saved versions.
You can begin from either place:
- Select Studio to design the Action first, then create or select its App when you save.
- Open an existing App and click Add Action to start an Action within that App.
This tutorial starts in Studio.
Build the prompt in Studio
- Select Studio in the workspace sidebar.
- Select Completion in the Studio toolbar.
- In the left panel, select the provider and model you want to test.
- Add a
systemmessage if the model supports that role. Use this instruction:
System message
You summarize source material for a busy reader. Preserve the author's main claims and important qualifications. Do not add facts that are absent from the source.
- Add or edit a
usermessage and enter this template:
User message
Summarize the following content in {{length}} bullet points.
Content:
{{content}}
- Use Message to add another template message if your task needs an example or additional instruction.
Variables are names wrapped in double braces. Klu creates one test input for each variable. Use the same spelling everywhere a variable appears.
Configure the model
The model section in the left panel contains the provider, model, and settings supported by that model. Common controls include Temperature, Max Response Length, Top P, Frequency Penalty, Presence Penalty, and Stop Sequence.
Start with the provider defaults. Lower temperature when output consistency matters; raise it only when you want more variation. Available settings and message roles depend on the selected provider and model, so a control can disappear when you change models.
Test the Action
Testing happens in the main Studio area.
- If no test card is visible, click Create Variation.
- Set
lengthto3. - Paste representative source text into
content. - Click Run.
The response appears in the same test card. Click Completion at the bottom to add another variation, then change the inputs or model settings and click Run All to compare multiple tests.
Use Reset to clear variable inputs. If a run fails, check the provider and model selection, required variables, and provider error shown by Studio before changing the prompt.
Save the Action
- Click Save.
- To add the Action to an existing App, enter an Action Name, select the App, and click Save.
- To create an App and its first Action together, select New App, enter an App Name, and click Save. Klu uses that name for both records.
Once saved, the Action gains version history and deployment controls. Keep Save generations enabled when you want test and production generations available for evaluation; turn it off when those generations should not be persisted.
Edit and version the Action
Open a saved Action in Studio to change its messages, model, settings, Context, or Skills. Click Save after an edit to persist a new version.
Use the deployment menu and select Versions to inspect saved versions. Selecting an older version loads its configuration into Studio, where you can test it or use it as the basis for another saved version.
Studio test results prove how the selected configuration behaves on your examples. Production keeps using its deployed version until you explicitly deploy a newer one.
Deploy a version
- Click Deploy.
- Select Preview, Staging, or Production under Deploy to environment.
- Wait for the deployment confirmation.
Use Preview or Staging when you need an integration check before Production. The deployment menu shows the deployed environment and version. After you save a newer version, Deploy latest indicates that the latest version has not replaced the deployed one.
To integrate the Action, open the deployment menu and select API. In the Publish dialog, choose Shareable URL, Python SDK, Typescript SDK, or cURL Request. The generated example includes the saved Action GUID and its detected input fields.
If the Publish dialog asks you to deploy, the Action does not yet have public access. Deploy it to the intended environment, then reopen API.