langflow
langflow copied to clipboard
Documentation: Add simple "getting started" examples
It would be great if the documentation included a few minimal working examples to get started with.
For example, it wasn't intuitive to me how to recreate something similar to the ChatGPT web interface.
You can use a ConversationChain, but you won't be able to customize the prompt or use tools it seems.
With LLMChain, I've almost managed to do a simple ChatGPT-style bot. You have to add a ConversationBufferMemory, and the following PromptTemplate:
The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.
Current conversation:
{history}
Human: {text}
AI:
This has a few flaws: you still cannot use tools, and does fairly often dream up the rest of the conversation:
but it might be a good starting point.
@notpushkin Thanks for the hint. This seems to behave like ChatGPT:
I think something like this should be included as a "Hello World" example in the documentation.
This is definitely something we are lacking at the moment. We improved a lot of the code and added many simpler options to experiment with so now might be a good time for us to add these examples.
@notpushkin the ConversationChain is essentially a LLMChain with a preconfigured prompt.
We are looking into improving the prompt experience(mainly by adding more control to input_variables and such).
In the case of the ConversationChain some improvements could be made. Keep an eye on #146.
Tangential: I was able to get tools working if I drop conversation memory:
langflow-tools-without-memory.json
Bad news: when I add any kind of memory to the mix, I get the following error:
Error: One input key expected got ['input', 'agent_scratchpad']
My best guess is, memory.save_context gets both input and agent_scratchpad and doesn't know which one of these it should save as the user message. Is there a way to get it working? (perhaps this could be a good cue for me to start a separate issue haha)
I hope that a template market can be realized, and everyone can contribute to the directory, just like the marketplaces of https://github.com/FlowiseAI/Flowise
I think a simple method to add tutorials would just create an examples folder. Then export some working code.
@frankjoshua I think that's what's going on in https://github.com/logspace-ai/langflow_examples? (e. g. see PR directly above your comment)
I think this examples repo needs some more visibility though.
We plan on publishing something about them really soon. We are just working on the docs first.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
pew