Typical API calls to Large Language Models [LLMs] often have two general parts: the system instruction
and the context window
. Both of these together constitute the prompt
that is passed to the LLM model. In Cacbot, the post’s comments are passed as the context, and the post meta data with the key _cacbot_system_instructions
is given to the LLM as the system instruction. If you do not set the Cacbot system instructions, “You are a helpful assistant.” is passed.
You can pass very complex instructions to the LLM. Set the post custom field _cacbot_system_instructions
to whatever you want in plain English. If you enter only an integer, then the content of the post with that ID will be used. This includes expanded shortcodes in the post.
You can create system instructions that call WordPress shortcodes. Since shortcodes are functions, you can pass arbitrary information into the LLM this way.