HomeGuidesRecipesAPI EndpointsRelease NotesCommunity
Log In
Guides

Understanding the Certara Generative AI Response

Introduction

In order to properly curate responses to your use case, the API response includes various values to to help tune prompts. This guide will cover the JSON response and what each value indicates.

Certara Generative AI Response

{
  'chunksUsed': [{
    'chunkId': string,
    'documentId': string,
    'text': string,
    'score': string, 
    'expandedText': string,
    'expandedScore': string,
    'keywordScoreContribution': integer,
    'vectorScoreContribution': integer,
    'paragraphId': integer,
    'provider': string 
  }],
  'content': string,
  'documentUsed': [{
    'id': string,
    'provider': string
}],
  'perplexity': integer,
  'sourcesUsed': [string]
}

chunkUsed

A list of dictionaries that contains all the chunks used in generating the response.

chunkId

A string indicating the vector store ID of the chunk.

documentId

A string indicating the Layar ID of the document the chunk came from.

text

A string containing the text of the chunk.

score

A string indicating the normalized score of the chunk.

expandedText

A string containing the text of the expanded chunk.

📘

Text and expandedText

Text is the original chunk text while expandedText is the chunk with additional text appended to the end of the original. This is done to ensure context isn't cut off.

expandedScore

A string indicating the normalized score of the expanded chunk.

keywordScoreContribution

An integer indicating the keyword score that is output by the vector store.

vectorScoreContribution

An integer indicating the vector score that is output by the vector store.

📘

Score Normalization

score and expandedScore are normalized using the search_ratio provided in the request. If you are interested in scores that more accurately show what the vector store is returning, use keywordScoreContribution and vectorScoreContribution.

🚧

Keyword and Vector Score Missing

You may see some chunks return with only a keyword or vector score. This occurs because the vector or keyword search doesn't find any relevant chunks.

paragraphId

A string indicating the Layar ID of the paragraph where the chunk was found.

provider

A string indicating the provider the document came from.

content

A string indicating the response to your prompt.

documentUsed

A list of dictionaries that contain the documents used to generate the response.

id

A string indicating the Layar ID of the document.

provider

A string indicating the provider the document came from.

perplexity

An integer indicating the confidence of the response generated by Certara Generative AI. The lower the number the more confident the AI is in the response.

sourcesUsed

A list of strings that contains all sources used to generate a response.