Table of Contents

Class RetrievalRequest

Namespace
PnP.Core.Model.Copilot.Public.DTO
Assembly
PnP.Core.dll

Represents a request to retrieve relevant text extracts from specified data sources using a natural language query and optional filtering or configuration parameters.

public class RetrievalRequest
Inheritance
RetrievalRequest
Inherited Members

Remarks

Use this class to specify the parameters for retrieving content from supported sources such as SharePoint, OneDrive for Business, or Copilot connectors. Configure the query, data source, and optional metadata or filtering to tailor the retrieval to your application's needs. Ensure that required properties are set before submitting the request. The class supports limiting the number of results and customizing the metadata returned for each item.

Properties

DataSource

Indicates whether extracts should be retrieved from SharePoint, OneDrive, or Copilot connectors. Acceptable values are sharePoint, oneDriveBusiness, and externalItem. Required.

[JsonPropertyName("dataSource")]
public string DataSource { get; set; }

Property Value

string

DataSourceConfiguration

Contains additional configuration information for applicable data sources. dataSourceConfiguration includes an object called externalItem, where you can configure Copilot connectors retrieval. Optional.

[JsonPropertyName("dataSourceConfiguration")]
public DataSourceConfiguration? DataSourceConfiguration { get; set; }

Property Value

DataSourceConfiguration

FilterExpression

Keyword Query Language (KQL) expression with queryable SharePoint, OneDrive, or Copilot connectors properties and attributes to scope the retrieval before the query runs.

[JsonPropertyName("filterExpression")]
public string? FilterExpression { get; set; }

Property Value

string

MaximumNumberOfResults

The number of results that are returned in the response. Must be between 1 and 25. By default, returns up to 25 results. Optional.

[JsonPropertyName("maximumNumberOfResults")]
public int MaximumNumberOfResults { get; set; }

Property Value

int

QueryString

Natural language query string used to retrieve relevant text extracts. This parameter has a limit of 1,500 characters. Your queryString should be a single sentence, and you should avoid spelling errors in context-rich keywords. Required

[JsonPropertyName("queryString")]
public string QueryString { get; set; }

Property Value

string

ResourceMetadata

A list of metadata fields to be returned for each item in the response. Only retrievable metadata properties can be included in this list. By default, no metadata is returned. Optional.

[JsonPropertyName("resourceMetadata")]
public List<string>? ResourceMetadata { get; set; }

Property Value

List<string>