Skip to content

Commit c72a40a

Browse files
committed
Improve readibility
1 parent 0ab9cf0 commit c72a40a

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

aishell/query_clients/gpt3_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ def query(self, prompt: str) -> str:
2929
return make_executable_command(response_text)
3030

3131
def _construct_prompt(self, text: str) -> str:
32-
return f'''User: You are now a translater from human language to {os.uname()[0]} shell command.
33-
No explanation required, respond with only the raw shell command.
34-
What should I type to shell for: {text}, in one line.
32+
return f'''
33+
User: You are now a translater from human language to {os.uname()[0]} shell command.
34+
No explanation required, respond with only the raw shell command.
35+
What should I type to shell for: {text}, in one line.
3536
36-
You: '''
37+
You: '''[1:]

aishell/query_clients/official_chatgpt_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def query(self, prompt: str) -> str:
3131
return executable_command
3232

3333
def _construct_prompt(self, text: str) -> str:
34-
return f'''You are now a translater from human language to {os.uname()[0]} shell command.
35-
No explanation required, respond with only the raw shell command.
36-
What should I type to shell for: {text}, in one line.'''
34+
return f'''
35+
You are now a translater from human language to {os.uname()[0]} shell command.
36+
No explanation required, respond with only the raw shell command.
37+
What should I type to shell for: {text}, in one line.'''[1:]

aishell/query_clients/reverse_engineered_chatgpt_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def query(self, prompt: str) -> str:
4949
return response_text
5050

5151
def _construct_prompt(self, text: str) -> str:
52-
return f'''You are now a translater from human language to {os.uname()[0]} shell command.
53-
No explanation required, respond with only the raw shell command.
54-
What should I type to shell for: {text}, in one line.'''
52+
return f'''
53+
You are now a translater from human language to {os.uname()[0]} shell command.
54+
No explanation required, respond with only the raw shell command.
55+
What should I type to shell for: {text}, in one line.'''[1:]

0 commit comments

Comments
 (0)