MCPcopy Create free account
hub / github.com/coder/aibridge / NewCopilot

Function NewCopilot

provider/copilot.go:56–73  ·  view source on GitHub ↗
(cfg config.Copilot)

Source from the content-addressed store, hash-verified

54var _ Provider = &Copilot{}
55
56func NewCopilot(cfg config.Copilot) *Copilot {
57 if cfg.Name == "" {
58 cfg.Name = config.ProviderCopilot
59 }
60 if cfg.BaseURL == "" {
61 cfg.BaseURL = copilotBaseURL
62 }
63 if cfg.APIDumpDir == "" {
64 cfg.APIDumpDir = os.Getenv("BRIDGE_DUMP_DIR")
65 }
66 if cfg.CircuitBreaker != nil {
67 cfg.CircuitBreaker.OpenErrorResponse = copilotOpenErrorResponse
68 }
69 return &Copilot{
70 cfg: cfg,
71 circuitBreaker: cfg.CircuitBreaker,
72 }
73}
74
75func (*Copilot) Type() string {
76 return config.ProviderCopilot

Callers 6

NewCopilotProviderFunction · 0.92
TestAPIDumpFunction · 0.92
TestAPIDumpPassthroughFunction · 0.92
TestCopilot_TypeAndNameFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestAPIDumpFunction · 0.74
TestAPIDumpPassthroughFunction · 0.74
TestCopilot_TypeAndNameFunction · 0.68