public IStreamingCall <IWhisperFormResponse> FormAsync(WhisperForm message, CancellationToken cancellationToken = default) { var request = Builder.BuildRequest(message, CreateSession()); var call = Client.WhisperForm(request, CreateOptions(cancellationToken)); var loggedParser = LoggedParser <WhisperFormStreamResponse, IWhisperFormResponse>(response => Parser.ParseResponse(response)); return(new StreamingCall <WhisperFormStreamResponse, IWhisperFormResponse>(call, loggedParser)); }
public WhisperFormRequest BuildRequest(WhisperForm formRequest, Proto.Session session) { var request = new WhisperFormRequest { Session = session, CancelLabel = formRequest.CancelLabel ?? "Cancel", Markdown = formRequest.Markdown ?? "Markdown", Meta = BuildMeta(formRequest.Config), SubmitLabel = formRequest.SubmitLabel ?? "Submit", }; BuildInputs(request.Inputs, formRequest.Inputs); return(request); }