Skip to content

Commit

Permalink
[FIX] Fixed issue in prompt construction (#767)
Browse files Browse the repository at this point in the history
Fixed issue in prompt construction

Signed-off-by: Deepak <[email protected]>
  • Loading branch information
Deepak-Kesavan authored Oct 10, 2024
1 parent 822dc36 commit 4e59cb3
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 @@ -287,10 +287,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 @@ -305,7 +302,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 4e59cb3

Please sign in to comment.