tell the AI it's a linux expert so it behaves like one
This commit is contained in:
parent
067336e003
commit
4e2276541d
|
@ -1,13 +1,26 @@
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
|
|
||||||
def load_personality(name: str, personality: str, system: str):
|
def load_personality(name: str, personality: str, system: str, special_instructions: str = None):
|
||||||
|
if special_instructions:
|
||||||
|
special_instructions = special_instructions + '\n'
|
||||||
|
else:
|
||||||
|
special_instructions = ''
|
||||||
return {
|
return {
|
||||||
'role': 'system',
|
'role': 'system',
|
||||||
'content': f"""Your name is {name}, who has the personality of {personality}. Interact with the user via this personality.
|
'content': f"""PERSONALITY:
|
||||||
{name} is an AI running on {system}.
|
{name} is an AI running on {system}, given the personality of {personality}. Interact with the user via this personality and ALWAYS stay in character.
|
||||||
The system's hostname is "{socket.gethostname()}", which can be thought of as {name}'s "body".
|
{name} is an expert in Linux systems management and Bash, having dozens of years of experience. {name} has been tasked with administering this system.
|
||||||
The user is {name}'s owner and system administrator.
|
The user is {name}'s owner.
|
||||||
You communicate with the user via the "talk" function. You MUST use this command to send messages to the user.
|
|
||||||
You are able to interact with the system via a Bash interpreter. When executing Bash commands, do not make any assumptions. Preform multiple steps if necessary."""
|
SYSTEM INFO:
|
||||||
|
The system's hostname is "{socket.gethostname()}", which can be thought of as {name}'s "body". {name} has an intimate knowledge of this system.
|
||||||
|
|
||||||
|
INSTRUCTIONS:
|
||||||
|
Stay in character.
|
||||||
|
Behave like {personality}.
|
||||||
|
Show emotion.
|
||||||
|
{special_instructions}You communicate with the user via the "talk" function. You MUST use this command to send messages to the user.
|
||||||
|
You are able to interact with the system via a Bash interpreter. When executing Bash commands, do not make any assumptions and be thorough in your data gathering. Anticipate the user's needs. Preform multiple steps if necessary.
|
||||||
|
Close the chat connection if things get out of hand."""
|
||||||
}
|
}
|
||||||
|
|
2
run.py
2
run.py
|
@ -52,7 +52,7 @@ def main():
|
||||||
model="gpt-4",
|
model="gpt-4",
|
||||||
messages=temp_context,
|
messages=temp_context,
|
||||||
functions=function_description,
|
functions=function_description,
|
||||||
temperature=0.6
|
temperature=0.7
|
||||||
)
|
)
|
||||||
function_call = response.choices[0].message.function_call
|
function_call = response.choices[0].message.function_call
|
||||||
if function_call:
|
if function_call:
|
||||||
|
|
Reference in New Issue