Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize translation #446

Merged
merged 1 commit into from
May 9, 2024
Merged
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
Expand Up @@ -11,6 +11,7 @@ public class TranslationResponseHook : ConversationHookBase
{
private readonly IServiceProvider _services;
private readonly IConversationStateService _states;
private const string AIAssistant = "01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a";

public TranslationResponseHook(IServiceProvider services,
IConversationStateService states)
Expand All @@ -22,7 +23,7 @@ public override async Task OnResponseGenerated(RoleDialogModel message)
{
// Handle multi-language for output
var agentService = _services.GetRequiredService<IAgentService>();
var router = await agentService.LoadAgent(message.CurrentAgentId);
var router = await agentService.LoadAgent(AIAssistant);
var translator = _services.GetRequiredService<ITranslationService>();
var language = _states.GetState("language", LanguageType.ENGLISH);
if (language != LanguageType.UNKNOWN && language != LanguageType.ENGLISH)
Expand Down