
Co-authored-by: AkaraChen <akarachen@outlook.com> Co-authored-by: Yi <yxiaoisme@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: kurokobo <kuro664@gmail.com> Co-authored-by: Hiroshi Fujita <fujita-h@users.noreply.github.com>
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`),
|
|
})
|
|
}
|