Browse by Topic

Popular

Latest

Latest Python Posts

Diagram showing streaming and async flow in a Python LangChain application
Python

Implementing Streaming and Async in Python LangChain

Learn how to combine streaming and async in Python LangChain to build responsive LLM applications. Includes token streaming, async calls, error handling, and concurrency.

LangChainPythonAsyncStreaming
Diagram of a Python LangChain RAG pipeline showing document chunks converted to embeddings, stored in a vector store, retrieved, and passed to an LLM for answer generation.
Python

Python LangChain RAG Implementation: A Practical Pipeline

A practical guide to building a RAG pipeline in Python with LangChain: load documents, split and embed chunks, store vectors, retrieve relevant context, and generate answers with an LLM.

LangChainRAGRetrieval-Augmented GenerationVector Search
A diagram showing text documents being converted into embedding vectors, stored in a vector database, and retrieved by a query to feed into an LLM.
Python

Python LangChain Embeddings, Vector Stores, and Retrievers

Build semantic search and RAG pipelines with Python LangChain embeddings, vector stores, and retrievers.

LangChainEmbeddingsVector StoreRetriever
Illustration of a document being loaded and split into smaller text chunks for a LangChain retrieval pipeline.
Python

Python LangChain Document Loaders and Text Splitters Explained

python langchain document loaders and text splitters: Learn how LangChain document loaders ingest files and how text splitters prepare content for embeddings, with pra...

LangChainDocument LoadersText SplittingRAG
A diagram showing an LLM agent loop connecting a model to tool functions with observations returning to the model.
Python

Building Python LangChain Tools and Agents

Learn how to build Python LangChain tools and agents: defining tools, structuring arguments, running the agent loop, handling errors, and controlling cost.

LangChainPythonLLM AgentsTool Calling
Diagram showing an LLM response being parsed into a structured Pydantic object.
Python

Python LangChain Structured Output and Parsers

Learn how to get typed, structured LLM responses in Python with LangChain output parsers, including Pydantic and JSON examples, retry logic, and production tips.

LangChainStructured OutputOutput ParsersPydantic
Diagram showing a prompt template with placeholders transforming into structured chat message bubbles that feed into a chat model icon.
Python

Python LangChain Prompt Templates and Chat Models

Learn how to use LangChain prompt templates with chat models in Python, including ChatPromptTemplate, message roles, partial variables, and output parsing.

LangChainPrompt TemplatesChat ModelsLLM
Illustration of a Python script with timeout, retry, and error handling controls for the OpenAI API
Python

Python OpenAI API: Timeouts, Retries, and Error Handling

Learn how to set timeouts, control retries, and handle errors when calling the OpenAI API from Python to build resilient applications.

OpenAIPythonTimeoutRetries
Python code submitting a batch of requests to the OpenAI Batch API, with a progress indicator and results file
Python

Python OpenAI Batch API: Submit and Process Jobs

Learn how to submit and process OpenAI batch jobs from Python: upload a JSONL request file, create a batch job, poll for status, and retrieve results.

OpenAI APIBatch ProcessingPythonJSONL
Illustration of Python code generating OpenAI embeddings that map text documents into a vector space for similarity search.
Python

Using OpenAI Embeddings in Python for Semantic Search

Create embeddings with the OpenAI Python client, understand the response structure, compute cosine similarity, and build semantic search over your documents.

openaiembeddingssemantic-searchcosine-similarity