Skip to content

Commit defcfc4

Browse files
authored
Merge pull request #178 from UiPath/fix/load_dotenv
feat(load_dotenv): remove load_dotenv()
2 parents 6eaa07b + 2423d6f commit defcfc4

File tree

4 files changed

+2
-19
lines changed

4 files changed

+2
-19
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.0.130"
3+
version = "0.0.131"
44
description = "UiPath Langchain"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
77
dependencies = [
8-
"uipath>=2.1.49, <2.2.0",
8+
"uipath>=2.1.54, <2.2.0",
99
"langgraph>=0.5.0, <0.7.0",
1010
"langchain-core>=0.3.34",
1111
"langgraph-checkpoint-sqlite>=2.0.3",

samples/retrieval-chain/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pprint import pprint
77
from typing import Any
88

9-
from dotenv import find_dotenv, load_dotenv
109
from langchain_core.language_models.chat_models import BaseChatModel
1110
from langchain_core.output_parsers import StrOutputParser
1211
from langchain_core.prompts import ChatPromptTemplate
@@ -68,7 +67,6 @@ def retrieval_chain(query: str) -> dict[str, Any]:
6867

6968

7069
async def main(input_data: MainInput):
71-
load_dotenv(find_dotenv())
7270

7371
"""Run a simple example of ContextGroundingVectorStore."""
7472
vectorstore = ContextGroundingVectorStore(

samples/simple-remote-mcp/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import dotenv
21
import os
32
from contextlib import asynccontextmanager
43
from langgraph.prebuilt import create_react_agent
@@ -7,7 +6,6 @@
76
from mcp import ClientSession
87
from mcp.client.streamable_http import streamablehttp_client
98

10-
dotenv.load_dotenv()
119

1210
@asynccontextmanager
1311
async def make_graph():

src/uipath_langchain/_cli/_utils/_graph.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pathlib import Path
99
from typing import Any, Dict, List, Optional, Union, cast
1010

11-
from dotenv import load_dotenv
1211
from langgraph.graph import StateGraph
1312
from langgraph.graph.state import CompiledStateGraph
1413

@@ -161,18 +160,6 @@ def load_config(self) -> Dict[str, Any]:
161160
f"Missing required fields in langgraph.json: {missing_fields}"
162161
)
163162

164-
if env_file := config.get("env"):
165-
env_path = os.path.abspath(os.path.normpath(env_file))
166-
if os.path.exists(env_path):
167-
if not load_dotenv(env_path):
168-
# log warning only if dotenv is not empty
169-
if os.path.getsize(env_path) > 0:
170-
logger.warning(
171-
f"Could not load environment variables from {env_path}"
172-
)
173-
else:
174-
logger.debug(f"Loaded environment variables from {env_path}")
175-
176163
self._config = config
177164
self._load_graphs()
178165
return config

0 commit comments

Comments
 (0)