• This function exists as an alternative to the topic+message resource pattern where our Trieve handles chat memory. With this endpoint, the user is responsible for providing the context window and the prompt and the conversation is ephemeral.

    Example:

    const data = await trieve.ragOnChunk({
    chunk_ids: ["d290f1ee-6c54-4b01-90e6-d701748f0851"],
    prev_messages: [
    {
    content: "How do I setup RAG with Trieve?",
    role: "user",
    },
    ],
    prompt:
    "Respond to the instruction and include the doc numbers that you used in square brackets at the end of the sentences that you used the docs for:",
    stream_response: true,
    });

    Parameters

    Returns Promise<string>