MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / getConfigExamplesForPython

Function getConfigExamplesForPython

packages/ui/src/utils/genericHelper.js:962–983  ·  view source on GitHub ↗
(configData, bodyType, isMultiple, stopNodeId)

Source from the content-addressed store, hash-verified

960}
961
962export const getConfigExamplesForPython = (configData, bodyType, isMultiple, stopNodeId) => {
963 let finalStr = ''
964 configData = unshiftFiles(configData)
965 const loop = Math.min(configData.length, 4)
966 for (let i = 0; i < loop; i += 1) {
967 const config = configData[i]
968 let exampleVal = `"example"`
969 if (config.type === 'string') exampleVal = `"example"`
970 else if (config.type === 'boolean') exampleVal = `true`
971 else if (config.type === 'number') exampleVal = `1`
972 else if (config.type === 'json') exampleVal = `{ "key": "val" }`
973 else if (config.name === 'files') continue
974 finalStr += bodyType === 'json' ? `\n "${config.name}": ${exampleVal},` : `\n "${config.name}": ${exampleVal},`
975 if (i === loop - 1 && bodyType !== 'json')
976 finalStr += !isMultiple
977 ? `\n`
978 : stopNodeId
979 ? `\n "stopNodeId": "${stopNodeId}"\n`
980 : `\n "question": "Hey, how are you?"\n`
981 }
982 return finalStr
983}
984
985export const getConfigExamplesForCurl = (configData, bodyType, isMultiple, stopNodeId) => {
986 let finalStr = ''

Callers 6

getConfigCodeFunction · 0.90
getCodeFunction · 0.90
getCodeWithFormDataFunction · 0.90

Calls 1

unshiftFilesFunction · 0.85

Tested by

no test coverage detected