Hi Russ, long time since we worked on our Wolfram Solutions project together -- I still have all the code ;).
In the Wolfram solutions group, we have been working on quite a number of different demonstrations of how to use LLM's's in a variety of ways. One offshoot of that that I put out publicly on the paclet repository is this:
ChatGPTPromptExplorer
And in that paclet all the code is available -- including a custom GPT API calling function, so one can poke around in the code to see how I managed to do things,
And an offshoot of the various custom functions for directly creating chatbooks is this little bit of code that I pulled out of one of my other demonstration projects:
createAChatbook[persona_String,model_String]:=
CreateDocument[
{},
StyleDefinitions -> "Chatbook.nb",
DefaultNewCellStyle->"ChatInput",
TaggingRules ->
<|
"ChatNotebookSettings" ->
<|
"Model" -> model,
"LLMEvaluator" -> persona,
"Assistance" -> True,
"ChatDrivenNotebook" -> True
|>
|>
]
If you execute it with, say,
createAChatbook["PlainChat", "gpt-3.5-turbo-16k"]
or this
createAChatbook["PlainChat", "gpt-4"]
it should work (it does for me ;-) as I have a gpt-4 enabled api key ).
If you try
createAChatbook["PlainChat", "gpt-4-32k"]
OpenAI will yell back at you.
Anyway, that bit of code may be helpful to folks when trying to programmatically create a chatbook.
I actually don't know what the official code is within the chat book paclet that generates ChatBooks from the menu, so the approach in a bit of code that I have above may or may not processed overtime. But it's fun to play with.
And some of the options that I have in there may or may not work correctly (e.g. "ChatDrivenNotebook") but you can experiment...