ianarawjo / ChainForge

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

Feature request: incorporate something like typechat to have nodes that transform data in typed ways #173

Open jonborchardt opened 7 months ago

jonborchardt commented 7 months ago

Currently we need to add prompts like...

return a comma separated list of each of the questions here: {q}
Be sure what you return is a comma separated list.  Don't have quotes around the list.

This is hard to do, easy to mess up, and scattered across my chain...

i am suggesting you do something like add a set of predefined (but editable) nodes that transform llm responses into lists, bools, sentiment, etc...

one such wa of doing this would be to use a lib like typechat https://github.com/microsoft/TypeChat which really just adds consistent gunk to the context the ensure a consistent output form an llm

ianarawjo commented 7 months ago

Hmm, while I agree it would be nice, this is something the community would have to prioritize. I suggest someone in the community create a new node like ‘Structured Prompt Node” and submit a PR. The only way I would work on this directly is if a lot more people thumbs up this issue.

The drawback of TypeChat is that it seems to require that one uses its way of querying models —I couldn’t see a plug n play for model responses, it rather wants to wrap model querying. ChainForge’s model querying is rather complicated by necessity and doesn’t look like it can be easily plugged in here.