Skip to content

Commit db0f11e

Browse files
committed
feat: allow dumping via env var
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 4f777db commit db0f11e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

provider/anthropic.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ func NewAnthropic(cfg config.Anthropic, bedrockCfg *config.AWSBedrock) *Anthropi
4646
if cfg.Key == "" {
4747
cfg.Key = os.Getenv("ANTHROPIC_API_KEY")
4848
}
49+
if cfg.APIDumpDir == "" {
50+
cfg.APIDumpDir = os.Getenv("BRIDGE_DUMP_DIR")
51+
}
4952
if cfg.CircuitBreaker != nil {
5053
cfg.CircuitBreaker.IsFailure = anthropicIsFailure
5154
cfg.CircuitBreaker.OpenErrorResponse = anthropicOpenErrorResponse

provider/openai.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ func NewOpenAI(cfg config.OpenAI) *OpenAI {
3838
if cfg.BaseURL == "" {
3939
cfg.BaseURL = "https://api.openai.com/v1/"
4040
}
41-
4241
if cfg.Key == "" {
4342
cfg.Key = os.Getenv("OPENAI_API_KEY")
4443
}
44+
if cfg.APIDumpDir == "" {
45+
cfg.APIDumpDir = os.Getenv("BRIDGE_DUMP_DIR")
46+
}
4547

4648
if cfg.CircuitBreaker != nil {
4749
cfg.CircuitBreaker.OpenErrorResponse = openAIOpenErrorResponse

0 commit comments

Comments
 (0)