Skip to content

Add SetBaseURL setter methods for proper encapsulation#7

Merged
SantiagoDePolonia merged 3 commits into
refactoring/basic-structurefrom
copilot/sub-pr-6
Dec 7, 2025
Merged

Add SetBaseURL setter methods for proper encapsulation#7
SantiagoDePolonia merged 3 commits into
refactoring/basic-structurefrom
copilot/sub-pr-6

Conversation

Copilot AI commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

The provider registration code directly accessed the private baseURL field, bypassing encapsulation:

// Before - direct field access in init()
p.baseURL = cfg.BaseURL

// After - setter method
p.SetBaseURL(cfg.BaseURL)

Changes:

  • Added SetBaseURL(url string) method to OpenAI, Anthropic, and Gemini providers
  • Updated init() registration functions to use setter instead of direct field access
  • Maintains consistent API boundaries across all provider implementations

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Note

Adds SetBaseURL to OpenAI, Anthropic, and Gemini providers and updates registration to use it; removes config/config.yaml.

  • Providers:
    • Add SetBaseURL(url string) to internal/providers/openai/openai.go, internal/providers/anthropic/anthropic.go, and internal/providers/gemini/gemini.go.
    • Update provider registration to call SetBaseURL(cfg.BaseURL) instead of assigning baseURL directly.
  • Config:
    • Remove config/config.yaml.

Written by Cursor Bugbot for commit 216bb24. This will update automatically on new commits. Configure here.

Copilot AI and others added 2 commits December 7, 2025 21:43
Co-authored-by: SantiagoDePolonia <16936376+SantiagoDePolonia@users.noreply.github.com>
Added SetBaseURL() setter method to all providers (OpenAI, Anthropic, Gemini)
to improve encapsulation instead of directly accessing private baseURL field.
This addresses the code review feedback on maintaining better API boundaries.

Co-authored-by: SantiagoDePolonia <16936376+SantiagoDePolonia@users.noreply.github.com>
Copilot AI changed the title [WIP] Update error standardization and refactor improvements Add SetBaseURL setter methods for proper encapsulation Dec 7, 2025
@SantiagoDePolonia SantiagoDePolonia marked this pull request as ready for review December 7, 2025 22:02
@SantiagoDePolonia SantiagoDePolonia merged commit a5168d3 into refactoring/basic-structure Dec 7, 2025
1 check passed
@SantiagoDePolonia SantiagoDePolonia deleted the copilot/sub-pr-6 branch December 13, 2025 12:43
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