Methods
call(user, message, chatbot_id, user_id, mode, session_idopt, previous_messagesopt, bot_document_idsopt, context_document_idsopt, engineopt) → {Promise.<Object>}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
user |
string | The ID of the user accessing the Soffos API. This string will be used for throttling and profanity tracking. Soffos assumes that the owner of the api is an application (app) and that app has users. Soffos API will accept any string." | ||
message |
string | The user's message to the chatbot | ||
chatbot_id |
string | The chatbot's id. | ||
user_id |
string | A unique user id. It is recommended that your provide a UUID. | ||
mode |
string | The value can only be one of: open, closed, hybrid. | ||
session_id |
string |
<optional> |
null | A unique session id for mapping the records to your application. It is recommended that you provide a UUID. If not provided, the system will not store any information regarding the call and will use the value of "previous_messages" as the conversation history. |
previous_messages |
Array |
<optional> |
null | This field can be used to provide the conversation history. It is ignored if a "session_id" is provided, in which case the system will used the stored interactions from that session as conversation history. |
bot_document_ids |
Array |
<optional> |
null | Here you can specify documents that describe the bot's background and its perception of itself. |
context_document_ids |
Array |
<optional> |
null | Pass the ids of the documents that you wish to inform your bot with for the specific user/session. Applicable for closed and hybrid modes as described above. |
engine |
string |
<optional> |
null | The LLM engine to be used. |
- Source:
Returns:
response - The agent's response
session_name - The session's name which is generated after 3 interactions.
messages - A list of the conversation's messages so far.
context - The context that was made available to the agent for responding
to the user's last message.
- Type
- Promise.<Object>
Example
Examples are available at "https://github.com/Soffos-Inc/soffosai-js/tree/master/samples"
setInputConfigs(name, message, chatbot_id, user_id, mode, session_idopt, previous_messagesopt, bot_document_idsopt, context_document_idsopt, engineopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | Reference name of this Service. It will be used by the Pipeline to reference this Service. | ||
message |
string | InputConfig | The user's message to the chatbot | ||
chatbot_id |
string | InputConfig | The chatbot's id. | ||
user_id |
string | InputConfig | A unique user id. It is recommended that your provide a UUID. | ||
mode |
string | InputConfig | The value can only be one of: open, closed, hybrid. | ||
session_id |
string | InputConfig |
<optional> |
null | A unique session id for mapping the records to your application. It is recommended that you provide a UUID. If not provided, the system will not store any information regarding the call and will use the value of "previous_messages" as the conversation history. |
previous_messages |
Array | InputConfig |
<optional> |
null | This field can be used to provide the conversation history. It is ignored if a "session_id" is provided, in which case the system will used the stored interactions from that session as conversation history. |
bot_document_ids |
Array | InputConfig |
<optional> |
null | Here you can specify documents that describe the bot's background and its perception of itself. |
context_document_ids |
Array | InputConfig |
<optional> |
null | Pass the ids of the documents that you wish to inform your bot with for the specific user/session. Applicable for closed and hybrid modes as described above. |
engine |
string |
<optional> |
null | The LLM engine to be used. |
- Source: