Weather forecast agent
This is an agent added as an example to show how to add new python agents to the system.
To test you can use message like Какая температура в Минске?
or Какая температура в Бресте в Беларуси?
, you can specify a country for city names that have the same name in different countries.
Action class:
action_show_weather
Parameters:
messageAddr
- an element ofconcept_message
andconcept_message_about_weather
;
Workflow:
- The agent extracts an entity from the message, then by geocoding API gets longitude and latitude of the entity and send request about the entity coordinates using an open weather API.
- After receiving a response the agent processes it and generates a phrase including weather in the entity.
The agent rule:
The agent template phrase:
Example
Example of an input structure:
Result
Possible result codes:
SC_RESULT_OK
- agent successfully found elements and generate phrase;SC_RESULT_ERROR
-messageAddr
orentity
is not found.