Skip to content

Conversation

@hjwei0305
Copy link

Summary

This PR introduces a new DBGPT integration pipeline for OpenWebUI.

The pipeline enables OpenWebUI to use a self-hosted DBGPT service as an external
AI backend, with a focus on enterprise stability, text-to-SQL workflows,
and robust error handling.


Key Features

  • DBGPT integration

    • Supports DBGPT /api/v1/chat/completions endpoint
    • Designed for self-hosted / private deployments
  • Blocking-only execution model

    • Although DBGPT may stream internally, this pipeline always returns a finalized response
    • Prevents partial responses and shields frontend from backend exceptions
    • Proven to be more stable for demos and production environments
  • Output normalization

    • Cleans mixed DBGPT responses (text, <think>, internal JSON, <chart-view />)
    • Preserves chart-view output while ensuring clean natural-language responses
  • Exception shielding

    • Prevents backend parsing / SQL-generation errors from propagating to the OpenWebUI frontend
    • Ensures user-facing responses remain consistent even on backend failures

Why Blocking Instead of Streaming?

In real-world enterprise scenarios (especially text-to-SQL and BI use cases),
streaming responses can expose intermediate or malformed outputs that break
frontend rendering or user experience.

This pipeline intentionally adopts a blocking execution model to:

  • Improve reliability
  • Simplify frontend handling
  • Provide consistent, production-safe responses

Scope & Compatibility

  • Fully self-contained integration under pipelines/integrations/
  • Does not modify any existing pipelines or core logic
  • Follows existing pipeline structure (e.g. dify_pipeline.py)
  • Optional inlet / outlet hooks preserved for extensibility

Notes

This pipeline is intended as an integration example rather than a provider
replacement. Configuration values (API URL, app code, model name) can be adjusted
by users according to their DBGPT deployment.

Feedback and suggestions are very welcome!

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

Labels

None yet

1 participant