-
-
Notifications
You must be signed in to change notification settings - Fork 387
feat: recognize OrcaRouter as a named upstream gateway #1428
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
base: dev
Are you sure you want to change the base?
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 |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /** | ||
| * OrcaRouter 品牌图标。 | ||
| * | ||
| * @lobehub/icons 尚未收录 OrcaRouter,这里内嵌官网 /orca-logo-classic.png 的 | ||
| * 蓝鲸跳跃剪影(蓝色 #0157E0 + 白色腹纹与眼斑),保证离线可用且与云端价格表 | ||
| * providers 字典下发的图标口径一致。 | ||
| */ | ||
|
|
||
| const BODY_PATH = | ||
| "M24.1 3.27 23.35 3.23 22.51 4.2 21.95 5.47 21.24 6.1 20.09 6.39 18.47 6.5 17.09 7.13 16.37 7.82 18.0 8.26 20.58 9.43 22.8 10.49 23.13 11.71 23.02 12.21 23.46 12.89 23.79 13.75 23.32 14.7 22.14 15.49 20.92 15.86 20.21 15.67 20.05 15.17 19.96 14.67 19.09 14.51 17.74 14.58 15.19 13.92 12.48 12.62 9.11 11.19 6.56 10.4 4.78 10.06 3.84 10.04 3.31 10.37 3.0 11.38 3.13 13.11 3.99 15.8 5.68 18.63 6.61 21.12 6.47 23.06 5.31 24.69 4.69 26.06 4.59 26.96 5.25 27.39 6.46 27.42 8.31 26.86 10.16 25.65 12.05 24.86 13.88 24.68 15.91 25.81 18.24 27.11 20.81 28.34 23.05 28.77 24.6 28.62 25.2 28.12 24.47 26.9 24.44 25.36 25.26 23.18 27.42 20.85 28.73 18.05 29.0 15.3 28.44 12.77 27.23 10.6 25.38 8.81 24.19 7.5 23.74 6.41 24.23 5.45 24.39 4.11Z"; | ||
|
|
||
| const BELLY_PATH = | ||
| "M3.38 11.34 3.12 11.62 3.0 11.86 2.94 12.05 2.88 12.24 2.88 12.49 2.91 12.46 2.97 12.27 3.04 12.19 3.1 12.37 3.16 12.59 3.18 12.69 3.24 12.8 3.25 12.93 3.31 13.0 3.32 13.12 3.37 13.17 3.41 13.34 3.46 13.48 3.54 13.75 3.57 13.93 3.69 14.17 3.74 14.31 3.88 14.49 3.93 14.59 4.1 14.83 4.25 15.18 4.49 15.55 4.68 15.89 4.83 16.04 4.94 16.18 4.99 16.26 5.03 16.33 5.09 16.45 5.13 16.54 5.19 16.64 5.24 16.73 5.34 16.8 5.52 16.99 5.66 17.19 5.87 17.48 5.99 17.73 6.12 17.83 6.3 18.01 6.47 18.19 6.68 18.44 6.74 18.52 6.83 18.57 6.89 18.58 6.99 18.67 7.14 18.79 7.3 19.03 7.49 19.23 7.62 19.36 7.8 19.48 7.9 19.56 8.06 19.72 8.14 19.85 8.24 19.94 8.31 20.03 8.45 20.07 8.59 20.19 8.67 20.25 8.77 20.35 8.92 20.48 9.12 20.59 9.29 20.7 9.39 20.72 9.49 20.85 9.63 20.94 9.73 21.09 9.86 21.19 9.96 21.26 10.14 21.37 10.3 21.4 10.45 21.5 10.48 21.53 10.54 21.6 10.74 21.75 11.1 21.93 11.36 22.1 11.54 22.15 11.66 22.22 11.79 22.23 11.92 22.35 12.0 22.38 12.08 22.43 12.14 22.41 12.22 22.46 12.38 22.51 12.53 22.57 12.66 22.63 12.73 22.69 12.83 22.77 12.98 22.79 13.08 22.87 13.14 22.87 13.23 22.93 13.35 22.93 13.51 22.99 13.66 22.97 13.81 23.0 13.89 23.03 13.97 23.07 14.03 23.12 14.1 23.1 14.19 23.13 14.28 23.09 14.35 22.99 14.34 22.75 14.26 22.37 14.12 21.87 13.85 21.19 13.31 20.37 12.39 19.45 11.49 18.67 10.73 17.85 10.24 17.16 9.63 16.4 8.95 15.65 8.12 14.68 7.2 13.55 6.06 12.49 4.91 11.69 3.97 11.31Z"; | ||
|
|
||
| export function OrcaRouter({ className }: { className?: string }) { | ||
| return ( | ||
| <svg | ||
| viewBox="0 0 32 32" | ||
| className={className} | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| role="img" | ||
| fill="none" | ||
| > | ||
| <path fill="#0157E0" d={BODY_PATH} /> | ||
| <path fill="#FFFFFF" d={BELLY_PATH} /> | ||
|
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. The SVG declares Prompt To Fix With AIThis is a comment left during a code review.
Path: src/lib/model-vendor/orcarouter-icon.tsx
Line: 25
Comment:
**Name the OrcaRouter image**
The SVG declares `role="img"` without an accessible name, so screen readers encounter an unnamed graphic wherever the model-vendor or public-status registry renders it. Add an accessible name, or hide the SVG from assistive technology when it is purely decorative.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| <ellipse | ||
| cx="26.6" | ||
| cy="13.2" | ||
| rx="1.4" | ||
| ry="2" | ||
| transform="rotate(-18 26.6 13.2)" | ||
| fill="#FFFFFF" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,7 @@ const HOST_PREFIXES = new Set([ | |
| "fireworks", | ||
| "fireworks-ai", | ||
| "openrouter", | ||
| "orcarouter", | ||
|
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.
When a user configures OrcaRouter's documented Useful? React with 👍 / 👎. |
||
| "deepinfra", | ||
| "novita", | ||
| "novita-ai", | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,6 +34,12 @@ describe("deriveClientSafeUpstreamErrorMessage", () => { | |||||||||||||||||||||||
| providerName: "Anthropic", | ||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||
| ).toBeNull(); | ||||||||||||||||||||||||
| expect( | ||||||||||||||||||||||||
| deriveClientSafeUpstreamErrorMessage({ | ||||||||||||||||||||||||
| candidateMessage: "Provider OrcaRouter returned: overload", | ||||||||||||||||||||||||
| providerName: "OrcaRouter", | ||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||
| ).toBeNull(); | ||||||||||||||||||||||||
|
Comment on lines
+37
to
+42
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. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win 补充不依赖 当前测试传入 建议的测试调整 deriveClientSafeUpstreamErrorMessage({
candidateMessage: "Provider OrcaRouter returned: overload",
- providerName: "OrcaRouter",
})📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| expect( | ||||||||||||||||||||||||
| deriveClientSafeUpstreamErrorMessage({ | ||||||||||||||||||||||||
| candidateMessage: "FAKE_200_JSON_ERROR_NON_EMPTY", | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
为
role="img"提供可访问名称。Line 21 将 SVG 声明为
role="img",但组件没有aria-label、aria-labelledby或title。独立使用时,辅助技术只能看到无名称图像。如果图标始终与供应商文本一起显示,请设置
aria-hidden="true"并移除role="img"。否则,请增加可选的可访问名称属性,并由调用方传入已翻译的值。根据编码规范,
**/*.{ts,tsx}的所有用户可见字符串必须使用 i18n,支持zh-CN、zh-TW、en、ja、ru;不要在组件内硬编码可访问文本。🤖 Prompt for AI Agents
Source: Coding guidelines