Query a large language model (LLM) - Fluid Topics - Latest

Fluid Topics API Reference Guide

Reference Guides

This web service allows users with the GENERATIVE_AI_USER role to query a large language model (LLM). This web service relies on the use of Generative AI profiles.

For more information about Generative AI profiles, see Generative AI.

This web service is available to all user roles.

Method Endpoint
POST /api/ai/generate

Request example

The f37323eb-5e72-402f-be99-ab53a46cca29 Generative AI profile contains the following prompt:

What are the benefits of the {first_format} authoring format versus the {second_format} authoring format?

An example JSON request body for this Generative AI profile would be:

    "profileId": "f37323eb-5e72-402f-be99-ab53a46cca29",
    "parameters": {
        "first_format": "AsciiDoc",
        "second_format": "DITA"
Field Type Required? Description
profileId String Yes A Generative AI profile ID.
parameters Object No An object allowing users to set values for the variables inserted into the prompt of the Generative AI profile.

Response body

The following codeblock shows an example response to this web service. It is a stream of server-side events, from first received to last received.

{"message":"1. Asc"}
{"message":"iiDoc is"}
{"message":" a lightweight"}
{"message":" and"}
{"message":" easy-to-"}
{"message":"learn authoring"}
{"message":" format compared to"}
{"message":" DITA,"}
{"message":" which has a"}
{"message":" steeper learning"}
{"message":" curve. This"}
{"message":" makes Ascii"}
{"message":"Doc more accessible"}
{"message":" to a wider"}
{"message":" range of users"}
{"message":", including non"}
{"message":"-technical writers"}
{"message":" AsciiDoc"}
{"message":" allows for simpler"}
{"message":" and more flexible"}
{"message":" content structuring"}
{"message":", as it"}
{"message":" uses a plain"}
{"message":" text format with"}
{"message":" minimal markup."}
{"message":" On the other"}
{"message":" hand, D"}
{"message":"ITA has a"}
{"message":" complex XML-based"}
{"message":" structure that requires"}
{"message":" more effort"}
{"message":" to"}
{"message":" create and maintain"}
{"message":" AsciiDoc"}
{"message":" supports a wide"}
{"message":" range of output"}
{"message":" formats, including"}
{"message":" HTML, PDF"}
{"message":", EPUB"}
{"message":", and more"}
{"message":", making it"}
{"message":" suitable for various"}
{"message":" publishing needs."}
{"message":" DITA also"}
{"message":" supports multiple output"}
{"message":" formats, but"}
{"message":" its focus is"}
{"message":" primarily on XML"}
{"message":"-based documentation.\n"}
{"message":"4. Asc"}
{"message":"iiDoc offers"}
{"message":" a more streamlined"}
{"message":" and"}
{"message":" efficient author"}
{"message":"ing experience,"}
{"message":" as it allows"}
{"message":" for quick editing"}
{"message":" and previewing"}
{"message":" of content without"}
{"message":" the need for"}
{"message":" complex tooling"}
{"message":". DITA"}
{"message":", on the"}
{"message":" other hand,"}
{"message":" often requires specialized"}
{"message":" authoring tools"}
{"message":" and workflows.\n"}
{"message":"5. Asc"}
{"message":"iiDoc has"}
{"message":" a vibrant and"}
{"message":" active community,"}
{"message":" with a wide"}
{"message":" range of plugins"}
{"message":", extensions,"}
{"message":" and integrations"}
{"message":" available. This"}
{"message":" makes it easier"}
{"message":" to find support"}
{"message":", share knowledge"}
{"message":", and extend"}
{"message":" the capabilities of"}
{"message":" AsciiDoc"}
{"message":". While D"}
{"message":"ITA also has"}
{"message":" a community,"}
{"message":" it may be"}
{"message":" more specialized and"}
{"message":" focused"}
{"message":" on specific"}
{"message":" industries"}
{"message":" or use"}
{"message":" cases"}
Field Type Description
id String The unique identifier for the chat.
message String A part of the answer from the large language model.
Return code Description
200 OK The web service returns a stream of server-side events in JSON format.
401 UNAUTHORIZED Authentication failed on chosen large language model provider.

For a comprehensive list of all possible return codes, see Return codes.