(value, inputParam)
| 493 | } |
| 494 | |
| 495 | const onEditJSONClicked = (value, inputParam) => { |
| 496 | // Preset values if the field is format prompt values |
| 497 | let inputValue = value |
| 498 | if (inputParam.name === 'promptValues' && !value) { |
| 499 | const templateValue = |
| 500 | (data.inputs['template'] ?? '') + |
| 501 | (data.inputs['systemMessagePrompt'] ?? '') + |
| 502 | (data.inputs['humanMessagePrompt'] ?? '') + |
| 503 | (data.inputs['workerPrompt'] ?? '') |
| 504 | inputValue = getJSONValue(templateValue) |
| 505 | } |
| 506 | const dialogProp = { |
| 507 | value: inputValue, |
| 508 | inputParam, |
| 509 | nodes: reactFlowInstance?.getNodes() || [], |
| 510 | edges: reactFlowInstance?.getEdges() || [], |
| 511 | nodeId: data.id, |
| 512 | data |
| 513 | } |
| 514 | setFormatPromptValuesDialogProps(dialogProp) |
| 515 | setShowFormatPromptValuesDialog(true) |
| 516 | } |
| 517 | |
| 518 | const onExpandDialogSave = (newValue, inputParamName) => { |
| 519 | data.inputs[inputParamName] = newValue |
no test coverage detected