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

Explain file in the user-set language #1259

Merged
merged 1 commit into from
Apr 23, 2024
Merged
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
Expand Up @@ -249,6 +249,7 @@ const ChatPersistentState = ({
}
queryParams.line_start = options.lines[0].toString();
queryParams.line_end = options.lines[1].toString();
queryParams.q = query;
} else {
queryParams.q = query;
}
Expand Down Expand Up @@ -480,7 +481,7 @@ const ChatPersistentState = ({
const [lineStart, lineEnd] = ending.split('-');
const filePath = prefix.slice(9);
userQuery = t(
`Explain the purpose of the file {{filePath}}, from lines {{lineStart}} - {{lineEnd}}`,
`Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}`,
{
lineStart: Number(lineStart) + 1,
lineEnd: Number(lineEnd) + 1,
Expand Down
3 changes: 2 additions & 1 deletion client/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,5 +537,6 @@
"Simplified": "Simplified",
"Recommended: The classic input": "Recommended: The classic input",
"Fallback: Use if experiencing problems with the default one": "Fallback: Use if experiencing problems with the default one",
"Add multiple files": "Add multiple files"
"Add multiple files": "Add multiple files",
"Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}": "Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}"
}
4 changes: 3 additions & 1 deletion client/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,5 +536,7 @@
"Select the input type to use in conversations": "Seleccione el tipo de entrada a usar en conversaciones",
"Default": "Por defecto",
"Recommended: The classic input": "Recomendado: la entrada clásica",
"Add multiple files": "Agregar varios archivos"
"Add multiple files": "Agregar varios archivos",
"Simplified": "Simplificada",
"Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}": "Explique las líneas {{lineStart}} - {{lineEnd}} en {{filePath}}"
}
3 changes: 2 additions & 1 deletion client/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -518,5 +518,6 @@
"Select the input type to use in conversations": "Seleziona il tipo di input da utilizzare nelle conversazioni",
"Recommended: The classic input": "Consigliato: l'ingresso classico",
"Conversation input": "Input di conversazione",
"Add multiple files": "Aggiungi più file"
"Add multiple files": "Aggiungi più file",
"Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}": "Spiega le righe {{lineStart}} - {{lineEnd}} in {{filePath}}"
}
4 changes: 3 additions & 1 deletion client/src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -523,5 +523,7 @@
"Default": "デフォルト",
"Recommended: The classic input": "推奨:クラシック入力",
"Conversation input": "会話の入力",
"Add multiple files": "複数のファイルを追加します"
"Add multiple files": "複数のファイルを追加します",
"Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}": "{{filePath}} の行 {{lineStart}} - {{lineEnd}} について説明します",
"Add to studio": "スタジオに追加します"
}
3 changes: 2 additions & 1 deletion client/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,5 +533,6 @@
"Select the input type to use in conversations": "选择要在对话中使用的输入类型",
"Default": "默认",
"Recommended: The classic input": "推荐:经典输入",
"Add multiple files": "添加多个文件"
"Add multiple files": "添加多个文件",
"Explain lines {{lineStart}} - {{lineEnd}} in {{filePath}}": "解释 {{filePath}} 中的 {{lineStart}} - {{lineEnd}} 行"
}
8 changes: 2 additions & 6 deletions server/bleep/src/webserver/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ pub struct Explain {
pub branch: Option<String>,
pub repo_ref: RepoRef,
pub conversation_id: Option<i64>,
pub q: String,
}

pub async fn explain(
Expand All @@ -403,12 +404,7 @@ pub async fn explain(

// We synthesize a virtual `/answer` request.
let virtual_req = Answer {
q: format!(
"Explain lines {} - {} in {}",
params.line_start + 1,
params.line_end + 1,
params.relative_path
),
q: params.q,
conversation_id: params.conversation_id,
parent_exchange_id: None,
answer_model: agent::model::GPT_4_TURBO_24K,
Expand Down
Loading