feat: enchance prompt and code (#23633)
Co-authored-by: stream <stream@dify.ai> Co-authored-by: Stream <1542763342@qq.com> Co-authored-by: Stream <Stream_2@qq.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { get } from './base'
|
||||
import { get, post } from './base'
|
||||
import type { App } from '@/types/app'
|
||||
import type { AppListResponse } from '@/models/app'
|
||||
import { useInvalid } from './use-base'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import type { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
|
||||
|
||||
const NAME_SPACE = 'apps'
|
||||
|
||||
@@ -25,3 +26,16 @@ export const useAppDetail = (appID: string) => {
|
||||
queryFn: () => get<App>(`/apps/${appID}`),
|
||||
})
|
||||
}
|
||||
|
||||
export const useGenerateRuleTemplate = (type: GeneratorType, disabled?: boolean) => {
|
||||
return useQuery({
|
||||
queryKey: [NAME_SPACE, 'generate-rule-template', type],
|
||||
queryFn: () => post<{ data: string }>('instruction-generate/template', {
|
||||
body: {
|
||||
type,
|
||||
},
|
||||
}),
|
||||
enabled: !disabled,
|
||||
retry: 0,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user