维持历史对话
1、conversation.item.create 消息(单向 user 记忆)
conversationHistory.forEach((msg) => {
if (msg.role === "user") {
const messageConfig = {
type: "conversation.item.create",
item: {
type: "message",
role: "user",
content: [{ type: "input_text", text: msg.content }]
}
};
socket.send(JSON.stringify(messageConfig));
}
});
2、系统提示词(System Instructions)注入上下文
Last updated