Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Add simple "getting started" examples #141

Closed
clstaudt opened this issue Apr 9, 2023 · 10 comments
Closed

Documentation: Add simple "getting started" examples #141

clstaudt opened this issue Apr 9, 2023 · 10 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@clstaudt
Copy link

clstaudt commented Apr 9, 2023

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.

Screenshot 2023-04-09 at 12 40 33

@notpushkin
Copy link

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.

@clstaudt
Copy link
Author

clstaudt commented Apr 9, 2023

@notpushkin Thanks for the hint. This seems to behave like ChatGPT:

Screenshot 2023-04-09 at 17 08 10

I think something like this should be included as a "Hello World" example in the documentation.

@ogabrielluiz
Copy link
Contributor

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.

@notpushkin
Copy link

Tangential: I was able to get tools working if I drop conversation memory:

image

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)

@ChasLui
Copy link

ChasLui commented Apr 23, 2023

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

@frankjoshua
Copy link

I think a simple method to add tutorials would just create an examples folder. Then export some working code.

@notpushkin
Copy link

@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.

@ogabrielluiz
Copy link
Contributor

We plan on publishing something about them really soon. We are just working on the docs first.

@stale
Copy link

stale bot commented Jun 12, 2023

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.

@stale stale bot added the stale label Jun 12, 2023
@notpushkin
Copy link

pew

@stale stale bot removed the stale label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

8 participants