Conceptos clave

Mensajes

Los mensajes son los componentes fundamentales de cada conversación en NovaAI. Cada mensaje proporciona contexto al modelo, ayudándolo a comprender las instrucciones, mantener el historial de la conversación y generar respuestas precisas. Esta guía explica los roles de los mensajes, su estructura y las mejores prácticas para crear flujos de trabajo conversacionales efectivos.

What Are Messages?

Every interaction with a NovaAI chat model is represented as a sequence of messages. Rather than sending isolated prompts, you provide the conversation history, allowing the model to understand context and generate more relevant responses.

Each message includes a role and content, enabling the model to distinguish between system instructions, user input, and assistant responses.

Models do not retain memory between API requests. To preserve context, include the relevant conversation history in each request.

Models do not retain memory between API requests. To preserve context, include the relevant conversation history in each request.

Message Structure

Each message is represented as a simple object.

{
"role": "user",
"content": "Explain how vector databases work."
}

role

string

requerido

Defines who authored the message.

content

string

requerido

The text, instruction, or information sent to the model.

Message Roles

NovaAI supports three primary message roles.

Role

Purpose

system

Defines the assistant's behavior, personality, or operating instructions.

user

Represents input provided by the end user.

assistant

Contains responses previously generated by the model.

Using these roles correctly helps the model maintain consistency throughout a conversation.

Conversation Flow

Rendering diagram…

Each new request includes the conversation history, enabling the model to understand previous interactions.

Conversation Example

[
{
"role": "system",
"content": "You are a helpful technical assistant."
},
{
"role": "user",
"content": "What is an API?"
},
{
"role": "assistant",
"content": "An API allows different software applications to communicate with each other."
},
{
"role": "user",
"content": "Can you give me a real-world example?"
}
]

Notice how the model receives the previous assistant response along with the latest user message. This allows it to continue the conversation naturally.

Message Lifecycle

Rendering diagram…

Every conversation follows the same lifecycle regardless of the selected chat model.

Conversation History

A conversation grows over time as more messages are exchanged.

Rendering diagram…

Keeping relevant history improves contextual understanding while removing unnecessary messages helps reduce token usage.

Best Practices

  • Start every conversation with a clear system instruction.

  • Keep user messages focused on a single objective.

  • Include only relevant conversation history.

  • Remove outdated messages to reduce token usage.

  • Preserve important context for long-running conversations.

  • Separate unrelated topics into different conversations whenever possible.

Tip: Think of messages as the model's working memory. The more relevant and organized the conversation history, the better the generated responses.

Tip: Think of messages as the model's working memory. The more relevant and organized the conversation history, the better the generated responses.

Common Mistakes

Mistake

Impact

Recommendation

Missing system message

Inconsistent assistant behavior

Define clear instructions at the beginning.

Sending only the latest message

Model loses previous context

Include relevant conversation history.

Extremely long conversations

Increased latency and token usage

Periodically summarize or trim older messages.

Mixing multiple topics

Lower response quality

Keep conversations focused on one task.

Frequently Asked Questions

Does NovaAI remember previous conversations?

No. Each API request is processed independently. If you want the model to remember earlier messages, include them in the current request.

Should every request include a system message?

While not required, including a system message is strongly recommended because it establishes consistent behavior and improves response quality.

Can messages include images or files?

Yes. Multimodal models support image and file inputs. The exact message format depends on the endpoint and selected model.

Does NovaAI remember previous conversations?

No. Each API request is processed independently. If you want the model to remember earlier messages, include them in the current request.

Should every request include a system message?

While not required, including a system message is strongly recommended because it establishes consistent behavior and improves response quality.

Can messages include images or files?

Yes. Multimodal models support image and file inputs. The exact message format depends on the endpoint and selected model.

Important: Different models support different message types. Always verify that the selected model supports the content you're sending.

Important: Different models support different message types. Always verify that the selected model supports the content you're sending.

Next Step

Now that you understand how conversations are structured, continue to Tokens to learn how message length, conversation history, and model context affect token usage and overall API cost.

Documentación relacionada

¿Te resultó útil?

¿Te resultó útil?

Create a free website with Framer, the website builder loved by startups, designers and agencies.