Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker build #3157

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Worker build #3157

wants to merge 2 commits into from

Conversation

chitalian
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
helicone 🛑 Canceled (Inspect) Jan 22, 2025 11:04pm
helicone-bifrost 🛑 Canceled (Inspect) Jan 22, 2025 11:04pm
helicone-eu 🛑 Canceled (Inspect) Jan 22, 2025 11:04pm

@vercel vercel bot temporarily deployed to Preview – helicone January 22, 2025 23:04 Inactive
@vercel vercel bot temporarily deployed to Preview – helicone-bifrost January 22, 2025 23:04 Inactive
@vercel vercel bot temporarily deployed to Preview – helicone-eu January 22, 2025 23:04 Inactive
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added support for X.ai (formerly Twitter) provider across multiple files, integrating cost tracking and API handling capabilities.

  • Added X.ai provider configuration in /bifrost/packages/cost/providers/mappings.ts with regex pattern ^https:\/\/api\.x\.ai/ and associated costs
  • Added four new X.ai models (grok-beta, grok-vision-beta, grok-2-1212, grok-2-vision-1212) with pricing in cost calculations
  • Updated database queries in /worker/src/lib/RequestWrapper.ts to use boolean false instead of string "false" for soft_delete field
  • Extended API specification in swagger.json and routes.ts to include X provider in ProviderName enum

8 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -52,6 +53,8 @@ const firecrawl = /^https:\/\/api\.firecrawl\.dev/;
const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/;
// https://api.deepseek.com
const deepseek = /^https:\/\/api\.deepseek\.com/;
// https://api.x.ai
const x = /^https:\/\/api\.x\.ai/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: regex pattern for x.ai should include optional 'api.' subdomain for consistency with other patterns like openRouter

@@ -52,6 +53,8 @@ const firecrawl = /^https:\/\/api\.firecrawl\.dev/;
const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/;
// https://api.deepseek.com
const deepseek = /^https:\/\/api\.deepseek\.com/;
// https://api.x.ai
const x = /^https:\/\/api\.x\.ai/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: regex pattern for x.ai should include optional 'api.' prefix for consistency with openRouter pattern

Comment on lines +134 to +138
{
pattern: x,
provider: "X",
costs: xCosts,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: X provider configuration should be placed after AWS and before DEEPSEEK to maintain alphabetical ordering with other providers

Comment on lines +134 to +138
{
pattern: x,
provider: "X",
costs: xCosts,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: X provider entry should be placed at the end of the providers array to maintain alphabetical ordering with other providers

@@ -52,6 +53,8 @@ const firecrawl = /^https:\/\/api\.firecrawl\.dev/;
const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/;
// https://api.deepseek.com
const deepseek = /^https:\/\/api\.deepseek\.com/;
// https://api.x.ai
const x = /^https:\/\/api\.x\.ai/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: regex pattern should include optional 'api.' prefix for consistency with other patterns like openRouter

Comment on lines +134 to +138
{
pattern: x,
provider: "X",
costs: xCosts,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: X provider entry should be placed at the end of the providers array for consistency with providersNames order

@@ -52,6 +53,8 @@ const firecrawl = /^https:\/\/api\.firecrawl\.dev/;
const awsBedrock = /^https:\/\/bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com\/.*/;
// https://api.deepseek.com
const deepseek = /^https:\/\/api\.deepseek\.com/;
// https://api.x.ai
const x = /^https:\/\/api\.x\.ai/;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: URL pattern regex should include end-of-string anchor ($) to prevent partial matches

Comment on lines +134 to +138
{
pattern: x,
provider: "X",
costs: xCosts,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: X provider configuration should include modelDetails property for consistency with other major providers like OpenAI and Anthropic

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.

1 participant