( chatHistory: GPTMessageInclSummary[], )
| 394 | } |
| 395 | |
| 396 | export function hideMostRecentFunctionOutputs( |
| 397 | chatHistory: GPTMessageInclSummary[], |
| 398 | ): GPTMessageInclSummary[] { |
| 399 | for (let i = chatHistory.length - 1; i >= 0; i--) { |
| 400 | const message = chatHistory[i]; |
| 401 | if (message.role === "function") { |
| 402 | message.summary = `Data output used by ${dataAnalysisActionName}`; |
| 403 | } |
| 404 | if (message.role !== "function") { |
| 405 | return chatHistory; |
| 406 | } |
| 407 | } |
| 408 | return chatHistory; |
| 409 | } |
| 410 | |
| 411 | export async function getSessionFromCookie( |
| 412 | req: NextRequest, |
no outgoing calls
no test coverage detected