forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
149 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
ModelSelect: { | ||
featureTag: { | ||
custom: '自定义模型,默认设定同时支持函数调用与视觉识别,请根据实际情况验证上述能力的可用性', | ||
file: '该模型支持上传文件读取与识别', | ||
functionCall: '该模型支持函数调用(Function Call)', | ||
tokens: '该模型单个会话最多支持 {{tokens}} Tokens', | ||
vision: '该模型支持视觉识别', | ||
}, | ||
}, | ||
ModelSwitchPanel: { | ||
emptyModel: '没有启用的模型,请前往设置开启', | ||
provider: '提供商', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/store/global/slices/settings/selectors/modelConfig.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { describe, expect, it } from 'vitest'; | ||
|
||
import { DEFAULT_SETTINGS } from '@/const/settings'; | ||
import { modelProviderSelectors } from '@/store/global/slices/settings/selectors/modelProvider'; | ||
import { agentSelectors } from '@/store/session/slices/agent'; | ||
import { merge } from '@/utils/merge'; | ||
|
||
import { GlobalStore, useGlobalStore } from '../../../store'; | ||
import { GlobalSettingsState, initialSettingsState } from '../initialState'; | ||
import { modelConfigSelectors } from './modelConfig'; | ||
|
||
describe('modelConfigSelectors', () => { | ||
describe('modelSelectList', () => { | ||
it('visible', () => { | ||
const s = merge(initialSettingsState, { | ||
settings: { | ||
languageModel: { | ||
ollama: { | ||
models: ['llava'], | ||
}, | ||
}, | ||
}, | ||
} as GlobalSettingsState) as unknown as GlobalStore; | ||
|
||
const ollamaList = modelConfigSelectors.modelSelectList(s).find((r) => r.id === 'ollama'); | ||
|
||
expect(ollamaList?.chatModels).toEqual([]); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters