Build an LLM Chat App Using LangGraph, OpenAI and Python—Part 2: Understanding SystemMessage

When building conversational AI with LangChain, the way you send and receive information is through messages. Each message has a specific role, helping you shape the flow, tone and context of the conversation. LangChain supports several message types: HumanMessage – represents the user’s input AIMessage – represents the model’s response SystemMessage – sets the behavior or rules forContinueContinue reading “Build an LLM Chat App Using LangGraph, OpenAI and Python—Part 2: Understanding SystemMessage”

Build an LLM Chat App Using LangGraph, OpenAI and Python—Part 1

Everyone is excited about GenAI, chatbots and agents—and for good reason. This article offers a very beginner-friendly introduction to building with OpenAI and LangChain using Python, helping you take your first steps into the world of AI development. This article covers the following topics: Installation of dependencies Connecting to the OpenAI GPT model Creating yourContinueContinue reading “Build an LLM Chat App Using LangGraph, OpenAI and Python—Part 1”

How to Build Your First LLM Application Using LangChain and TypeScript

In this article, I will walk you through a step-by-step guide to building your first LLM-powered application using LangChain and the OpenAI model. I will be using TypeScript to build the app, and by the end you’ll have a working translator built with the OpenAI GPT-4 model and LangChain’s messaging package. Set Up the Project To start with, createContinueContinue reading “How to Build Your First LLM Application Using LangChain and TypeScript”

Step-by-Step Guide: Using LangExtract with OpenAI

Recently, Google launched a library called LangExtract. LangExtract is an open-source Python library that enables developers to transform unstructured text into structured information using large language models (LLMs). It offers a lightweight interface compatible with multiple model backends, including Gemini and GPT, making it well-suited for processing large unstructured text into structured information. Some key featuresContinueContinue reading “Step-by-Step Guide: Using LangExtract with OpenAI”

Async Programming in Python

Python async programming is not the same as multi-threading. Even though they both achieve concurrency, multi-threading tasks run in parallel on multiple threads, whereas async programming functions run asynchronously using the event loop. Async programming is most useful when your program spends a lot of time waiting for input or output (I/O), like: Web scraping many pages atContinueContinue reading “Async Programming in Python”

GenAI for Beginners:  What is the Temperature parameter in a model

When working with Large Language Models (LLMs), it is essential to understand specific key parameters that influence the model’s behaviour. Two of the most critical parameters are: Temperature Top-P (nucleus) sampling value Temperature is a parameter that controls the randomness in the model’s output by affecting how the model selects the next token to generate.ContinueContinue reading “GenAI for Beginners:  What is the Temperature parameter in a model”