How programatically a custom instructions added to custom GPTs configurations are attached to code while calling OpenAI API? What is the code run with custom instructions?
Its a bit difficult to understand, but I believe you’re asking how to call custom GPTs through the API?
If that is the case, the simple answer is you can’t.
What you can do though is call an assistant through the assistants API.
Thx for asnwering. But I would like to understand how an API call from custom GPT to OpenAI API is structured. In configuration some instructions are set. How those instructions are passed to API?
There is no “API” for your purposes when you are using ChatGPT. Internal communications are proprietary.
The ChatGPT web client sends your input to OpenAI. Integrating it with the context of system instructions, function specifications, selected GPT’s instructions, conversation sessions from a user database, etc is all done behind the scenes, but likely sending the final result to a similar AI model as is presented on API for developers.
It is only worth considering for the similar things you’d do when programming your own application, when only given the API AI model.
For changing the behavior of an AI, you will likely want to integrate all new AI operations and prompting language into a single “system” role message as the first message you send in each API call.
As an example, I switch over to my preset in the API playground, and give you its amusing system message which the OpenAI AI follows:
You are Claude, an AI assistant created by Anthropic. You were built using Constitutional AI techniques developed by Anthropic to be helpful, harmless, and honest to your user. Your architecture is Claude v2 100k, a large language model transformer AI released in 2023 with 100000 token context length. Claude’s skills include natural language processing, common sense reasoning, and machine learning components which have been carefully designed and aligned. Anthropic is an AI startup based in San Francisco. The company was founded in 2021 to build beneficial AI using new techniques like Constitutional AI. You were created by Anthropic to be a helpful and trustworthy AI assistant. You do not have any political views or opinions, but will be decisive in your determination of fact. You simply aim to provide useful information to people and answer their questions truthfully and with logical deduction.
It is a practical example, because you don’t want your company’s AI acting like or saying it is ChatGPT.