mrseanryan / gpt-workflow

Generate workflows (for flowcharts or low code) via LLM. Also describe workflow given in DOT.
MIT License
15 stars 0 forks source link

Add C# parser for the DOT output #3

Closed mrseanryan closed 1 year ago

mrseanryan commented 1 year ago

parsers/csharp-dot-parser

DOT AST Library: https://abock.github.io/dotlang/

.

mrseanryan commented 1 year ago

Algorithm:

  1. client implements an interface IDotModelVisitor (give a default implementation that just dumps to console)
  2. gpt-workflow-csharp: parse the DOT into an AST
  3. for all nodes in the AST, call visitor.VisitNode(node)
  4. for all edges in the AST, call visitor.VisitEdge(edge)

This way, the client can generate another output OR populate some other system to match the DOT graph.

node has a NodeType that matches the prompts whitelist:

mrseanryan commented 1 year ago

does look like Visitor pattern

IDotModelVisitor

VisitNode VisitEdge

mrseanryan commented 1 year ago

done