Skip to content

Commit f1c14af

Browse files
Merge pull request #73 from kevinbackhouse/find_dotenv
Search for .env in current directory
2 parents c041636 + 47756e8 commit f1c14af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/seclab_taskflow_agent/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import argparse
77
import os
88
import sys
9-
from dotenv import load_dotenv
9+
from dotenv import load_dotenv, find_dotenv
1010
import logging
1111
from logging.handlers import RotatingFileHandler
1212
from pprint import pprint, pformat
@@ -34,7 +34,7 @@
3434
from .capi import list_tool_call_models
3535
from .available_tools import AvailableTools
3636

37-
load_dotenv()
37+
load_dotenv(find_dotenv(usecwd=True))
3838

3939
# only model output or help message should go to stdout, everything else goes to log
4040
logging.getLogger('').setLevel(logging.NOTSET)

src/seclab_taskflow_agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# https://openai.github.io/openai-agents-python/agents/
55
import os
66
import logging
7-
from dotenv import load_dotenv
7+
from dotenv import load_dotenv, find_dotenv
88
from collections.abc import Callable
99
from typing import Any
1010
from urllib.parse import urlparse
@@ -18,7 +18,7 @@
1818
from .capi import COPILOT_INTEGRATION_ID, COPILOT_API_ENDPOINT
1919

2020
# grab our secrets from .env, this must be in .gitignore
21-
load_dotenv()
21+
load_dotenv(find_dotenv(usecwd=True))
2222

2323
match urlparse(COPILOT_API_ENDPOINT).netloc:
2424
case 'api.githubcopilot.com':

0 commit comments

Comments
 (0)