langchain-ai / open-canvas

📃 A better UX for chat, writing content, and coding with LLMs.
https://opencanvas.langchain.com/
MIT License
1.75k stars 211 forks source link

Port the agent(s) to Python #39

Open bracesproul opened 6 days ago

bracesproul commented 6 days ago

It would be great if both agents were ported to Python and included in this repo.

siddicky commented 6 days ago

What would the project structure look like. Split it into frontend and backend (langgraph template) design?

bracesproul commented 6 days ago

@siddicky I'm thinking:

js-agent/
py-agent/
frontend/

With src/agent/ being moved into js-agent/

snifhex commented 4 days ago

Hey @bracesproul Is someone working on this? If not, I would like to try this

siddicky commented 4 days ago

@snifhex Which agent would you like to work on first? I created initial project structure and planned to make a PR over the weekend. Though haven't started actual port yet.

So far: Port Branch

snifhex commented 3 days ago

@siddicky I was planning to port reflection first.

snifhex commented 3 days ago

@bracesproul Do you think it will be good idea to do something like this

frontend/
agent/js
agent/py
agent/prompts.json

have prompts in some universal format which js or py can use like json or something or do we want to have them seperate and duplicate for pormpt content is okay??

bracesproul commented 3 days ago

@bracesproul Do you think it will be good idea to do something like this


frontend/

agent/js

agent/py

agent/prompts.json

have prompts in some universal format which js or py can use like json or something or do we want to have them seperate and duplicate for pormpt content is okay??

@snifhex yeah i like that structure. Only thing id change is I would put the prompts into individual .txt files inside a prompts/ dir (nested inside agent/)

This way we don't need to deal with any sort of quote escaping or new lines etc that a json file would require us to deal with.

snifhex commented 3 days ago

@bracesproul Yeah that sounds good.

So final structure would look something like this:

frontend/
agent/js
agent/py
agent/prompts/open-canvas.txt
agent/prompts/reflection.txt
bracesproul commented 3 days ago

@bracesproul Yeah that sounds good.

So final structure would look something like this:


frontend/

agent/js

agent/py

agent/prompts/open-canvas.txt

agent/prompts/reflection.txt

Yeah exactly. But note there's like 10 diff prompts inside open canvas so maybe even have the structure be:

agent/prompts/open-canvas/...

agent/prompts/reflection/...

(Reflection only has a single prompt but will def have more in the future)