Skip to content

Commit

Permalink
Adding env constants
Browse files Browse the repository at this point in the history
  • Loading branch information
harini-venkataraman committed Dec 18, 2024
1 parent db6c1dd commit 8f8f6e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion prompt-service/src/unstract/prompt_service/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class DBTableV2:
class FileStorageKeys:
FILE_STORAGE_PROVIDER = "FILE_STORAGE_PROVIDER"
FILE_STORAGE_CREDENTIALS = "FILE_STORAGE_CREDENTIALS"
REMOTE_STORAGE = "REMOTE_STORAGE"
PERMANENT_REMOTE_STORAGE = "PERMANENT_REMOTE_STORAGE"
TEMPORARY_REMOTE_STORAGE = "TEMPORARY_REMOTE_STORAGE"


class FileStorageType(Enum):
Expand Down
9 changes: 4 additions & 5 deletions prompt-service/src/unstract/prompt_service/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from unstract.prompt_service.exceptions import APIError, RateLimitError
from unstract.sdk.exceptions import RateLimitError as SdkRateLimitError
from unstract.sdk.exceptions import SdkError
from unstract.sdk.file_storage import FileStorage, FileStorageProvider
from unstract.sdk.llm import LLM

from unstract.flags.src.unstract.flags.feature_flag import check_feature_flag_status
Expand Down Expand Up @@ -305,12 +304,12 @@ def run_completion(
if execution_source == ExecutionSource.IDE.value:
fs_instance = EnvHelper.get_storage(
storage_type=StorageType.PERMANENT,
env_name=FileStorageKeys.REMOTE_STORAGE,
env_name=FileStorageKeys.PERMANENT_REMOTE_STORAGE,
)
if execution_source == ExecutionSource.TOOL.value:
fs_instance = EnvHelper.get_storage(
storage_type=StorageType.TEMPORARY,
env_name=FileStorageKeys.REMOTE_STORAGE,
env_name=FileStorageKeys.TEMPORARY_REMOTE_STORAGE,
)
highlight_data = highlight_data_plugin["entrypoint_cls"](
logger=current_app.logger,
Expand Down Expand Up @@ -371,12 +370,12 @@ def extract_table(
if execution_source == ExecutionSource.IDE.value:
fs_instance = EnvHelper.get_storage(
storage_type=StorageType.PERMANENT,
env_name=FileStorageKeys.REMOTE_STORAGE,
env_name=FileStorageKeys.PERMANENT_REMOTE_STORAGE,
)
if execution_source == ExecutionSource.TOOL.value:
fs_instance = EnvHelper.get_storage(
storage_type=StorageType.TEMPORARY,
env_name=FileStorageKeys.REMOTE_STORAGE,
env_name=FileStorageKeys.TEMPORARY_REMOTE_STORAGE,
)
try:
if check_feature_flag_status(FeatureFlag.REMOTE_FILE_STORAGE):
Expand Down

0 comments on commit 8f8f6e7

Please sign in to comment.