Skip to content

Commit

Permalink
cookbook11 task update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedantsahai18 committed Oct 18, 2024
1 parent 676ff97 commit 7cdfd86
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions cookbooks/11-Advanced_Chat_Interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
integration:
provider: weather
setup:
api_key: "API_KEY"
api_key: "YOUR_WEATHER_API_KEY"
main:
- if: "len(inputs[0].chat_history) > 5"
Expand All @@ -85,22 +85,31 @@
else:
evaluate:
summarized_history: str(inputs[0].chat_history)
- if: "search_regex('weather', inputs[0].user_input)"
then:
tool: weather_api
arguments:
location: "'NEW YORK'"
else:
evaluate:
weather: "'No weather information requested'"
- evaluate:
weather: outputs[1]
- if: "search_regex('weather', inputs[0].user_input)"
then:
# tool: weather_api
# arguments:
# location: "NEW YORK"
prompt:
- role: system
content: >-
You are an advanced chat assistant. Here's a summary of the recent conversation:
{{outputs[0].summarized_history}}
# The user mentioned weather. Here's the current weather information for NEW YORK
# Incorporate this information into your response.
The user mentioned weather. Here's the current weather information for NEW YORK
Incorporate this information into your response.
# {{outputs[1]}}
{{_.weather}}
Now, respond to the user's latest input: {{inputs[0].user_input}}
else:
Expand Down

0 comments on commit 7cdfd86

Please sign in to comment.