# Failed to replace placeholders in response- rasa chatbot

**URL:** <https://forum.rasa.com/t/failed-to-replace-placeholders-in-response-rasa-chatbot/59979>\
**Category:** Rasa Open Source\
**Created:** [October 18, 2023, 5:12am UTC](https://forum.rasa.com/t/failed-to-replace-placeholders-in-response-rasa-chatbot/59979 "2023-10-18T05:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kusuma](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kusuma](https://forum.rasa.com/u/kusuma)\
**Post date:** [October 18, 2023, 5:12am UTC](https://forum.rasa.com/t/failed-to-replace-placeholders-in-response-rasa-chatbot/59979/1 "2023-10-18T05:12:04Z")

</div>

First i ran the command rasa run actions and then i ran rasa train and then rasa shell. I get an error. kindly help me

Failed to replace placeholders in response ‘Today’s temperature is {temp}’. Tried to replace ‘temp’ but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the response. Return response without filling the response. Traceback (most recent call last): File “c:\users\pc\appdata\local\programs\python\python37\lib\site-packages\rasa\core\nlg\interpolator.py”, line 27, in interpolate\_text text = text.format(values) KeyError: ‘temp’ Today’s temperature is {temp}

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [October 18, 2023, 3:57pm UTC](https://forum.rasa.com/t/failed-to-replace-placeholders-in-response-rasa-chatbot/59979/2 "2023-10-18T15:57:52Z")

</div>

> There is no slot with this name nor did you pass the value explicitly when calling the response

This is the answer to your question. Can you share a link to the repo?

---

<div class="post-metadata">

**Author:** ![kusuma](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@kusuma](https://forum.rasa.com/u/kusuma)\
**Post date:** [October 19, 2023, 4:47am UTC](https://forum.rasa.com/t/failed-to-replace-placeholders-in-response-rasa-chatbot/59979/3 "2023-10-19T04:47:35Z")

</div>

This is my actions.py import requests from rasa\_sdk import Action, Tracker from rasa\_sdk.events import SlotSet from rasa\_sdk.executor import CollectingDispatcher

class ActionWeather(Action): def name(self): return “action\_weather”

```
def run(self, dispatcher, tracker, domain):
    city = tracker.get_slot("city")
    temp = int(self.weather(city) ['temp'] -273)

    dispatcher.utter_template("utter_temp", tracker, temp=temp, temp_min=temp_min)
    return [SlotSet("temp", temp_min)]

def weather(self,city):
    api_key = "272848452bcd5161666828c54c6c095d"
    url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}"

    response = requests
    .get(url)
    json_data = response.json()
    format_add = json_data['main']
    temp_min = json_data['main'] ['temp_min']
    format_string = "Temperature is:{} celsius, Minimum Temperature is:{} celsius".format(temp, temp_min)
    return format_string

```
