Skip to content

Commit

Permalink
[FIX] Adding feature flag condition & fixing context parsing (#868)
Browse files Browse the repository at this point in the history
* Fix: Context parsing with No chunks

* Fix:Toggling feature flag for FS API

---------

Co-authored-by: Gayathri <[email protected]>
  • Loading branch information
harini-venkataraman and gaya3-zipstack authored Dec 4, 2024
1 parent 159a9da commit 7b6b64b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/prompt_studio/prompt_studio_core_v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def upload_for_ide(self, request: HttpRequest, pk: Any = None) -> Response:
logger.info(
f"Uploading file: {file_name}" if file_name else "Uploading file"
)
if check_feature_flag_status(flag_key=FeatureFlag.REMOTE_FILE_STORAGE):
if not check_feature_flag_status(flag_key=FeatureFlag.REMOTE_FILE_STORAGE):
file_path = FileManagerHelper.handle_sub_directory_for_tenants(
UserSessionUtils.get_organization_id(request),
is_create=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def to_representation(self, instance):
data["coverage"] = {}
# Convert string to list
try:
data["context"] = json.loads(data["context"])
context = data["context"]
if context:
data["context"] = json.loads(data["context"])
except json.JSONDecodeError:
# Convert the old value of data["context"] to a list
data["context"] = [data["context"]]
Expand Down

0 comments on commit 7b6b64b

Please sign in to comment.