AgentSessionFiles.UploadSessionFile Method

Definition

Upload a file to the session sandbox via binary stream. Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public System.ClientModel.ClientResult<Azure.AI.Projects.Agents.SessionFileWriteResponse> UploadSessionFile(string agentName, string sessionId, string sessionStoragePath, string localPath, System.Threading.CancellationToken cancellationToken = default);
member this.UploadSessionFile : string * string * string * string * System.Threading.CancellationToken -> System.ClientModel.ClientResult<Azure.AI.Projects.Agents.SessionFileWriteResponse>
Public Function UploadSessionFile (agentName As String, sessionId As String, sessionStoragePath As String, localPath As String, Optional cancellationToken As CancellationToken = Nothing) As ClientResult(Of SessionFileWriteResponse)

Parameters

agentName
String

The name of the agent.

sessionId
String

The session ID.

sessionStoragePath
String

The destination file path within the sandbox, relative to the session home directory.

localPath
String

The path to the local file to be uploaded.

cancellationToken
CancellationToken

Returns

The response returned from the service.

Exceptions

agentName, sessionId, localPath or sessionStoragePath is null.

agentName, sessionId, localPath or sessionStoragePath is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to