Create a C# console app called Worklines that allows user to create AI workflows using…
- User
Create a C# console app called Worklines that allows user to create AI workflows using natural language to Python. Similar to Google colab, but in a console environment and with base instructions being in natural language.
It will be a sequence of editable lines (similar to a program) with text. The code generated on each line is expandable with space.
Example program:
worklines~ plot the sine function, save the image to desktop as sine.png ~ create a 4x4 grid image of sine.png duplicated 4 times, one in each corner and save it as collage.png ~ open collage.png in the default programEach line can be selected (cycle through with arrows), which changes its background color to white and the text color to black. If there's a ~ before an instruction, it was not generated yet. To generate it, the user will press space while that line is selected. Generation: Call the AI.GetStream(string prompt, string conversationId, bool stream) function with: prompt set to instructions like: "Write a python program that represents a line in the program. Here is the full program in natural language: \n
worklines\n{full program}\n. You will ONLY write the code for the line \n\n{target_line}\n. Only respond with Python code in a python code block. conversationId set to a random guid stream set to trueThe AI.GetStream method returns an IAsyncEnumerable which is a stream of tokens from the AI. They should appear as they are streamed below that line in a box. Use ConsoleBox.Show(string text, int x, int y, int width, int height, int borderColor = 0xFFFFFF) to show the window under the line while maintaining all other functionality. When a line has been generated, it will prompt the user to accept or decline the generation. If they decline, put the line back to ~ mode. If they accept, put the line to + mode (collapsed). If they press space on it now, it will expand with the box visible again and put it in - mode.
If a line is selected and space is pressed, if it's in ~ mode, generate the line based on the text on it, if it's in + mode, expand it and put it in - mode, if it's in - mode, collapse it and put it in + mode.
Example of expanded lines:
worklines - Assistant