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.
✨ feat: support new ai provider in client pglite (lobehub#5488)
* update to pglite mode * add service * 新增 DevPanel * 新增数据库预览 UI * Update useCategory.tsx * add postgres table viewer * improve table detail * fix * fix list * fix custom provider in client mode * fix build * fix tests * fix url * add test for service
- Loading branch information
Showing
48 changed files
with
1,682 additions
and
188 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
25 changes: 25 additions & 0 deletions
25
src/app/(main)/settings/provider/(detail)/[id]/ClientMode.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,25 @@ | ||
'use client'; | ||
|
||
import { memo } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
import useSWR from 'swr'; | ||
|
||
import { aiProviderService } from '@/services/aiProvider'; | ||
|
||
import ModelList from '../../features/ModelList'; | ||
import ProviderConfig from '../../features/ProviderConfig'; | ||
|
||
const ClientMode = memo<{ id: string }>(({ id }) => { | ||
const { data, isLoading } = useSWR('get-client-provider', () => | ||
aiProviderService.getAiProviderById(id), | ||
); | ||
|
||
return ( | ||
<Flexbox gap={24} paddingBlock={8}> | ||
{!isLoading && data && <ProviderConfig {...data} />} | ||
<ModelList id={id} /> | ||
</Flexbox> | ||
); | ||
}); | ||
|
||
export default ClientMode; |
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
Oops, something went wrong.