From b1e8ae2f16c5b44ce55573072bcc190c02bb05cf Mon Sep 17 00:00:00 2001 From: Nolwenn Bernard <28621493+NoB0@users.noreply.github.com> Date: Mon, 13 May 2024 07:20:06 +0200 Subject: [PATCH] Add simulator_id to configuration (#147) Fixes #140 --- config/default/config_default.yaml | 1 + usersimcrs/run_simulation.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/default/config_default.yaml b/config/default/config_default.yaml index 6b925be0..1561c343 100644 --- a/config/default/config_default.yaml +++ b/config/default/config_default.yaml @@ -1,4 +1,5 @@ agent_id: "IAI MovieBot" +simulator_id: "User Simulator" output_name: "moviebot" # By default, the agent has an HTTP API. agent_uri: "http://127.0.0.1:5001" diff --git a/usersimcrs/run_simulation.py b/usersimcrs/run_simulation.py index 3ca1f15b..43ec47a0 100644 --- a/usersimcrs/run_simulation.py +++ b/usersimcrs/run_simulation.py @@ -113,7 +113,7 @@ def main(config: confuse.Configuration, agent: Agent) -> None: nlg = ConditionalNLG(template) simulator = AgendaBasedSimulator( - "TEST03", + config["simulator_id"].get(), preference_model, interaction_model, nlu, @@ -358,9 +358,9 @@ def load_rasa_diet_classifier( # See usage example in README for more details. agent_uri = config["agent_uri"].get() try: - response = requests.get(agent_uri) + response = requests.get(agent_uri, timeout=60) assert response.status_code == 200 - agent = MovieBotAgent(agent_id="MovieBotTester", uri=agent_uri) + agent = MovieBotAgent(agent_id=config["agent_id"].get(), uri=agent_uri) except requests.exceptions.RequestException: raise RuntimeError( f"Connection refused to {agent_uri}. Please check that "