Skip to content

Commit 25d72c8

Browse files
committed
fix: ensure dotenv import precedes client import
1 parent 1d312bf commit 25d72c8

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

src/{{ project_name_snake }}/qa_workflows.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import logging
22
import os
3+
import tempfile
34

45
import httpx
6+
from dotenv import load_dotenv
57
from llama_cloud.types import RetrievalMode
6-
import tempfile
8+
from llama_index.core import Settings
79
from llama_index.core.chat_engine.types import BaseChatEngine, ChatMode
10+
from llama_index.core.memory import ChatMemoryBuffer
11+
from llama_index.embeddings.openai import OpenAIEmbedding
12+
from llama_index.llms.openai import OpenAI
13+
from llama_cloud_services import LlamaCloudIndex
814
from workflows import Workflow, step, Context
915
from workflows.events import (
1016
StartEvent,
@@ -15,16 +21,6 @@
1521
)
1622
from workflows.retry_policy import ConstantDelayRetryPolicy
1723

18-
from llama_cloud_services import LlamaCloudIndex
19-
from llama_index.core import Settings
20-
from llama_index.llms.openai import OpenAI
21-
from llama_index.embeddings.openai import OpenAIEmbedding
22-
from llama_index.core.memory import ChatMemoryBuffer
23-
24-
from dotenv import load_dotenv
25-
26-
load_dotenv()
27-
2824
from .clients import (
2925
LLAMA_CLOUD_API_KEY,
3026
LLAMA_CLOUD_BASE_URL,
@@ -34,6 +30,8 @@
3430
LLAMA_CLOUD_PROJECT_ID,
3531
)
3632

33+
load_dotenv()
34+
3735

3836
logger = logging.getLogger(__name__)
3937

test-proj/src/test_proj/qa_workflows.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import logging
22
import os
3+
import tempfile
34

45
import httpx
6+
from dotenv import load_dotenv
57
from llama_cloud.types import RetrievalMode
6-
import tempfile
8+
from llama_index.core import Settings
79
from llama_index.core.chat_engine.types import BaseChatEngine, ChatMode
10+
from llama_index.core.memory import ChatMemoryBuffer
11+
from llama_index.embeddings.openai import OpenAIEmbedding
12+
from llama_index.llms.openai import OpenAI
13+
from llama_cloud_services import LlamaCloudIndex
814
from workflows import Workflow, step, Context
915
from workflows.events import (
1016
StartEvent,
@@ -15,16 +21,6 @@
1521
)
1622
from workflows.retry_policy import ConstantDelayRetryPolicy
1723

18-
from llama_cloud_services import LlamaCloudIndex
19-
from llama_index.core import Settings
20-
from llama_index.llms.openai import OpenAI
21-
from llama_index.embeddings.openai import OpenAIEmbedding
22-
from llama_index.core.memory import ChatMemoryBuffer
23-
24-
from dotenv import load_dotenv
25-
26-
load_dotenv()
27-
2824
from .clients import (
2925
LLAMA_CLOUD_API_KEY,
3026
LLAMA_CLOUD_BASE_URL,
@@ -34,6 +30,8 @@
3430
LLAMA_CLOUD_PROJECT_ID,
3531
)
3632

33+
load_dotenv()
34+
3735

3836
logger = logging.getLogger(__name__)
3937

0 commit comments

Comments
 (0)