/// <summary> Updates a message synchronously. </summary> /// <param name="options"> Options for the message. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> /// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception> public virtual Response UpdateMessage(UpdateChatMessageOptions options, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatThreadClient)}.{nameof(UpdateMessage)}"); scope.Start(); try { return(_chatThreadRestClient.UpdateChatMessage(Id, options.MessageId, options.Content, options.Metadata ?? new Dictionary <string, string>(), cancellationToken)); } catch (Exception ex) { scope.Failed(ex); throw; } }
/// <summary> Updates a message asynchronously. </summary> /// <param name="messageId"> The message id. </param> /// <param name="content"> Chat message content. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> /// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception> public virtual Response UpdateMessage(string messageId, string content, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatThreadClient)}.{nameof(UpdateMessage)}"); scope.Start(); try { return(_chatThreadRestClient.UpdateChatMessage(Id, messageId, content, cancellationToken)); } catch (Exception ex) { scope.Failed(ex); throw; } }