Package com.tnsai.annotations
Annotation Interface LLMParam
Defines a parameter that is exposed to the LLM for tool calling.
Use this annotation when the parameters that LLM should see are different
from the actual action method parameters. This is typically used with
BeforeActionSpec to transform LLM-friendly parameters to action parameters.
Example
// LLM sees: getWeather(city: string)
// Action receives: lat, lon, apiKey (from BeforeAction)
@ActionSpec(type = WEB_SERVICE, endpoint = "...")
@BeforeActionSpec("prepareParams")
@LLMParam(name = "city", type = "string", description = "City name")
public Object getWeather(String lat, String lon, String apiKey, ActionResult result) {
...
}
Multiple Parameters
@LLMParam(name = "origin", type = "string", description = "Origin city")
@LLMParam(name = "destination", type = "string", description = "Destination city")
@LLMParam(name = "date", type = "string", description = "Travel date (YYYY-MM-DD)")
public Object searchFlights(...) { }
- Author:
- TnsAI Team
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameParameter name as seen by LLM. -
type
String typeParameter type for JSON schema. Common values: "string", "integer", "number", "boolean", "array", "object"- Default:
"string"
-
description
String descriptionHuman-readable description for LLM.- Default:
""
-
required
boolean requiredWhether the parameter is required.- Default:
true
-
examples
String[] examplesExample values for the parameter.- Default:
{}
-