Ask a question for the project

Our Chat allows the user to communicate with your OtniMind through a simple API call.

Submit a question related to the project and get a response.

"omni_key" is the private key.
You can generate a personal key in your profile settings on the platform. Instructions on how to do this can be found here > API key
"query" – Please type in the question you would like to ask.

Prompt:
"formatting"This custom format can return paragraphs, JSON, or with emoticons.

Example: “subheaders/emojis/bold main keywords/subheaders/bullet points format”
"tone" Sets the tone for formal and informal communication.

Example: “creative/formal/informal/persuasive/collaborative/creative”
"role": for instance”AI adviser/Professor/Sales assistant/William Shakespeare. etc”

custom" this is the custom prompt itself; if something is transmitted here, then the formatting of tone and role is disabled. This parameter overrides them.
"mostLikely" is how to respond if the bot does not know the answer.
"answerLength" Represents the length of the response in characters.

"doubts" You can define custom actions in case the bot is uncertain about the answer. If you include a specific tag (for example, {doubts}) in your query, the chat can then trigger an API request, send an email, or redirect the query to another messaging platform (such as a live agent).”

"followups" is an instruction for the bot to display additional questions that can facilitate the continuation of the conversation.
Example questions:

  1. What other information do you need?
  2. Can I assist you with anything else?
  3. Would you like to explore any related topics?

These messages can be displayed on the UI with a delay of 5 seconds. If the person does not write anything, the bot can automatically insert these messages into the chat window.



"language" we support many languages, please indicate which one you use in your project.
Specify the language in code format en/es/ua/de…

"limit" – sets the number of context chunks that are sent to the model for analysis and response formation. The default value is 4.

"offset" – used for pagination of the response on the backend. By default, it is not used.

/rest/v1/projects/{id}/actions/ask/
Example
{
  "query": "What is JS?",
  "omni_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNGFiNDUyYTMtNGMwYi00MTIyLWI3NDgtYzk4MWRiN2VlYWFlIiwiZGVmYXVsdFJvbGUiOiJ1c2VyIiwiYWxsb3dlZFJvbGVzIjpbInVzZXIiLCJtZSJdfSwiaWF0IjoxNzE0MzgxNzM4LCJleHAiOjE3NDU5MzkzMzgsInN1YiI6IjRhYjQ1MmEzLTRjMGItNDEyMi1iNzQ4LWM5ODFkYjdlZWFhZSJ9.EFa4TEFmXrSdUX7X6rrfbFSy2xP78YEhHSRWUid9hMo",
    "prompt": {
    "formatting": "subheaders",
    "tone": "creative",
    "role": "Professor",
    "custom": "string",
    "mostLikely": "string",
    "answerLength": 0,
    "history": "string",
    "doubts": "string",
    "followups": "string"
  },
  "language": "en",
  "hybrid": 0,
  "limit": 0,
  "offset": 0
}
Schema
{
  "query": "string",
  "omni_key": "string",
  "prompt": {
    "formatting": "string",
    "tone": "string",
    "role": "string",
    "custom": "string",
    "mostLikely": "string",
    "answerLength": 0,
    "history": "string",
    "doubts": "string",
    "followups": "string"
  },
  "language": "string",
  "hybrid": 0,
  "limit": 0,
  "offset": 0,
  "where": "string"
}
Example
{
    "results": [
        {
            "text": "JS, or JavaScript, is a programming language commonly used for creating interactive and dynamic content on websites. It is often used in conjunction with HTML and CSS to add functionality and interactivity to web pages."
        }
    ]
}
Schema
{
  "sources": [
    [
      {
        "title": "string",
        "pageContent": "string",
        "url": "string",
        "updatedAt": "string",
        "score": "string"
      }
    ]
  ],
  "results": [
    {
      "text": "string"
    }
  ]
}
Was this article helpful to you? Yes No

How can we help?