Skip to content

Commit 50baeb8

Browse files
committed
Fix dependencies, imports, and README
Removed linters and formatters from pyproject.toml Created a requirements.txt file Updated the README file Ran isort to fix import spacing and order
1 parent c16660d commit 50baeb8

File tree

7 files changed

+118
-878
lines changed

7 files changed

+118
-878
lines changed

python-langgraph/README.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,10 @@ This repo contains the source code for [LangGraph: Build Stateful AI Agents in P
44

55
## Setup
66

7-
LangGraph is available on [PyPI](https://pypi.org/), and you can install it with [pip](https://realpython.com/what-is-pip/). Open a terminal or command prompt, create a new virtual environment, and then run the following command to install LangGraph:
7+
Create a new virtual environment, and run the following command to install LangGraph and the additional requirements for this project:
88

99
```console
10-
(venv) $ python -m pip install langgraph
11-
```
12-
13-
This command will install the latest version of LangGraph from PyPI onto your machine. To verify that the installation was successful, start a [Python REPL](https://realpython.com/python-repl/) and import LangGraph:
14-
15-
```pycon
16-
>>> import langgraph
17-
```
18-
19-
If the import runs without error, then you've successfully installed LangGraph. You'll also need a few more libraries for this tutorial:
20-
21-
```console
22-
(venv) $ python -m pip install langchain-openai pydantic[email]
10+
(venv) $ python -m pip install -r requirements.txt
2311
```
2412

2513
You'll use `langchain-openai` to interact with OpenAI LLMs, but keep in mind you can use any LLM provider you like with LangGraph and LangChain. You'll use [`pydantic`](https://realpython.com/python-pydantic/) to validate the information your agent parses from emails.
@@ -30,6 +18,6 @@ Before moving forward, if you choose to use OpenAI, make sure you're signed up f
3018
OPENAI_API_KEY=<YOUR-OPENAI-API-KEY>
3119
```
3220

33-
Note that while LangGraph was made by the creators of LangChain, and the two libraries are highly compatible, it is possible to use LangGraph without LangChain. However, it's more common to use LangChain and LangGraph together, and you'll see throughout this tutorial how they compliment each other.
21+
## Usage
3422

35-
With that, you've installed all the dependencies you'll need for this tutorial, and you're ready to create your LangGraph email processor. You'll start by going through an overview of LangChain chains and exploring LangGraph's core concept - the state graph.
23+
TODO: A short note on how to run the project. You can tell them to go to the tutorial for more information.

python-langgraph/graphs/email_agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import logging
22
import time
33

4-
from chains.notice_extraction import NoticeEmailExtract
5-
from graphs.notice_extraction import NOTICE_EXTRACTION_GRAPH
64
from langchain_core.messages import AIMessage
75
from langchain_core.tools import tool
86
from langchain_openai import ChatOpenAI
97
from langgraph.graph import END, START, MessagesState, StateGraph
108
from langgraph.prebuilt import ToolNode
119

10+
from chains.notice_extraction import NoticeEmailExtract
11+
from graphs.notice_extraction import NOTICE_EXTRACTION_GRAPH
12+
1213
logging.basicConfig(
1314
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
1415
)

python-langgraph/graphs/notice_extraction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import logging
22
from typing import TypedDict
33

4+
from langgraph.graph import END, START, StateGraph
5+
from pydantic import EmailStr
6+
47
from chains.binary_questions import BINARY_QUESTION_CHAIN
58
from chains.escalation_check import ESCALATION_CHECK_CHAIN
69
from chains.notice_extraction import NOTICE_PARSER_CHAIN, NoticeEmailExtract
7-
from langgraph.graph import END, START, StateGraph
8-
from pydantic import EmailStr
910
from utils.graph_utils import create_legal_ticket, send_escalation_email
1011

1112
logging.basicConfig(

python-langgraph/pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"black>=24.10.0",
9-
"flake8>=7.1.1",
108
"langchain-openai>=0.3.2",
119
"langgraph>=0.2.67",
1210
"pydantic[email]>=2.10.6",
13-
"ruff>=0.9.3",
1411
]

python-langgraph/requirements.txt

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --output-file requirements.txt pyproject.toml
3+
annotated-types==0.7.0
4+
# via pydantic
5+
anyio==4.8.0
6+
# via
7+
# httpx
8+
# openai
9+
certifi==2025.1.31
10+
# via
11+
# httpcore
12+
# httpx
13+
# requests
14+
charset-normalizer==3.4.1
15+
# via requests
16+
distro==1.9.0
17+
# via openai
18+
dnspython==2.7.0
19+
# via email-validator
20+
email-validator==2.2.0
21+
# via pydantic
22+
h11==0.14.0
23+
# via httpcore
24+
httpcore==1.0.7
25+
# via httpx
26+
httpx==0.28.1
27+
# via
28+
# langgraph-sdk
29+
# langsmith
30+
# openai
31+
idna==3.10
32+
# via
33+
# anyio
34+
# email-validator
35+
# httpx
36+
# requests
37+
jiter==0.8.2
38+
# via openai
39+
jsonpatch==1.33
40+
# via langchain-core
41+
jsonpointer==3.0.0
42+
# via jsonpatch
43+
langchain-core==0.3.33
44+
# via
45+
# langchain-openai
46+
# langgraph
47+
# langgraph-checkpoint
48+
langchain-openai==0.3.3
49+
# via python-langgraph (pyproject.toml)
50+
langgraph==0.2.69
51+
# via python-langgraph (pyproject.toml)
52+
langgraph-checkpoint==2.0.10
53+
# via langgraph
54+
langgraph-sdk==0.1.51
55+
# via langgraph
56+
langsmith==0.3.4
57+
# via langchain-core
58+
msgpack==1.1.0
59+
# via langgraph-checkpoint
60+
openai==1.61.0
61+
# via langchain-openai
62+
orjson==3.10.15
63+
# via
64+
# langgraph-sdk
65+
# langsmith
66+
packaging==24.2
67+
# via langchain-core
68+
pydantic==2.10.6
69+
# via
70+
# python-langgraph (pyproject.toml)
71+
# langchain-core
72+
# langsmith
73+
# openai
74+
pydantic-core==2.27.2
75+
# via pydantic
76+
pyyaml==6.0.2
77+
# via langchain-core
78+
regex==2024.11.6
79+
# via tiktoken
80+
requests==2.32.3
81+
# via
82+
# langsmith
83+
# requests-toolbelt
84+
# tiktoken
85+
requests-toolbelt==1.0.0
86+
# via langsmith
87+
sniffio==1.3.1
88+
# via
89+
# anyio
90+
# openai
91+
tenacity==9.0.0
92+
# via langchain-core
93+
tiktoken==0.8.0
94+
# via langchain-openai
95+
tqdm==4.67.1
96+
# via openai
97+
typing-extensions==4.12.2
98+
# via
99+
# langchain-core
100+
# openai
101+
# pydantic
102+
# pydantic-core
103+
urllib3==2.3.0
104+
# via requests
105+
zstandard==0.23.0
106+
# via langsmith

python-langgraph/utils/graph_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import random
33
import time
44

5-
from chains.notice_extraction import NoticeEmailExtract
65
from pydantic import EmailStr
76

7+
from chains.notice_extraction import NoticeEmailExtract
8+
89
logging.basicConfig(
910
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
1011
)

0 commit comments

Comments
 (0)