Skip to content

Commit

Permalink
Merge pull request #57 from FloRul/feature/prompt_inspection
Browse files Browse the repository at this point in the history
Refactor prepare_prompt function to include user query in final prompt
  • Loading branch information
FloRul authored Mar 6, 2024
2 parents 47d0aba + 0e64f56 commit bf2e97e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lambdas/inference/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@


def prepare_prompt(query: str, docs: list, history: list, source: str):
basic_prompt = f'\n\nThe user sent the following message : "{query}".'
source_prompt = prepare_source_prompt(source)
document_prompt = prepare_document_prompt(docs)
history_prompt = prepare_history_prompt(history)

final_prompt = f"""{basic_prompt}\n
final_prompt = f"""
{source_prompt}\n
{document_prompt}\n
{history_prompt}\n
{ENV_VARS['system_prompt']}\n
Human:{query}\n
\nAssistant:"""

return final_prompt
Expand Down

0 comments on commit bf2e97e

Please sign in to comment.