Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To expose Reporting services to our system, we need an API to be exposed for the MediaHaven installation. When creating new Module Plugins having of the following https://mediahaven.atlassian.net/wiki/spaces/CS/pages/edit-v2/4438884395#Categories Plugin Category:

  • Business Intelligence

then MediaHaven will connect to this plugin using REST API calls, which must implement the following methods depending on the category.

Methods

GET /

...

info
Status
colourBlue
title

...

Business Intelligence

It gives the possible configuration parameters for this connector

Ex.

Code Block
languagejson
{
  "Rules": [
    {
      "Name": "TextModel",
      "Type": "String|Integer|Boolean",
      "Required": false,
      "Default" : "ada2"
    }
  ]
}

POST /text-embedding
Status
colourBlue
titleEMBEDDING

Expected parameters

Text as JSON body in Textproperty and Config based on config rules

Ex.

Code Block
languagejson
{
  "Text": "Given me pictures of lamas",
  "Dimensions": 1536,
  "Config": {
    "TextModel" : "ada2"
  }
}

basic info about this connector

Expected parameters

  • None

Expected headers

Code Block
x-api-key: <optional<reporting engine api key>

Output

...

Code Block

...

Ex.

Code Block
languagejson
{
  "EmbeddingReportingEngine": [ 
    -0.006929283495992422,
    -0.005336422007530928,
    ... (omitted for spacing)
    -4.547132266452536e-05,
    -0.024047505110502243]
}

POST /embedding
Status
colourBlue
titleEMBEDDING

Expected parameters

Record as JSON body in Metadata property and Config based on config rules

Ex.

Code Block
languagejson
{ 
 "Config": {     "TextModelName" : "ada2metabase"
  },
  "Metadata": {     "RightsManagementVersion": {
        "Permissions": {...},
        "RecordPhase": "Concept",
        "ExpiryDate": null,
        "ExpiryStatus": null,
        "Zone": {}
    },
    "Dimensions": 1536
  }
}

Expected headers

Code Block
x-api-key: <optional api key>

Output

Array of float (vector) with size equal to dimensions. The vector MUST BE normalized. When the provided dimensions are 0, the embedding should be in the natural dimensions used by the embedding. If the embeddings cannot be provided in the requested dimensions, then a 400 HTTP error code should be returned.

Ex.

Code Block
languagejson
{
  "Embedding": [ 
    -0.006929283495992422,
    -0.005336422007530928,
    ... (omitted for spacing)
    -4.547132266452536e-05,
    -0.024047505110502243]
}

...

0.51", 
  }
}

GET /reports
Status
colourBlue
title

...

Business Intelligence

Expected parameters

Record as JSON body in Metadata property and Config based on config rules

Ex.

...

languagejson

...

  • None

Expected headers

Code Block
x-api-key: <optional<reporting engine api key>

Output

Textual string

Ex.

Code Block
languagejson
{
  "DescriptionReportingEngine": "This is an image of a cat"
}

POST /generative-metadata
Status
colourBlue
titleGENERATIVE

Record as JSON body in Metadata property, Fields with as items dotted keys and AI hint as value, Locale as the requested target locale for the output and finally Config based on config rules

Ex.

Code Block
languagejson
{ 
 "Fields": {      "Descriptive.Description": {
      "Hint": "Give a description for the image"
     },
 "Name": "metabase",
   "Descriptive.Keywords.Keyword": {         "Hint"Version": "Give a list of keywords. Generate around 10.",
        "Type": "array"
     }
  0.51", 
  }, 
 "Locale": "en_US",
  "Config"Reports": {
    "TextModelEmbedUri" : "ada2"
  },
  "Metadata": {
    "RightsManagement": {
        "Permissions": {...},
   https://metabase/embedded/report/x/y/z"
    "RecordPhaseLastDataRefresh": "Concept",
        "ExpiryDate": null,
        "ExpiryStatus": null,
        "Zone": {}
    }
  }
}

Expected headers

Code Block
x-api-key: <optional api key>

Output

A JSON object of generated fields with as keys dotted keys and as value the AI's generated value.

Ex:

Code Block
languagejson
{ 
  "GeneratedFields": {
    "Descriptive.Description": "This is an image of a cat",
    "Descriptive.Keywords.Keyword": ["Animal", "Cat", ...]  2024-10-24T15:26:59Z"
  }
}