How patakrishna2006-a11y/langchain-tutorial works
This repository is a collection of standalone LangChain examples, not a single integrated application. Its workflows demonstrate direct model invocation, chat prompts and messages, text embedding, and a Streamlit poem-writing chatbot. The chatbot accepts and validates user choices, formats them with a saved prompt template, invokes a configured NVIDIA chat model, and displays the response. Other scripts independently invoke Google, NVIDIA, Ollama, or Hugging Face models. Edges reflect only calls and file operations visible in the excerpts; no shared orchestration is shown.
Main entry points: prompts_ui.py Poem Chatbot UI · prompt.py Prompt Template · message_placeholder.py History Chat Demo · poem_chatbot_template.json Poem Template JSON
Components 19
LLM Example
- LLM Demo
1. LLMs/llm demo.py
Chat Examples
- Chat Demo
2. ChatModels/chat model demo.py - Open Chat Model
2. ChatModels/open source model.py
Embedding Examples
- NVIDIA Embeddings
3. EmbeddingModels/embed model.py - Hugging Face Embeddings
3. EmbeddingModels/hugging face embed.py - Ollama Embeddings
3. EmbeddingModels/open source embed model.py
Prompting
- Prompt Template
4. Prompts/prompt.py - Chat Prompt Demo
4. Prompts/chatprompttemplate.py - Poem Chatbot UI
4. Prompts/prompts_ui.py - Poem Template JSON
4. Prompts/poem_chatbot_template.json - Poem Template YAML
4. Prompts/poem_chatbot_template.yaml
Messages
- Message Demo
5. Messages/message.py - History Chat Demo
5. Messages/message_placeholder.py - Chat History Text
5. Messages/chat_history.txt
Other components
- User
- Google Gemini
- NVIDIA API
- Ollama
- Hugging Face
Connections 15
- LLM Demo → Google Gemini: invokes
1. LLMs/llm demo.py - Chat Demo → NVIDIA API: invokes
2. ChatModels/chat model demo.py - Open Chat Model → Ollama: invokes
2. ChatModels/open source model.py - NVIDIA Embeddings → NVIDIA API: embeds text
3. EmbeddingModels/embed model.py - Hugging Face Embeddings → Hugging Face: embeds text
3. EmbeddingModels/hugging face embed.py - Ollama Embeddings → Ollama: embeds text
3. EmbeddingModels/open source embed model.py - Prompt Template → Poem Template JSON: saves
4. Prompts/prompt.py - Prompt Template → Poem Template YAML: saves
4. Prompts/prompt.py - User → Poem Chatbot UI: submits choices
4. Prompts/prompts_ui.py - Poem Chatbot UI → Poem Template JSON: loads template
4. Prompts/prompts_ui.py - Poem Chatbot UI → NVIDIA API: invokes
4. Prompts/prompts_ui.py - Chat Prompt Demo → Ollama: invokes
4. Prompts/chatprompttemplate.py - Message Demo → NVIDIA API: invokes
5. Messages/message.py - History Chat Demo → Chat History Text: reads
5. Messages/message_placeholder.py - History Chat Demo → NVIDIA API: invokes
5. Messages/message_placeholder.py