Skip to content

Commit

Permalink
[Fix] Default LLM Profile issue in prompt studio serializer (#869)
Browse files Browse the repository at this point in the history
fixed indentation issue in serializer
  • Loading branch information
jagadeeswaran-zipstack authored Dec 4, 2024
1 parent 47ebeac commit 159a9da
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions backend/prompt_studio/prompt_studio_core_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 159a9da

Please sign in to comment.