Abstract OpenAI integration to support multiple AI providers #7
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Story
As a developer, I want the Cog’s AI-calling logic to depend on an abstract interface rather than directly on OpenAI, so that we can swap in other AI providers (Anthropic, Azure, local LLM, etc.) without touching the core code.
Description
Acceptance Criteria
An IAiService interface exists with methods for:
All direct openai.* calls are moved into OpenAiService : IAiService.
reginaldCog only interacts with IAiService and no longer imports openai.
Configuration allows switching providers without code changes.
A mock IAiService is available and used in unit tests to simulate responses.
Bot behavior remains unchanged when using OpenAiService.
Definition of Done