add format prompt values to prompt template

This commit is contained in:
Henry
2023-04-18 23:27:05 +01:00
parent cd8a5b96eb
commit 17207e01db
13 changed files with 675 additions and 599 deletions
@@ -43,9 +43,13 @@ export const ReactFlowContext = ({ children }) => {
if (node.id === targetNodeId) {
let value
const inputAnchor = node.data.inputAnchors.find((ancr) => ancr.name === targetInput)
const inputParam = node.data.inputParams.find((param) => param.name === targetInput)
if (inputAnchor && inputAnchor.list) {
const values = node.data.inputs[targetInput] || []
value = values.filter((item) => !item.includes(sourceNodeId))
} else if (inputParam && inputParam.acceptVariable) {
value = node.data.inputs[targetInput].replace(`{{${sourceNodeId}.data.instance}}`, '') || ''
} else {
value = ''
}
@@ -36,6 +36,11 @@ export const Input = ({ inputParam, value, onChange, disabled = false, showDialo
setMyValue(e.target.value)
onChange(e.target.value)
}}
inputProps={{
style: {
height: inputParam.rows ? '90px' : 'inherit'
}
}}
/>
</FormControl>
<EditPromptValuesDialog