AI

Analyze a natural language prompt and determines which topic in the model is the best fit for answering the question.

Useful as a preprocessing step before calling the Generate AI query or Create AI job endpoints, especially when the user's question could relate to multiple topics.

post/v1/ai/pick-topic

Request

  • Base URL
    https://blobsrus.omniapp.co/api
  • URL
    https://blobsrus.omniapp.co/api/v1/ai/pick-topic
  • Auth
    HTTP bearer

Request body

branchIdstring

Optional branch ID for the model. Must be a branch of the shared model specified by modelId.

currentTopicNamestring

Ignored by this endpoint. Pick topic always lets AI choose the topic.

modelIdstring uuid required

The UUID of the shared model to query against. Note that:

  • Only shared models are supported
  • The user must have Querier permissions or higher on the model
potentialTopicNamesstring[]

Optional list of topic names to limit consideration to. If not provided, all topics the user has access to in the model will be evaluated.

promptstring required

The natural language prompt to analyze. The AI will determine which topic best matches the data described in this prompt.

userIdstring uuid

User ID to evaluate topic access as. Their permissions will be used for permission-aware topic selection. AI credit checks and usage attribution also apply to this user (including their embed entity, if any) rather than the API key holder.

Only valid with Organization API keys. PATs always act as the authenticated user.

Example request

{
  "branchId": "550e8400-e29b-41d4-a716-446655440000",
  "currentTopicName": "order_items",
  "modelId": "770e8400-e29b-41d4-a716-446655440002",
  "potentialTopicNames": [
    "order_items",
    "customers",
    "products"
  ],
  "prompt": "How many orders were placed last month?",
  "userId": "990e8400-e29b-41d4-a716-446655440004"
}

Response

Topic selected successfully. The returned topicId can be used as the topicName parameter in other AI endpoints.

topicIdstring required

The name of the topic that best matches the prompt.

Use this as the topicName parameter when calling the Generate a query or the Create AI job endpoints.

Example response

{
  "topicId": "order_items"
}

Changes

    • warning

      removed the request property

    • info

      the request property format was generalized from uuid to no format

    • info

      added the non-success response with the status