Skip to content

Commit 98210df

Browse files
authored
fix: remove 'bifrost' from errors and update (#316)
1 parent 4d8f0f5 commit 98210df

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/google/jsonschema-go v0.4.2
1515
github.com/google/uuid v1.6.0
1616
github.com/hexops/autogold/v2 v2.3.0
17-
github.com/maximhq/bifrost/core v1.5.2
17+
github.com/maximhq/bifrost/core v1.5.12
1818
github.com/obot-platform/mcp-oauth-proxy v0.0.3-0.20260526141817-32b8278fcf00
1919
github.com/pkoukk/tiktoken-go v0.1.8
2020
github.com/robfig/cron/v3 v3.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHP
124124
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
125125
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
126126
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
127-
github.com/maximhq/bifrost/core v1.5.2 h1:4Si3+hkTMwg4WOW53rMUZN0xQcyyjViaHpq1ZxQS1fQ=
128-
github.com/maximhq/bifrost/core v1.5.2/go.mod h1:BAKGmgCnMdhZZ92UG9oCRuFJxasTfAtMeeF1pHc5AMQ=
127+
github.com/maximhq/bifrost/core v1.5.12 h1:tm4FVr9Vyy4Srr4Gg91kLrXFuZrMytGV6Rkrdpw3kXI=
128+
github.com/maximhq/bifrost/core v1.5.12/go.mod h1:bzcFxKjI2NCRtOeQOwA0KxKJkjsY/UgnXd/cmg7Q+4U=
129129
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
130130
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
131131
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=

pkg/llm/bifrost/client.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (c *Client) complete(ctx context.Context, agentName string, req *schemas.Bi
7070

7171
data, err := json.Marshal(req)
7272
if err != nil {
73-
return nil, fmt.Errorf("failed to marshal bifrost request: %w", err)
73+
return nil, fmt.Errorf("failed to marshal request: %w", err)
7474
}
7575
log.Messages(ctx, "bifrost-request", true, data)
7676

@@ -96,7 +96,7 @@ func (c *Client) complete(ctx context.Context, agentName string, req *schemas.Bi
9696

9797
if httpResp.StatusCode != http.StatusOK {
9898
body, _ := io.ReadAll(httpResp.Body)
99-
return nil, fmt.Errorf("bifrost request failed: %s %q", httpResp.Status, string(body))
99+
return nil, fmt.Errorf("request failed: %q", string(body))
100100
}
101101

102102
result, err := c.parseStream(ctx, agentName, httpResp.Body, opt.ProgressToken)
@@ -141,7 +141,7 @@ func (c *Client) parseStream(ctx context.Context, agentName string, body io.Read
141141

142142
var event schemas.BifrostResponsesStreamResponse
143143
if err := json.Unmarshal([]byte(body), &event); err != nil {
144-
slog.Error("bifrost: failed to decode stream event", "error", err, "body", body)
144+
slog.Error("failed to decode stream event", "error", err, "body", body)
145145
continue
146146
}
147147

@@ -252,9 +252,9 @@ func (c *Client) parseStream(ctx context.Context, agentName string, body io.Read
252252

253253
case schemas.ResponsesStreamResponseTypeFailed, schemas.ResponsesStreamResponseTypeIncomplete:
254254
if event.Response != nil && event.Response.Error != nil {
255-
return nil, fmt.Errorf("bifrost stream error: %s %s", event.Response.Error.Code, event.Response.Error.Message)
255+
return nil, fmt.Errorf("stream error: %s %s", event.Response.Error.Code, event.Response.Error.Message)
256256
}
257-
return nil, fmt.Errorf("bifrost stream ended with status: %s", event.Type)
257+
return nil, fmt.Errorf("stream ended with status: %s", event.Type)
258258
}
259259
}
260260

@@ -290,10 +290,10 @@ func (c *Client) parseStream(ctx context.Context, agentName string, body io.Read
290290

291291
return result, nil
292292
}
293-
return nil, fmt.Errorf("bifrost stream read error: %w", err)
293+
return nil, fmt.Errorf("stream read error: %w", err)
294294
}
295295
if !started {
296-
return nil, fmt.Errorf("bifrost stream ended without a completed response")
296+
return nil, fmt.Errorf("stream ended without a completed response")
297297
}
298298
return result, nil
299299
}

0 commit comments

Comments
 (0)