Skip to content

Add ClaudeProvider implementing Provider interface via anthropic-sdk-go#8

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-claude-provider-implementation
Draft

Add ClaudeProvider implementing Provider interface via anthropic-sdk-go#8
Copilot wants to merge 3 commits intomainfrom
copilot/add-claude-provider-implementation

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 9, 2026

Adds ClaudeProvider to the providers package using github.com/anthropics/anthropic-sdk-go, implementing the same Provider interface as GoogleProvider.

New: ClaudeProvider

  • Name()"claude"
  • ChatCompletion() — maps to client.Messages.New() with model, content, system instruction, and temperature
  • SubmitBatchJob() — maps to client.Messages.Batches.New(); assigns sequential CustomIDs to batch requests; uses configurable MaxTokens (default 8192)
  • GetBatchJobStatus() — polls client.Messages.Batches.Get(); on ended status, streams results via ResultsStreaming(), aggregates input/output token counts, and JSON-serializes []MessageBatchIndividualResponse into ResultsJSON

Config

Added ClaudeConfig{APIKey, MaxTokens} to ProvidersConfig and config/default.yaml:

providers:
  claude:
    api_key: your-claude-api-key
    max_tokens: 8192

Constructor

provider, err := providers.NewClaude(cfg.Providers.Claude)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • platform.claude.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Please create ClaudeProvider in package #file:providers and implement interface Provider. We can use package github.com/anthropics/anthropic-sdk-go.

We can use GoogleProvider as code reference.

Also, for claude we can use references from website https://platform.claude.com/docs/en/api/sdks/go

For now, we can skip unittest

The user has attached the following files from their workspace:

  • internal/aigateway/providers/providers.go
  • internal/aigateway/providers

Copilot AI and others added 2 commits April 9, 2026 17:09
Agent-Logs-Url: https://github.com/ideagate/aigateway-core/sessions/a30c09e2-bd5a-4f35-8cd4-7bc80bdbe662

Co-authored-by: bayu-aditya <42117155+bayu-aditya@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ClaudeProvider implementation in providers package Add ClaudeProvider implementing Provider interface via anthropic-sdk-go Apr 9, 2026
Copilot AI requested a review from bayu-aditya April 9, 2026 17:17
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