From 159a9dad482823b62b28c61230e06f6367934391 Mon Sep 17 00:00:00 2001 From: jagadeeswaran-zipstack Date: Wed, 4 Dec 2024 12:34:18 +0530 Subject: [PATCH] [Fix] Default LLM Profile issue in prompt studio serializer (#869) fixed indentation issue in serializer --- .../prompt_studio_core_v2/serializers.py | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/backend/prompt_studio/prompt_studio_core_v2/serializers.py b/backend/prompt_studio/prompt_studio_core_v2/serializers.py index d013acb37..301557a54 100644 --- a/backend/prompt_studio/prompt_studio_core_v2/serializers.py +++ b/backend/prompt_studio/prompt_studio_core_v2/serializers.py @@ -62,24 +62,24 @@ def to_representation(self, instance): # type: ignore "Default LLM profile doesnt exist for prompt tool %s", str(instance.tool_id), ) - prompt_instance: ToolStudioPrompt = ToolStudioPrompt.objects.filter( - tool_id=data.get(TSKeys.TOOL_ID) - ).order_by("sequence_number") - data[TSKeys.PROMPTS] = [] - output: list[Any] = [] - # Appending prompt instances of the tool for FE Processing - if prompt_instance.count() != 0: - for prompt in prompt_instance: - prompt_serializer = ToolStudioPromptSerializer(prompt) - coverage = OutputManagerUtils.get_coverage( - data.get(TSKeys.TOOL_ID), - profile_manager.profile_id, - prompt.prompt_id, - ) - serialized_data = prompt_serializer.data - serialized_data["coverage"] = coverage - output.append(serialized_data) - data[TSKeys.PROMPTS] = output + prompt_instance: ToolStudioPrompt = ToolStudioPrompt.objects.filter( + tool_id=data.get(TSKeys.TOOL_ID) + ).order_by("sequence_number") + data[TSKeys.PROMPTS] = [] + output: list[Any] = [] + # Appending prompt instances of the tool for FE Processing + if prompt_instance.count() != 0: + for prompt in prompt_instance: + prompt_serializer = ToolStudioPromptSerializer(prompt) + coverage = OutputManagerUtils.get_coverage( + data.get(TSKeys.TOOL_ID), + prompt.profile_manager_id, + prompt.prompt_id, + ) + serialized_data = prompt_serializer.data + serialized_data["coverage"] = coverage + output.append(serialized_data) + data[TSKeys.PROMPTS] = output data["created_by_email"] = instance.created_by.email