-
Notifications
You must be signed in to change notification settings - Fork 297
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
base: main
Are you sure you want to change the base?
Worker build #3157
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { openAIProvider } from "./openai"; | |
import { anthropicProvider } from "./anthropic"; | ||
import { costs as awsBedrockCosts } from "./awsBedrock"; | ||
import { costs as deepseekCosts } from "./deepseek"; | ||
import { costs as xCosts } from "./x"; | ||
|
||
const openAiPattern = /^https:\/\/api\.openai\.com/; | ||
const anthropicPattern = /^https:\/\/api\.anthropic\.com/; | ||
|
@@ -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/; | ||
|
||
export const providersNames = [ | ||
"OPENAI", | ||
|
@@ -78,6 +81,7 @@ export const providersNames = [ | |
"FIRECRAWL", | ||
"AWS", | ||
"DEEPSEEK", | ||
"X", | ||
] as const; | ||
|
||
export type ProviderName = (typeof providersNames)[number]; | ||
|
@@ -127,6 +131,11 @@ export const providers: { | |
pattern: cloudflareAiGatewayPattern, | ||
provider: "CLOUDFLARE", | ||
}, | ||
{ | ||
pattern: x, | ||
provider: "X", | ||
costs: xCosts, | ||
}, | ||
Comment on lines
+134
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
{ | ||
pattern: twoYFV, | ||
provider: "2YFV", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { openAIProvider } from "./openai"; | |
import { anthropicProvider } from "./anthropic"; | ||
import { costs as awsBedrockCosts } from "./awsBedrock"; | ||
import { costs as deepseekCosts } from "./deepseek"; | ||
import { costs as xCosts } from "./x"; | ||
|
||
const openAiPattern = /^https:\/\/api\.openai\.com/; | ||
const anthropicPattern = /^https:\/\/api\.anthropic\.com/; | ||
|
@@ -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/; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
export const providersNames = [ | ||
"OPENAI", | ||
|
@@ -78,6 +81,7 @@ export const providersNames = [ | |
"FIRECRAWL", | ||
"AWS", | ||
"DEEPSEEK", | ||
"X", | ||
] as const; | ||
|
||
export type ProviderName = (typeof providersNames)[number]; | ||
|
@@ -127,6 +131,11 @@ export const providers: { | |
pattern: cloudflareAiGatewayPattern, | ||
provider: "CLOUDFLARE", | ||
}, | ||
{ | ||
pattern: x, | ||
provider: "X", | ||
costs: xCosts, | ||
}, | ||
Comment on lines
+134
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
{ | ||
pattern: twoYFV, | ||
provider: "2YFV", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1180,7 +1180,8 @@ | |
"QSTASH", | ||
"FIRECRAWL", | ||
"AWS", | ||
"DEEPSEEK" | ||
"DEEPSEEK", | ||
"X" | ||
] | ||
}, | ||
"Provider": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { openAIProvider } from "./openai"; | |
import { anthropicProvider } from "./anthropic"; | ||
import { costs as awsBedrockCosts } from "./awsBedrock"; | ||
import { costs as deepseekCosts } from "./deepseek"; | ||
import { costs as xCosts } from "./x"; | ||
|
||
const openAiPattern = /^https:\/\/api\.openai\.com/; | ||
const anthropicPattern = /^https:\/\/api\.anthropic\.com/; | ||
|
@@ -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/; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
export const providersNames = [ | ||
"OPENAI", | ||
|
@@ -78,6 +81,7 @@ export const providersNames = [ | |
"FIRECRAWL", | ||
"AWS", | ||
"DEEPSEEK", | ||
"X", | ||
] as const; | ||
|
||
export type ProviderName = (typeof providersNames)[number]; | ||
|
@@ -127,6 +131,11 @@ export const providers: { | |
pattern: cloudflareAiGatewayPattern, | ||
provider: "CLOUDFLARE", | ||
}, | ||
{ | ||
pattern: x, | ||
provider: "X", | ||
costs: xCosts, | ||
}, | ||
Comment on lines
+134
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
{ | ||
pattern: twoYFV, | ||
provider: "2YFV", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { openAIProvider } from "./openai"; | |
import { anthropicProvider } from "./anthropic"; | ||
import { costs as awsBedrockCosts } from "./awsBedrock"; | ||
import { costs as deepseekCosts } from "./deepseek"; | ||
import { costs as xCosts } from "./x"; | ||
|
||
const openAiPattern = /^https:\/\/api\.openai\.com/; | ||
const anthropicPattern = /^https:\/\/api\.anthropic\.com/; | ||
|
@@ -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/; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
export const providersNames = [ | ||
"OPENAI", | ||
|
@@ -78,6 +81,7 @@ export const providersNames = [ | |
"FIRECRAWL", | ||
"AWS", | ||
"DEEPSEEK", | ||
"X", | ||
] as const; | ||
|
||
export type ProviderName = (typeof providersNames)[number]; | ||
|
@@ -127,6 +131,11 @@ export const providers: { | |
pattern: cloudflareAiGatewayPattern, | ||
provider: "CLOUDFLARE", | ||
}, | ||
{ | ||
pattern: x, | ||
provider: "X", | ||
costs: xCosts, | ||
}, | ||
Comment on lines
+134
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
{ | ||
pattern: twoYFV, | ||
provider: "2YFV", | ||
|
There was a problem hiding this comment.
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