Language picker on the onboarding welcome step; agents work in the app language
This commit is contained in:
1 parent
ea9418a6e0
commit
155c08b16d
4 files changed
+66
-5
No files matched your search
@@ -131,6 +131,7 @@ export class TaskExecutionService {
|
||||
const connectorNames = new ConnectorGrantsService(this.db)
|
||||
.toolkitsForAgent(orgId, agent.id)
|
||||
.map(connectorDisplayName);
|
||||
const language = this.appLanguage();
|
||||
const externalTools = await loadComposioTools(this.db, orgId, agent.id);
|
||||
const result = await runAgentLoop(
|
||||
{
|
||||
@@ -142,7 +143,7 @@ export class TaskExecutionService {
|
||||
orgId,
|
||||
providerId: provider.id,
|
||||
workspaceId: task.workspace_id,
|
||||
instructions: buildAgentInstructions({ agent, companyName: this.orgName(orgId), isCeo, hasReports, connectorNames }),
|
||||
instructions: buildAgentInstructions({ agent, companyName: this.orgName(orgId), isCeo, hasReports, connectorNames, language }),
|
||||
initialUserTurn: buildTaskPrompt({
|
||||
task,
|
||||
agent,
|
||||
@@ -418,6 +419,11 @@ export class TaskExecutionService {
|
||||
return row.name;
|
||||
}
|
||||
|
||||
private appLanguage(): "en" | "zh" {
|
||||
const row = this.db.prepare("select language from app_state where id = 1").get() as { language: string } | undefined;
|
||||
return row?.language === "zh" ? "zh" : "en";
|
||||
}
|
||||
|
||||
private completeRun(orgId: string, runId: string, providerRequestId: string): void {
|
||||
this.db.prepare(`
|
||||
update task_runs
|
||||
|
||||
Reference in new issue
Block a user