Skip to main content

sources

Creates, updates, deletes, gets or lists a sources resource.

Overview

Namesources
TypeResource
Idazure.ai_language.sources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
contentStructureKindstringContent structure type for sources. "unstructured" (unstructured)
displayNamestringFriendly name of the Source.
lastUpdatedDateTimestring (date-time)Date-time when the QnA was last updated.
sourcestringUnique source identifier. Name of the file if it's a 'file' source; otherwise, the complete URL if it's a 'url' source. Required.
sourceKindstringSupported source types. Required. Known values are: "file" and "url". (file, url)
sourceUristringURI location for the file or url. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_sourcesselectproject_name, endpointtop, skip, maxpagesizeGets all the sources of a project.
update_sourcesupdateproject_name, endpoint, op, valueUpdates the sources of a project.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client Endpoint parameter. (default: )
project_namestringThe name of the project to use. Required.
maxpagesizeinteger
skipintegerAn offset into the collection of the first resource to be returned. Default value is None.
topintegerThe maximum number of resources to return from the collection. Default value is None.

SELECT examples

Gets all the sources of a project.

SELECT
contentStructureKind,
displayName,
lastUpdatedDateTime,
source,
sourceKind,
sourceUri
FROM azure.ai_language.sources
WHERE project_name = '{{ project_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND top = '{{ top }}'
AND skip = '{{ skip }}'
AND maxpagesize = '{{ maxpagesize }}'
;

UPDATE examples

Updates the sources of a project.

UPDATE azure.ai_language.sources
SET
op = '{{ op }}',
value = '{{ value }}'
WHERE
project_name = '{{ project_name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND op = '{{ op }}' --required
AND value = '{{ value }}' --required;