• Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • Kiali
    • False
    • Hide

      None

      Show
      None
    • False

      Currently, the Kiali Chatbot UI is tightly coupled to the OpenAI API and its specific "Tools" (function calling) format. The tool definitions and execution logic are hardcoded for OpenAI's schema.

      This tight coupling prevents us from:

      1. Integrating other LLM providers (e.g., Anthropic, Google Gemini, Local LLMs).
      1. Adopting the Model Context Protocol (MCP) standard for external tool connectivity.
      1. Scalable addition of new Kiali-specific capabilities without modifying core chatbot logic.

      Objective

      The goal is to refactor the chatbot backend to introduce an abstraction layer (Adapter/Factory pattern) that standardizes how we define Tools and connect to Providers. This will allow the application to support OpenAI, Anthropic, and generic MCP servers interchangeably.

      Technical Implementation Plan

      1. Create a Provider Interface:
        • Define a generic LLMProvider interface (e.g., sendMessage, streamMessage).
        • Move the existing OpenAI logic into an OpenAIProvider implementation.
        • Ensure the interface supports passing tool definitions in a vendor-agnostic way.
      1. Standardize Tool Definitions (MCP Alignment):
        • Refactor the current tool definitions (which use OpenAI JSON Schema) to a standardized internal format or directly adopt the MCP (Model Context Protocol) schema.
        • Implement a translation layer that converts these standard tools into the specific format required by the active provider (e.g., converting MCP tools to OpenAI function calling format for the OpenAI provider).
      1. Refactor Tool Execution:
        • Decouple the tool execution logic from the HTTP response parsing of OpenAI.
        • Create a central ToolRegistry or ToolExecutor that handles the logic regardless of which LLM requested the execution.

       

              agutierr@redhat.com Alberto Jesus Gutierrez Juanes
              agutierr@redhat.com Alberto Jesus Gutierrez Juanes
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: