Exploring LangChain's Quickstart (1) - LLM, Prompt Template, and Chain
In this series, we’ll explore the ‘Quickstart’ section of the LangChain documentation.
In this article, we focus on LLMs, prompt templates, and chains.
1. Installation
To get started, install langchain
and its OpenAI extension, langchain-openai
:
Developing a Memo App with Tkinter (2) - Saving a Memo to a Text File
Continuing from the previous “Hello World” program, this session dives into building a memo app with the following functionalities:
- A text box for entering a memo.
- A shortcut (
Control+S
) for saving the contents of the text box to a file. - Displaying the file contents in the text box upon app launch.
1. Setting Up the Text Box
Let’s get started by building on our previous program. First, we create the root window and place a frame inside it. Within this frame, we’ll set up the text box for memo entry.
Developing a Memo App with Tkinter (1) - Running a 'Hello World' Program
In this series, we’ll be leveraging Tkinter, Python’s built-in GUI library, to create a memo app.
Getting Started with the “Hello World” Program
Let’s begin by exploring how to use Tkinter with the following “Hello World” program outlined in its official documentation.
How to Skip Cell Execution in Jupyter Notebook
In this article, I’ll show you how to skip the execution of cells in Jupyter Notebook based on certain conditions.
The methods described here are applicable to Google Colaboratory and Kaggle Notebooks.
How to Skip a Cell Execution
To skip cell execution, create a custom magic command as follows:
-
First, create a
skip
magic command that does nothing.Building a Discord Chatbot with Python (9) - Adding Interactive Buttons to Chat Messages
In this installment, we’ll dive deeply into how to add interactive buttons to your chat messages in Discord. Additionally, we’ll explore the variety of responses you can trigger when these buttons are pressed.
NoteGiven that this article aims to be a comprehensive guide on Discord bot interactions, it’s a bit longer than our previous posts.About Message Components
Discord provides a framework for adding “message components” (or simply “components”), which are interactive elements you can place within chat messages.
(See: Message Components)Building a Discord Chatbot with Python (8) - Adding Options to Bot Commands
Continuing from our last session, we’ll be using
discord.ext.commands
to add options to our chatbot commands.
(Reference: Documentation)We’ll add a new ‘category’ option to the ‘quiz’ feature, allowing for quizzes in various categories.
Additionally, we’ll introduce a ’timeout’ option to adjust the time limit for answering questions.Recap
In our previous article, we refactored the code using
discord.py
’s extension,discord.ext.commands
.The code for the ‘quiz’ feature, found in
commands/quiz.py
, is as follows: