Skip to main content

One doc tagged with "ai"

View all tags

Extensible AI Chat Structure

For an extensible chat application where users can choose different AI models (e.g., Gemini, OpenAI, and more in the future), a structured approach using Abstract Base Classes (ABCs) and the Factory Pattern is highly effective. This allows you to define a common interface for all AI providers and easily plug in new ones without modifying existing core logic.