AILanguageQuestionAnsweringAuthoringModelFactory.KnowledgeBaseFile Method

Definition

Initializes a new instance of KnowledgeBaseFile.

public static Azure.AI.Language.QuestionAnswering.Authoring.KnowledgeBaseFile KnowledgeBaseFile(string contentType = default, string filename = default, BinaryData contents = default);
static member KnowledgeBaseFile : string * string * BinaryData -> Azure.AI.Language.QuestionAnswering.Authoring.KnowledgeBaseFile
Public Shared Function KnowledgeBaseFile (Optional contentType As String = Nothing, Optional filename As String = Nothing, Optional contents As BinaryData = Nothing) As KnowledgeBaseFile

Parameters

contentType
String

The allowed media (MIME) types of the file contents.

In file bodies, this value comes from the Content-Type header of the request or response. In JSON bodies, this value is serialized as a field in the response.

NOTE: this is not necessarily the same as the Content-Type header of the request or response, but it will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the contents of the file, and not necessarily the way the file itself is transmitted or serialized.

filename
String

The name of the file, if any.

In file bodies, this value comes from the filename parameter of the Content-Disposition header of the response or multipart payload. In JSON bodies, this value is serialized as a field in the response.

NOTE: By default, filename cannot be sent in request payloads and can only be sent in responses and multipart payloads, as the Content-Disposition header is not valid in requests. If you want to send the filename in a request, you must extend the File model and override the filename property with a different location defined by HTTP metadata decorators.

contents
BinaryData

The contents of the file.

In file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies, this value is serialized as a field in the response.

Returns

A new KnowledgeBaseFile instance for mocking.

Applies to