Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
include server URL in useRasaCore
Browse files Browse the repository at this point in the history
  • Loading branch information
space-pope committed Apr 14, 2021
1 parent f49c724 commit f0ce463
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
26 changes: 12 additions & 14 deletions src/main/java/io/spokestack/spokestack/Spokestack.java
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ public static class Builder {
* <b>NLU</b> (properties)
* <p>
* Note that NLU properties are not required if Rasa NLU and
* dialogue management are in use (see {@link #useRasaCore()}),
* dialogue management are in use
* (see {@link #useRasaCore(String)}),
* but other properties are required to configure the Rasa
* integration.
* </p>
Expand Down Expand Up @@ -591,7 +592,8 @@ public static class Builder {
* <b>Dialogue Management</b> (properties)
* <p>
* Like NLU, these properties are not required if Rasa NLU and
* dialogue management are in use via {@link #useRasaCore()}.
* dialogue management are in use via
* {@link #useRasaCore(String)}.
* </p>
* <ul>
* <li>
Expand Down Expand Up @@ -756,23 +758,19 @@ public Builder setProperty(String key, Object value) {
* utterances.
*
* <p>
* This requires the following property to be set via {@link
* #setProperty(String, Object)} (see {@link io.spokestack.spokestack.rasa.RasaCoreNLU}
* This method sets the {@code rasa-core-url} property automatically;
* (see {@link io.spokestack.spokestack.rasa.RasaCoreNLU}
* and {@link io.spokestack.spokestack.rasa.RasaDialoguePolicy} for
* other relevant properties):
* other relevant properties).
* </p>
*
* <ul>
* <li>
* <b>rasa-core-url</b> (string, required): URL to the Rasa core NLU
* server. This component is designed to use Rasa's REST channel, so it
* should end in {@code /webhooks/rest/webhook} (as of Rasa 2.0).
* </li>
* </ul>
*
* @param rasaCoreUrl URL to the Rasa Core server. The Rasa Core
* component is designed to use Rasa's REST channel, so the URL
* should end in {@code /webhooks/rest/webhook} (as of Rasa 2.0).
* @return the updated builder
*/
public Builder useRasaCore() {
public Builder useRasaCore(String rasaCoreUrl) {
this.setProperty("rasa-core-url", rasaCoreUrl);
this.nluBuilder.setServiceClass(RasaCoreNLU.class.getName());
this.dialogueBuilder
.withDialoguePolicy(RasaDialoguePolicy.class.getName());
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/spokestack/spokestack/rasa/RasaCoreNLU.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
*
* <p>
* This component is designed to be used with a {@link io.spokestack.spokestack.dialogue.DialogueManager}
* built with a {@link RasaDialoguePolicy} policy, the latter of which expects
* results in the format just described and converts the Rasa responses into TTS
* built with a {@link RasaDialoguePolicy} policy, which expects results in
* the format just described and converts the Rasa responses into TTS
* prompts or app events as appropriate.
* </p>
*
* <p>
* This component requires the following configuration property:
* This component supports the following configuration properties:
* </p>
* <ul>
* <li>
* <b>rasa-core-url</b> (string, required): URL to the Rasa core NLU
* <b>rasa-core-url</b> (string, required): URL to the Rasa core
* server. This component is designed to use Rasa's REST channel, so it
* should end in {@code /webhooks/rest/webhook} (as of Rasa 2.0).
* </li>
Expand Down

0 comments on commit f0ce463

Please sign in to comment.