Skip to content

Commit

Permalink
fix: adjust prompt for llm-app/alert example
Browse files Browse the repository at this point in the history
GitOrigin-RevId: eb29c80c57d34300886eafd17cae07ce1ce5ae6a
  • Loading branch information
berkecanrizai authored and Manul from Pathway committed Apr 19, 2024
1 parent dd3b958 commit 5e20cee
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions examples/pipelines/alert/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,27 @@ def split_answer(answer: str) -> tuple[bool, str]:

def build_prompt_compare_answers(new: str, old: str) -> str:
prompt = f"""
Are the two following responses deviating?
Answer with Yes or No.
Are the two following responses for a specific question deviating?
Answer with `Yes` or `No`.
First response: "{old}"
Example:
First response: "Joe is going to lead the session"
Second response: "Alice will be lead of this session"
Answer: Yes
Example:
First response: "This car goes for around $45000"
Second response: "Price of this SUV is $45.000 including tax"
Answer: No
Example:
First response: "New show will air in 2024"
Second response: "Premier of the new show is set to be in March 2024"
Answer: Yes
First response: "{old}"
Second response: "{new}"
Answer:
"""
return prompt

Expand Down Expand Up @@ -263,7 +278,7 @@ def acceptor(new: str, old: str) -> bool:

pw.io.slack.send_alerts(alerts.message, slack_alert_channel_id, slack_alert_token)

pw.run()
pw.run(monitoring_level=pw.MonitoringLevel.NONE)


if __name__ == "__main__":
Expand Down

0 comments on commit 5e20cee

Please sign in to comment.