Proposal: Yaml-based abstraction of business logic, excluding node internals and formatting/layout #202
Replies: 2 comments 6 replies
-
I completely agree with you. Your suggestions are valid and we have thought about some of them before. To me, the approach we should take: don't save the layout info and have a simple logic to auto-layout (I think react-flow has that functionality) when loading them back. Regarding YAML, It would be possible to translate the JSON into YAML but that would require a stable API for the templates which we are constantly adapting as we see more functions being implemented and we define better patterns. The YAML could be something like: Nodes:
node_id1
- LLMChain:
- llm: OpenAI
- prompt: PromptTemplate
node_id2
- OpenAI:
- model_name: text-davinci-003
etc. But then we'd still have to save the graph info (nodes and edges) somewhere which would be kind of weird. We can brainstorm a bit more, I think. Thanks for bringing this up. |
Beta Was this translation helpful? Give feedback.
-
Just as a bookmark for later discussion, but not necessary in a first iteration:
|
Beta Was this translation helpful? Give feedback.
-
I'd like to be able to commit the output of
langflow
to a repo in a human-readable fashion. And I'd like to then be able to modify the yamlThe export to json today essentially has a superset of what we'd want to manage in git.
Some cosmetic info, such as node x and y locations may be lost in the translation. I can think of three options for how to deal with cosmetic layout info:
In all of these options, if there is some missing node layout info, like missing x and y coords, then the library may put them in an awkward location, or else do its best to position them logically in a decent position relative to the nodes it connects to.
While it would be a significant amount of effort to decouple the business logic from the node/graph layout info, this extends the core value proposition of LangFlow being an accessible means of authoring workflows, and extends that value-prop to also have copy-pasteable and having the ability for users to yaml accessibility.
Beta Was this translation helpful? Give feedback.
All reactions