forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: fix ai model abilities issue (lobehub#6060)
- Loading branch information
Showing
7 changed files
with
111 additions
and
31 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
11 changes: 11 additions & 0 deletions
11
src/features/DevPanel/SystemInspector/AiProviderRuntimeConfig.tsx
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,11 @@ | ||
import { useAiInfraStore } from '@/store/aiInfra'; | ||
|
||
import JsonViewer from './JsonViewer'; | ||
|
||
const AiProviderRuntimeConfig = () => { | ||
const aiProviderRuntimeConfig = useAiInfraStore((s) => s.aiProviderRuntimeConfig); | ||
|
||
return <JsonViewer data={aiProviderRuntimeConfig} />; | ||
}; | ||
|
||
export default AiProviderRuntimeConfig; |
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,17 @@ | ||
import { Highlighter } from '@lobehub/ui'; | ||
import { memo } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
interface JsonViewerProps { | ||
data: object; | ||
} | ||
|
||
const JsonViewer = memo<JsonViewerProps>(({ data }) => { | ||
return ( | ||
<Flexbox style={{ overflow: 'scroll' }}> | ||
<Highlighter language={'json'}>{JSON.stringify(data, null, 2)}</Highlighter> | ||
</Flexbox> | ||
); | ||
}); | ||
|
||
export default JsonViewer; |
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,11 @@ | ||
import { useServerConfigStore } from '@/store/serverConfig'; | ||
|
||
import JsonViewer from './JsonViewer'; | ||
|
||
const ServerConfig = () => { | ||
const serverConfig = useServerConfigStore((s) => s.serverConfig); | ||
|
||
return <JsonViewer data={serverConfig} />; | ||
}; | ||
|
||
export default ServerConfig; |
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,42 @@ | ||
'use client'; | ||
|
||
import { TabsNav } from '@lobehub/ui'; | ||
import { useState } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
import AiProviderRuntimeConfig from './AiProviderRuntimeConfig'; | ||
import ServerConfig from './ServerConfig'; | ||
|
||
enum TabKey { | ||
AiProviderRuntimeConfig = 'aiProviderRuntimeConfig', | ||
ServerConfig = 'serverConfig', | ||
} | ||
|
||
const SystemInspector = () => { | ||
const [activeTab, setActiveTab] = useState<TabKey>(TabKey.ServerConfig); | ||
|
||
return ( | ||
<Flexbox gap={4} height={'100%'}> | ||
<TabsNav | ||
activeKey={activeTab} | ||
items={[ | ||
{ | ||
key: TabKey.ServerConfig, | ||
label: 'Server Config', | ||
}, | ||
{ | ||
key: TabKey.AiProviderRuntimeConfig, | ||
label: 'Ai Provider Runtime Config', | ||
}, | ||
]} | ||
onChange={(activeTab) => setActiveTab(activeTab as TabKey)} | ||
variant={'compact'} | ||
/> | ||
|
||
{activeTab === TabKey.ServerConfig && <ServerConfig />} | ||
{activeTab === TabKey.AiProviderRuntimeConfig && <AiProviderRuntimeConfig />} | ||
</Flexbox> | ||
); | ||
}; | ||
|
||
export default SystemInspector; |
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