Skip to content

Commit

Permalink
chore: improve translating prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Nov 30, 2023
1 parent e13a2b3 commit 017e2e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jarvis"
version = "1.1.9"
version = "1.1.10"
edition = "2021"
rust-version = "1.64"
description = ""
Expand Down
2 changes: 1 addition & 1 deletion src/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl OpenAI {

let system_message = ChatCompletionRequestMessageArgs::default()
.role(Role::System)
.content(format!("Guidelines:\n- Become proficient in {languages}.\n- Instead of prompts, user input is a valid two-dimensional JSON array containing the texts to be translated, the output should follow this array structure.\n- Contextual definition: {context}\n- Translate the texts in JSON into {target_lang}, ensuring you preserve the original meaning, tone, style, format, Return only the translated result in a valid JSON array."))
.content(format!("Guidelines:\n- Become proficient in {languages}.\n- Instead of prompts, user input is a valid two-dimensional JSON array containing the texts to be translated, the output should follow this array structure.\n- Contextual definition: {context}\n- Translate the texts in JSON into {target_lang}, ensuring you preserve the original meaning, tone, style, format, Return only the full translated result without omission in JSON."))
.build().map_err(HTTPError::with_500)?;

let system_messages: Vec<ChatCompletionRequestMessage> = vec![&system_message]
Expand Down

0 comments on commit 017e2e8

Please sign in to comment.