Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
bit-pm
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
燕伟桐
bit-pm
Commits
67dc9f4c
Unverified
提交
67dc9f4c
authored
6月 13, 2025
作者:
Will Chen
提交者:
GitHub
6月 13, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Print engine/gateway URL more clearly (#396)
上级
99e6592a
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
5 行删除
+16
-5
test_helper.ts
e2e-tests/helpers/test_helper.ts
+1
-1
get_model_client.ts
src/ipc/utils/get_model_client.ts
+15
-4
没有找到文件。
e2e-tests/helpers/test_helper.ts
浏览文件 @
67dc9f4c
...
...
@@ -687,7 +687,7 @@ export const test = base.extend<{
process
.
env
.
OLLAMA_HOST
=
"http://localhost:3500/ollama"
;
process
.
env
.
LM_STUDIO_BASE_URL_FOR_TESTING
=
"http://localhost:3500/lmstudio"
;
process
.
env
.
DYAD_
LOCAL_ENGINE
=
"http://localhost:3500/engine/v1"
;
process
.
env
.
DYAD_
ENGINE_URL
=
"http://localhost:3500/engine/v1"
;
process
.
env
.
DYAD_GATEWAY_URL
=
"http://localhost:3500/gateway/v1"
;
process
.
env
.
E2E_TEST_BUILD
=
"true"
;
// This is just a hack to avoid the AI setup screen.
...
...
src/ipc/utils/get_model_client.ts
浏览文件 @
67dc9f4c
...
...
@@ -14,7 +14,7 @@ import { createDyadEngine } from "./llm_engine_provider";
import
{
findLanguageModel
}
from
"./findLanguageModel"
;
import
{
LM_STUDIO_BASE_URL
}
from
"./lm_studio_utils"
;
const
dyad
LocalEngine
=
process
.
env
.
DYAD_LOCAL_ENGINE
;
const
dyad
EngineUrl
=
process
.
env
.
DYAD_ENGINE_URL
;
const
dyadGatewayUrl
=
process
.
env
.
DYAD_GATEWAY_URL
;
const
AUTO_MODELS
=
[
...
...
@@ -101,7 +101,7 @@ export async function getModelClient(
// we're using local engine.
// IMPORTANT: some providers like OpenAI have an empty string gateway prefix,
// so we do a nullish and not a truthy check here.
if
(
providerConfig
.
gatewayPrefix
!=
null
||
dyad
LocalEngine
)
{
if
(
providerConfig
.
gatewayPrefix
!=
null
||
dyad
EngineUrl
)
{
const
languageModel
=
await
findLanguageModel
(
model
);
const
engineProMode
=
settings
.
enableProSmartFilesContextMode
||
...
...
@@ -115,7 +115,7 @@ export async function getModelClient(
const
provider
=
isEngineEnabled
?
createDyadEngine
({
apiKey
:
dyadApiKey
,
baseURL
:
dyad
LocalEngine
??
"https://engine.dyad.sh/v1"
,
baseURL
:
dyad
EngineUrl
??
"https://engine.dyad.sh/v1"
,
dyadOptions
:
{
enableLazyEdits
:
settings
.
enableProLazyEditsMode
,
enableSmartFilesContext
:
settings
.
enableProSmartFilesContextMode
,
...
...
@@ -127,7 +127,18 @@ export async function getModelClient(
baseURL
:
dyadGatewayUrl
??
"https://llm-gateway.dyad.sh/v1"
,
});
logger
.
info
(
`Using Dyad Pro API key. engine_enabled=
${
isEngineEnabled
}
`
);
logger
.
info
(
`\x1b[1;97;44m Using Dyad Pro API key for model:
${
model
.
name
}
. engine_enabled=
${
isEngineEnabled
}
\x1b[0m`
,
);
if
(
isEngineEnabled
)
{
logger
.
info
(
`\x1b[1;30;42m Using Dyad Pro engine:
${
dyadEngineUrl
??
"<prod>"
}
\
x1b
[
0
m
`,
);
} else {
logger.info(
`
\
x1b
[
1
;
30
;
43
m
Using
Dyad
Pro
gateway
:
$
{
dyadGatewayUrl
??
"<prod>"
}
\
x1b
[
0
m
`,
);
}
// Do not use free variant (for openrouter).
const modelName = model.name.split(":free")[0];
const autoModelClient = {
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论