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
    Modifier and Type
    Required Element
    Description
    Parameter name as seen by LLM.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Human-readable description for LLM.
    Example values for the parameter.
    boolean
    Whether the parameter is required.
    Parameter type for JSON schema.
  • Element Details

    • name

      String name
      Parameter name as seen by LLM.
    • type

      String type
      Parameter type for JSON schema. Common values: "string", "integer", "number", "boolean", "array", "object"
      Default:
      "string"
    • description

      String description
      Human-readable description for LLM.
      Default:
      ""
    • required

      boolean required
      Whether the parameter is required.
      Default:
      true
    • examples

      String[] examples
      Example values for the parameter.
      Default:
      {}