Skip to content

Commit 3585f6f

Browse files
authored
Merge pull request #68 from UiPath/fix/load_dotenv
fix(load_dotenv): remove load_dotenv()
2 parents 255be9f + dcc5ceb commit 3585f6f

6 files changed

Lines changed: 2 additions & 26 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.0.35"
3+
version = "0.0.36"
44
description = "UiPath LlamaIndex SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"
@@ -9,7 +9,7 @@ dependencies = [
99
"llama-index-embeddings-azure-openai>=0.3.8",
1010
"llama-index-llms-azure-openai>=0.3.2",
1111
"openinference-instrumentation-llama-index>=4.3.0",
12-
"uipath>=2.1.36, <2.2.0",
12+
"uipath>=2.1.54, <2.2.0",
1313
]
1414
classifiers = [
1515
"Development Status :: 3 - Alpha",

samples/action-center-hitl-agent/main.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22

3-
from dotenv import load_dotenv
43
from llama_index.core.agent.workflow import AgentWorkflow
54
from llama_index.core.workflow import (
65
Context,
@@ -10,8 +9,6 @@
109

1110
from uipath_llamaindex.models import CreateActionEvent
1211

13-
load_dotenv()
14-
1512
llm = OpenAI(model="gpt-4o-mini")
1613

1714

samples/multi-agent/main.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22

3-
from dotenv import load_dotenv
43
from llama_index.core.agent.workflow import AgentWorkflow
54
from llama_index.core.workflow import (
65
Context,
@@ -10,8 +9,6 @@
109

1110
from uipath_llamaindex.models import InvokeProcessEvent
1211

13-
load_dotenv()
14-
1512
llm = OpenAI(model="gpt-4o-mini")
1613

1714

samples/quickstart-llamacloud/main.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import os
22

3-
from dotenv import load_dotenv
43
from llama_cloud_services import LlamaCloudIndex
54
from llama_index.core.agent.workflow import FunctionAgent
65
from llama_index.llms.openai import OpenAI
76
from pydantic import BaseModel, Field
87

9-
load_dotenv()
10-
118
# Initialize LlamaCloud Index connections
129
company_policy_index = LlamaCloudIndex(
1310
name=os.getenv("LLAMACLOUD_INDEX_1_NAME"),

src/uipath_llamaindex/_cli/_utils/_config.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
1010

11-
from dotenv import load_dotenv
1211
from llama_index.core.workflow import Workflow
1312

1413
logger = logging.getLogger(__name__)
@@ -135,18 +134,6 @@ def load_config(self) -> Dict[str, Any]:
135134
f"Missing required fields in llama_index.json: {missing_fields}"
136135
)
137136

138-
if env_file := config.get("env"):
139-
env_path = os.path.abspath(os.path.normpath(env_file))
140-
if os.path.exists(env_path):
141-
if not load_dotenv(env_path):
142-
# log warning only if dotenv is not empty
143-
if os.path.getsize(env_path) > 0:
144-
logger.warning(
145-
f"Could not load environment variables from {env_path}"
146-
)
147-
else:
148-
logger.debug(f"Loaded environment variables from {env_path}")
149-
150137
self._config = config
151138
self._load_workflows()
152139
return config

src/uipath_llamaindex/_cli/cli_run.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from os import environ as env
44
from typing import Optional
55

6-
from dotenv import load_dotenv
76
from openinference.instrumentation.llama_index import (
87
LlamaIndexInstrumentor,
98
get_current_span,
@@ -18,7 +17,6 @@
1817
from ._utils._config import LlamaIndexConfig
1918

2019
logger = logging.getLogger(__name__)
21-
load_dotenv()
2220

2321

2422
def llamaindex_run_middleware(

0 commit comments

Comments
 (0)