ianarawjo / ChainForge

An open-source visual programming environment for battle-testing prompts to LLMs.
https://chainforge.ai/docs
MIT License
2.2k stars 170 forks source link

Request: Possibility to define functions with template variables #286

Open izziaraffaele opened 3 months ago

izziaraffaele commented 3 months ago

I tried using {=functions} template variable but I couldn't figure out a way to pass the functions definitions as input. I tried with TextFields node and also with the Javascript processor node outputting a JSON.stringify payload

ianarawjo commented 3 months ago

Using braces in textfields can get tricky because they must be escaped. You should use a Tabular Data node if you have a lot of JSON you wish to use as input. We have a longstanding issue around being able to toggle off templates in textfields nodes and also to change to handlebars double-braces in Settings. No one has yet opened a PR for these issues, though.