mirror of
https://github.com/langgenius/dify.git
synced 2025-07-05 08:07:10 +00:00
18 lines
490 B
TypeScript
18 lines
490 B
TypeScript
![]() |
import { get } from './base'
|
||
|
import type {
|
||
|
ModelItem,
|
||
|
} from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||
|
import {
|
||
|
useQuery,
|
||
|
// useQueryClient,
|
||
|
} from '@tanstack/react-query'
|
||
|
|
||
|
const NAME_SPACE = 'models'
|
||
|
|
||
|
export const useModelProviderModelList = (provider: string) => {
|
||
|
return useQuery({
|
||
|
queryKey: [NAME_SPACE, 'model-list', provider],
|
||
|
queryFn: () => get<{ data: ModelItem[] }>(`/workspaces/current/model-providers/${provider}/models`),
|
||
|
})
|
||
|
}
|