At the beginning of the chat, I want to give a large text that will give the context to the ChatGPT session on what he needs to know to efficiently answer the user’s prompts.
I tried using append() to add some context, but it shows the message to the user with the large context text which I don’t want. I tried to add context to the data or body, but I don’t seem to understand, and Vercel AI SDK documentation sucks in this regard.
Has anyone faced this issue? How can I resolve it?
This is what I tried:
appendMessage({
id: "1",
role: "data",
content: problemData.startingCode,
});
const newChatRequestOptions: ChatRequestOptions = {
options: {
body: {
context: problemData.startingCode,
},
},
data: {
context: problemData.startingCode,
},
};
handleSubmit(e, newChatRequestOptions);
However Chat still does not get that info from the body or from the data.