#A question in the chatgpt bot that I made with Python, I want to specify its task, behavior and name
35 messages · Page 1 of 1 (latest)
Tell it the name in the prompt
what?
You can provide the name in the prompt that you give it
For example
Your name is Kaveen
You are a chatbot
Prompt: <>
ok
prompts = [
"Your name is Manager",
"You are a discord Chat Bot"
]
response = openai.Completion.create(
model="text-davinci-003",
prompt= [
prompts
],
temperature=0,
max_tokens=2000,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
)
if response.get("choices"):
return response.get("choices")[0]["text"]
like this?
No
In one prompt
you shouldn't be sending multiple prompts, you're getting multiple responses and only choosing the first one
Honestly, I do not understand what you are saying
prompts = [
"Your Name is Manager. You a Chat Bot in discord."
]
I changed the prompts, but the bot does not answer other questions
Well yeah obviously, becasue the question is not in the prompt
You need to programatically insert the user's question into the prompt
prompts = [
f "Your Name is Manager. You a Chat Bot in discord. Prompt: {prompt}"
]
as a basic example
where {prompt} would be the message content that the user sent
oh thank you
and then later, you'll prbably want to save the previous messages and responses
to emulate a "context"/"memory"
Can it be stored in the host? But I think a lot of RAM is needed
Yeah it can be stored in the host, it won't use a lot of RAM since it's just text
ty
@hardy gate If I want to send those codes with syntax highlighting, what should I do so that there is no problem in the other answers?
What do you mean?
Tell GPT3 in the prompt to prefix and suffix code examples with three backticks and the markdown shortcut for the language
add js after the first ‘’’
if you are using python, add py
tell the bot to do this
ok