Class TurToolDescriptionCallback

java.lang.Object
com.viglet.turing.genai.tool.TurToolDescriptionCallback
All Implemented Interfaces:
org.springframework.ai.tool.ToolCallback

public class TurToolDescriptionCallback extends Object implements org.springframework.ai.tool.ToolCallback
Decorator that overrides a ToolCallback's description with content loaded from a .md file via TurToolDescriptionService.

If no override exists for a tool, the original description is preserved.

Since:
2026.1.14
Author:
Alexandre Oliveira
  • Method Details

    • getToolDefinition

      public org.springframework.ai.tool.definition.ToolDefinition getToolDefinition()
      Specified by:
      getToolDefinition in interface org.springframework.ai.tool.ToolCallback
    • getToolMetadata

      public org.springframework.ai.tool.metadata.ToolMetadata getToolMetadata()
      Specified by:
      getToolMetadata in interface org.springframework.ai.tool.ToolCallback
    • call

      public String call(String toolInput)
      Specified by:
      call in interface org.springframework.ai.tool.ToolCallback
    • call

      public String call(String toolInput, org.springframework.ai.chat.model.ToolContext toolContext)
      Specified by:
      call in interface org.springframework.ai.tool.ToolCallback
    • wrap

      public static org.springframework.ai.tool.ToolCallback[] wrap(org.springframework.ai.tool.ToolCallback[] callbacks, TurToolDescriptionService descriptionService)
      Wraps an array of callbacks, replacing descriptions where .md files exist.