Skip to content

Conversation

@asmirnov-tba
Copy link
Contributor

Overview

This PR adds a new Chat Completion module to the Teradata MCP Server that exposes the recently released OpenAI API Connectivity Functions as MCP tools and prompts.

The goal is to make it easy for AI assistants and MCP clients to call Teradata’s CompleteChat function and run large language models over Teradata data, whether those models are deployed on‑prem, in the cloud, or behind custom gateways.


What’s included

1. New chat_cmplt tool module

  • chat_cmplt_completeChat

    • Runs the Teradata CompleteChat function over a user‑provided SQL query that returns a txt column.
    • Typical use cases: sentiment analysis, classification, summarization, tagging.
  • chat_cmplt_aggregatedCompleteChat

    • Wraps CompleteChat and returns aggregated results: unique response_txt values with counts.
    • Typical use cases: “What are the main categories in this dataset?”, “How many rows fall into each label?”.

Both tools are driven by a simple YAML config (chat_cmplt_config.yml) where you specify:

  • LLM endpoint (base_url) and model (model)
  • Optional HTTP proxy and API key
  • Extra headers/body parameters
  • Basic rate‑limit behavior and output options
  • Target Teradata database (function_db) where CompleteChat is installed

If required values are missing, the module logs a clear configuration error and leaves the tools disabled rather than failing the server.

2. Chat Completion prompt(s)

  • chat_cmplt_ai_mapreduce
    • Guides the agent through:
      1. Building a Teradata SQL query to fetch relevant text.
      2. Running chat_cmplt_aggregatedCompleteChat.
      3. Producing a concise, high‑level summary from the aggregated results.

This gives users a “question → SQL → LLM distribution → summarized insight” flow without needing to hand‑craft prompts or SQL.

3. Wiring into the MCP server

  • Registers the new tools with the existing module loader and app startup.
  • Integrates them into the profile system so they can be enabled for specific user profiles (e.g. an llmUser profile focused on LLM workflows).

…tedCompleteChat

Prompt: chat_cmplt_ai_mapreduce
@remi-td remi-td changed the base branch from main to chat-completions December 10, 2025 10:30
@remi-td remi-td merged commit ab76312 into Teradata:chat-completions Dec 10, 2025
@remi-td
Copy link
Collaborator

remi-td commented Dec 10, 2025

thank you @asmirnov-tba !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants