mirror of
https://github.com/ianarawjo/ChainForge.git
synced 2025-03-14 08:16:37 +00:00
Fix bug with template vars when generating prompt templates w genAI
This commit is contained in:
parent
965b96e451
commit
4a45bd6b75
@ -1,15 +1,15 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.15dfff17.css",
|
||||
"main.js": "/static/js/main.54f8a8b4.js",
|
||||
"main.js": "/static/js/main.283b8983.js",
|
||||
"static/js/787.4c72bb55.chunk.js": "/static/js/787.4c72bb55.chunk.js",
|
||||
"index.html": "/index.html",
|
||||
"main.15dfff17.css.map": "/static/css/main.15dfff17.css.map",
|
||||
"main.54f8a8b4.js.map": "/static/js/main.54f8a8b4.js.map",
|
||||
"main.283b8983.js.map": "/static/js/main.283b8983.js.map",
|
||||
"787.4c72bb55.chunk.js.map": "/static/js/787.4c72bb55.chunk.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.15dfff17.css",
|
||||
"static/js/main.54f8a8b4.js"
|
||||
"static/js/main.283b8983.js"
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><script async src="https://www.googletagmanager.com/gtag/js?id=G-RN3FDBLMCR"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-RN3FDBLMCR")</script><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="A visual programming environment for prompt engineering"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>ChainForge</title><script defer="defer" src="/static/js/main.54f8a8b4.js"></script><link href="/static/css/main.15dfff17.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><script async src="https://www.googletagmanager.com/gtag/js?id=G-RN3FDBLMCR"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-RN3FDBLMCR")</script><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="A visual programming environment for prompt engineering"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>ChainForge</title><script defer="defer" src="/static/js/main.283b8983.js"></script><link href="/static/css/main.15dfff17.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11
chainforge/react-server/src/TextFieldsNode.js
vendored
11
chainforge/react-server/src/TextFieldsNode.js
vendored
@ -145,7 +145,7 @@ const TextFieldsNode = ({ data, id }) => {
|
||||
setDataPropsForNode(id, new_data);
|
||||
pingOutputNodes(id);
|
||||
|
||||
}, [textfieldsValues, templateVars, updateTemplateVars, id]);
|
||||
}, [textfieldsValues, setTextfieldsValues, templateVars, updateTemplateVars, setTemplateVars, pingOutputNodes, setDataPropsForNode, id]);
|
||||
|
||||
// Dynamically update the textareas and position of the template hooks
|
||||
const ref = useRef(null);
|
||||
@ -214,7 +214,7 @@ const TextFieldsNode = ({ data, id }) => {
|
||||
}
|
||||
|
||||
// Replace the entirety of `textfieldValues` with `newFields`
|
||||
function replaceFields(fields) {
|
||||
const replaceFields = useCallback((fields) => {
|
||||
const buffer = {};
|
||||
for (const field of fields) {
|
||||
const uid = getUID(buffer);
|
||||
@ -222,10 +222,11 @@ const TextFieldsNode = ({ data, id }) => {
|
||||
}
|
||||
setTextfieldsValues(buffer);
|
||||
let new_data = updateTemplateVars({ 'fields': buffer });
|
||||
if (new_data.vars) setTemplateVars(new_data.vars);
|
||||
setDataPropsForNode(id, { fields: buffer });
|
||||
if (new_data.vars !== undefined)
|
||||
setTemplateVars(new_data.vars);
|
||||
setDataPropsForNode(id, new_data);
|
||||
pingOutputNodes(id);
|
||||
}
|
||||
}, [updateTemplateVars, setTextfieldsValues, getUID, setTemplateVars, setDataPropsForNode, pingOutputNodes, id]);
|
||||
|
||||
// Whether a placeholder is needed for the text field with id `i`.
|
||||
function placeholderNeeded(i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user