Skip to main content

Semantic Context


Semantic Context

The Semantic Context module provides functions to modify and retrieve the semantic context.

Modifying the Semantic Context

This function allows you to modify the semantic context by adding or deleting semantic statements.

public ModifySemanticContextResponse modifySemanticContext(ModifySemanticContextRequest params) 
throws IOException;

Parameters:

  • params (required): An instance of ModifySemanticContextRequest containing the modify semantic context request parameters.
    • updated (optional): An array of SemanticStatement objects representing the updated semantic statements.
    • deleted (optional): An array of strings representing the IDs of the semantic statements to be deleted.

Returns:

A ModifySemanticContextResponse object containing the updated and deleted semantic statements.

The ModifySemanticContextResponse object represents the response of the "modify semantic context" operation and contains the following fields:

  • updated (optional): An array of SemanticStatement objects representing the semantic statements that have been updated as a result of the operation. Each SemanticStatement object may contain the following fields:

    • id: A string representing the unique identifier of the semantic statement.
    • scope: A string representing the scope of the semantic statement.
    • statement: A string representing the semantic statement itself.
    • labels: An array of strings representing the labels associated with the semantic statement.
    • alwaysInclude: A boolean indicating whether the semantic statement should always be included.
    • lookupSummaries: An array of strings representing the lookup summaries associated with the semantic statement.
    • summarizationPrompt: A string representing the summarization prompt associated with the semantic statement.
  • deleted (optional): An array of strings representing the IDs of the semantic statements that have been deleted as a result of the operation.

Retrieving the Semantic Context

This function allows you to retrieve the current semantic context.

public GetSemanticContextResponse getSemanticContext(GetSemanticContextRequest params) 
throws IOException;

Parameters:

  • params (optional): An instance of GetSemanticContextRequest containing the get semantic context request parameters.

GetSemanticContextRequest Represents the request to get the semantic context, including optional filter, search text, offset, and limit parameters.

  • filter: A GetSemanticContextRequestFilter object to filter the semantic statements.
  • searchText: A string to search within the semantic statements.
  • offset: An integer representing the offset for pagination.
  • limit: An integer representing the maximum number of semantic statements to return.

GetSemanticContextRequestFilter can be used to limit the items returned from the call.

  • labels: An array of strings representing the labels to filter by.
  • scope: A string representing the scope to filter by.
  • statement: A string representing the statement to filter by.
  • alwaysInclude: A boolean indicating whether to only return alwaysInclude true / false statements.

Returns:

A GetSemanticContextResponse object containing the semantic statements.

The GetSemanticContextResponse object represents the response of the "get semantic context" operation and contains the following field:

  • semanticContext (optional): An array of SemanticStatement objects representing the semantic statements retrieved from the server. Each SemanticStatement object may contain the following fields:
    • id (optional): A string representing the unique identifier of the semantic statement.
    • scope (required): A string representing the scope of the semantic statement.
    • statement (required): A string representing the semantic statement itself.
    • labels (optional): An array of strings representing the labels associated with the semantic statement.