Skip to content

Commit

Permalink
Fixed issue in prompt construction
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak <[email protected]>
  • Loading branch information
Deepak-Kesavan committed Oct 7, 2024
1 parent 709467e commit eaa0c96
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions prompt-service/src/unstract/prompt_service/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,7 @@ def construct_prompt(
context: str,
platform_postamble: str,
) -> str:
prompt = (
f"{preamble}\n\nContext:\n---------------\n{context}\n"
f"-----------------\n\nQuestion or Instruction: {prompt}\n"
)
prompt = f"{preamble}\n\nQuestion or Instruction: {prompt}"
if grammar_list is not None and len(grammar_list) > 0:
prompt += "\n"
for grammar in grammar_list:
Expand All @@ -259,7 +256,10 @@ def construct_prompt(
{", ".join(synonyms)} in both the quesiton and the context.' # noqa
if platform_postamble:
platform_postamble += "\n\n"
prompt += f"\n\n{postamble}\n\n{platform_postamble}Answer:"
prompt += (
f"\n\n{postamble}\n\nContext:\n---------------\n{context}\n"
f"-----------------\n\n{platform_postamble}Answer:"
)
return prompt


Expand Down

0 comments on commit eaa0c96

Please sign in to comment.