@ -10,11 +10,13 @@ import { AppType } from '@/types/app'
import type { AutomaticRes } from '@/service/debug'
import type { AutomaticRes } from '@/service/debug'
import type { ModelConfig , Node , NodeOutPutVar } from '@/app/components/workflow/types'
import type { ModelConfig , Node , NodeOutPutVar } from '@/app/components/workflow/types'
import { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
import { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
import { useHooksStore } from '../../../hooks-store'
type Props = {
type Props = {
className? : string
className? : string
onGenerated ? : ( prompt : string ) = > void
onGenerated ? : ( prompt : string ) = > void
modelConfig? : ModelConfig
modelConfig? : ModelConfig
nodeId : string
nodesOutputVars? : NodeOutPutVar [ ]
nodesOutputVars? : NodeOutPutVar [ ]
availableNodes? : Node [ ]
availableNodes? : Node [ ]
}
}
@ -22,6 +24,7 @@ type Props = {
const PromptGeneratorBtn : FC < Props > = ( {
const PromptGeneratorBtn : FC < Props > = ( {
className ,
className ,
onGenerated ,
onGenerated ,
nodeId ,
nodesOutputVars ,
nodesOutputVars ,
availableNodes ,
availableNodes ,
} ) = > {
} ) = > {
@ -30,6 +33,7 @@ const PromptGeneratorBtn: FC<Props> = ({
onGenerated ? . ( res . prompt )
onGenerated ? . ( res . prompt )
showAutomaticFalse ( )
showAutomaticFalse ( )
} , [ onGenerated , showAutomaticFalse ] )
} , [ onGenerated , showAutomaticFalse ] )
const configsMap = useHooksStore ( s = > s . configsMap )
return (
return (
< div className = { cn ( className ) } >
< div className = { cn ( className ) } >
< ActionButton
< ActionButton
@ -46,6 +50,8 @@ const PromptGeneratorBtn: FC<Props> = ({
generatorType = { GeneratorType . prompt }
generatorType = { GeneratorType . prompt }
nodesOutputVars = { nodesOutputVars }
nodesOutputVars = { nodesOutputVars }
availableNodes = { availableNodes }
availableNodes = { availableNodes }
flowId = { configsMap ? . flowId || '' }
nodeId = { nodeId }
/ >
/ >
) }
) }
< / div >
< / div >