Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) Richasy. All rights reserved.
// Modified 2026-10-21 by Codex: complete the existing PR correction.

using Richasy.AgentKernel.Models;
using RodelAgent.Interfaces;
Expand Down Expand Up @@ -30,23 +31,26 @@ private async Task StartAudioAsync()
try
{
_audioCts = new CancellationTokenSource();
var provider = SelectedService!.ProviderType;
var text = Text;
var model = SelectedModel?.Data.Id;
var options = new AudioOptions
{
ModelId = SelectedModel?.Id,
LanguageCode = SelectedLanguage?.Code,
VoiceId = SelectedVoice?.Data.Id,
Speed = 1.0,
};
var result = await _audioService!.Client!.TextToSpeechAsync(Text, options, _audioCts.Token);
var result = await _audioService!.Client!.TextToSpeechAsync(text, options, _audioCts.Token);
var record = new AudioRecord
{
Id = Guid.NewGuid().ToString("N"),
Text = Text,
Text = text,
Speed = options.Speed,
Voice = SelectedVoice?.Data.Id,
Model = SelectedModel?.Data.Id,
Voice = options.VoiceId,
Model = model,
Time = DateTimeOffset.Now,
Provider = SelectedService!.ProviderType,
Provider = provider,
};

await this.Get<IStorageService>().AddOrUpdateAudioSessionAsync(record, result.ToArray());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) Richasy. All rights reserved.
// Modified 2026-10-21 by Codex: complete the existing PR correction.

using Richasy.AgentKernel.Models;
using RodelAgent.Interfaces;
Expand Down Expand Up @@ -30,21 +31,25 @@ private async Task StartDrawAsync()
try
{
_drawCts = new CancellationTokenSource();
var provider = SelectedService!.ProviderType;
var prompt = Prompt;
var model = SelectedModel?.Data.Id;
var size = SelectedSize?.Data;
var options = new DrawOptions
{
ModelId = SelectedModel?.Id,
Width = SelectedSize?.Data.Width,
Height = SelectedSize?.Data.Height,
Width = size?.Width,
Height = size?.Height,
};
var result = await _drawService!.Client!.DrawAsync(Prompt, options, _drawCts.Token);
var result = await _drawService!.Client!.DrawAsync(prompt, options, _drawCts.Token);
var record = new DrawRecord
{
Id = Guid.NewGuid().ToString("N"),
Prompt = Prompt,
Size = SelectedSize?.Data,
Model = SelectedModel?.Data.Id,
Prompt = prompt,
Size = size,
Model = model,
Time = DateTimeOffset.Now,
Provider = SelectedService!.ProviderType,
Provider = provider,
};

await this.Get<IStorageService>().AddOrUpdateDrawSessionAsync(record, result.ToArray());
Expand Down