🎥Tess AI | Complete Tutorial to Unveil Tess AI's Responses and Build its Parameters via API🗒️

How does each parameter of Tess AI work in its API calls? Understand the meaning of the data returned by Tess AI when triggering an agent via API and make the most of our platform's functionalities and integrations!

 

Learn about every element present in the API response, from IDs and statuses to agent settings and input parameters!

Exploring a Practical Example

To illustrate the structure of the API response, we will execute a practical example in n8n, a visual automation tool. For this, we configure an HTTP Request node with the agent ID, the API access token, and a generic question: "How to make a pie?"

When executing this request, Tess AI returns a series of information that may seem confusing at first glance. Let’s demystify each of these elements:

Understanding the Elements of the API Response

  • ID:

    • This field represents the unique identifier of the response generated by Tess AI.

    • By storing this ID, it is possible to retrieve the specific response to "how to make a pie" later.

    • The response ID serves as a pointer to the content generated in response to a specific request.

  • Status:

    • The "status" field indicates the state of the request.

    • A status like "started" signals that Tess AI has received the request and started generating the response.

    • This field helps track the request lifecycle, from initiation to completion.

  • Input:

    • The "input" field mirrors the question or instruction sent to the agent.

    • In our example, the input would be "how to make a pie".

    • This field ensures that the request was processed with the correct input.

  • Output:

    • Initially, the "output" field may be blank, especially if the "Wait Execution" configuration is not enabled.

    • The output will contain the response generated by the Tess AI agent.

    • The response can include a step-by-step guide on how to make a pie, a detailed recipe, or any other relevant content.

  • Credits Consumed:

    • This field indicates the number of credits consumed to generate the response.

    • Although the platform may indicate an "unlimited" model, using the API involves computational costs for processing the request and generating the response.

    • Credit consumption is generally low but may vary depending on the complexity of the question and the amount of text involved. Requests with longer texts tend to consume more credits.

  • Root ID (Chat ID):

    • This field is crucial for maintaining the context of ongoing conversations.

    • The Root ID represents the unique identifier of the ongoing conversation, while the response ID refers only to a specific response within that conversation.

    • Practical Example: Imagine you ask "How to make a pie?" and then ask "What is the ideal oven temperature?". For the agent to understand that the second question refers to the pie, it is crucial to send the Root ID of the original conversation.

    • Without the Root ID, each new question is treated as an isolated conversation, with no memory of the previous context.

  • Creation and Update Dates:

    • These fields indicate when the response was created and when it was last updated.

    • This information is useful for auditing, data analysis, and tracking the history of interactions with the agent.

    • These dates can be used to query the database and identify responses created within a certain period.

  • Agent Settings:

    • This section reflects the settings defined when creating the agent in Tess AI, such as tone of voice, temperature, and language model.

    • Tone of Voice: Defines the agent's communication style (formal, informal, friendly, etc.).

    • Temperature: Controls the randomness and creativity of the responses.

      • Lower temperatures (near zero) make responses more systematic, precise, and less creative. The agent sticks more to facts and avoids digressions.

      • Higher temperatures make responses more creative, imaginative, and capable of making unexpected associations. However, responses with very high temperatures may stray from the original topic.

    • Language Model: Specifies the language model to be used by the agent (e.g., GPT-3, GPT-4).

    • Agent settings can be pre-defined or dynamically altered via API.

  • Input (Via API):

    • This section shows the parameters sent via API, such as temperature, language model, and the message itself.

    • These parameters can be defined when creating the agent or when sending the request via API.

    • The flexibility of defining parameters via API allows real-time customization of the agent's behavior according to the specific needs of each interaction.

  • Wait Execution:

    • This parameter determines whether the API should wait until the response is generated before returning.

    • If enabled (true), the API returns the complete response as soon as it is ready.

    • If disabled (false), the API may return an initial status, and the response will be generated in the background.

    • The choice between waiting or not for the response depends on the real-time requirements of the application.

Defining Parameters: Pre-Defined vs. Dynamic

It is possible to define the agent's parameters either at the time of agent creation in Tess AI or during the API request. The choice between these approaches depends on the use case:

  • Pre-Defined: If most interactions with the agent require the same configurations, it is more efficient to define them at the time of agent creation. This simplifies API requests, making them more concise.

  • Dynamic: If it is necessary to adjust the agent's parameters in real time according to the needs of each interaction, it is better to send them via API. This provides greater flexibility and control over the agent's behavior.

The Importance of Wait Execution

The parameter Wait Execution controls whether the API should wait for the full generation of the response before returning the data.

  • Wait Execution = true: The API waits for the response to be generated and returns all data, including the output, as soon as it is ready. This ensures that you receive the complete response immediately.

  • Wait Execution = false: The API immediately returns an initial status without waiting for the response to be generated. This can be helpful in scenarios where the response is not required in real-time, allowing the generation to occur in the background.

Integrating Data into n8n

Understanding the structure of the Tess AI API's response allows you to efficiently integrate this data into n8n. You can use the response schema to map fields and use them in other workflow nodes. For example, you can extract the text from the response (output) and send it to a Slack channel, save it to a database, or use it as input for another agent.

Conclusion

Mastering the details of the Tess AI API's response is essential for building robust, customized, and efficient integrations. By understanding the meaning of each field, from IDs and statuses to agent configurations and the Wait Execution parameter, you will be prepared to extract the maximum value from the platform and create innovative applications with artificial intelligence.