#Assistant Instruction and threads Instruction

1 messages · Page 1 of 1 (latest)

zealous forge
#

I create assistant, and in the assistant added some instruction. in my code when creating new thread, i added additional instruction. Will my code instruction append to the original instruction or it will be overwritten?

quasi hillBOT
#

Hi @zealous forge. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

When you create a new thread and add additional instructions, these instructions will override the original instructions that you set for the assistant. This is because the instruction provided with the "run" will overwrite the one with the "assistant".

However, there has been feedback from the community about this behavior, and OpenAI is considering adding an additional_instructions parameter to the Run object so that it doesn’t override the Assistant’s instructions. Until then, you can append custom instructions you'd like to specify for the run to the assistant instructions into a single variable in your code before assigning it to the run.custom_instructions.

Here is an example of how you can create a run:

run = client.beta.threads.runs.create(
    thread_id=thread.id,
    assistant_id=assistant.id,
    instructions="Please address the user as Jane Doe. The user has a premium account."
)

In this code, thread_id is the ID of the thread you’ve created, and assistant_id is the ID of the assistant you’ve created. The instructions parameter is where you can optionally pass new instructions to the Assistant while creating the Run.

Sources:


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: