Question about instruction

“I’m trying to code a bot (like an imaginary friend) but I have a prompt issue. I’d like the bot to receive some context before conversing with the user. As of now, I only have a directive question that gets attached to the user’s question to form the complete prompt. This method is not satisfactory to me. I’d like the bot to receive instructions from me through the code that sets the context of who it is, etc., before starting the conversation with the user. I used to use the command ‘create_prompt’, but after researching, I understood that I could use the ‘instruction’ command. However, I’m not sure if it truly exists since I get an error message when I try to use it. Can you help me? Either by confirming if it exists or by providing an alternative! Thank you in advance!
Paul”

Hello Olipaul and welcome to the community!

First I’d recommend going back and looking at the API documentation and references and look at the examples there. It’ll help you out as you go along.

But to answer your question, the way I do it is set the very first message as “Hello you name is xxxx and you are a helpful general assistant.” and set the role as system. From there on anything the user (me) sends is set as role user and the responses back are set as role assistant.

If I then say “Hello, what is your name?” It will come back and tell me it’s an AI but will also say that it’s name is xxxx. xxxx being whatever name you want to give it.

There is no command called create_prompt or instruction. I think you might be confusing something there.

Good luck and have fun.

None of that sounds like OpenAI software or API. Are you using a third-party site or software package?

The way the chat completion endpoint works is by passing “role” messages, where “system” that you pass every time tells the AI how it operates, and “user” is the chatbot input from the user. Then in order to chat, some history of past turns between the user and the AI assistant must also be inserted before the most recent question.

I use only VScode and telegram if it’s the question. I’m sorry i’m french and it’s my starts in coding

Okay thanks. I will try this ! thank you verry much