mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
feat: mermory size config
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { useCallback, useState } from 'react'
|
||||
import produce from 'immer'
|
||||
import type { ValueSelector } from '../../types'
|
||||
import type { Memory, ValueSelector } from '../../types'
|
||||
import type { QuestionClassifierNodeType } from './types'
|
||||
|
||||
const useConfig = (initInputs: QuestionClassifierNodeType) => {
|
||||
@ -44,6 +44,13 @@ const useConfig = (initInputs: QuestionClassifierNodeType) => {
|
||||
setInputs(newInputs)
|
||||
}, [inputs, setInputs])
|
||||
|
||||
const handleMemoryChange = useCallback((memory: Memory) => {
|
||||
const newInputs = produce(inputs, (draft) => {
|
||||
draft.memory = memory
|
||||
})
|
||||
setInputs(newInputs)
|
||||
}, [inputs, setInputs])
|
||||
|
||||
return {
|
||||
inputs,
|
||||
handleModelChanged,
|
||||
@ -51,6 +58,7 @@ const useConfig = (initInputs: QuestionClassifierNodeType) => {
|
||||
handleQueryVarChange,
|
||||
handleTopicsChange,
|
||||
handleInstructionChange,
|
||||
handleMemoryChange,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user