fix: type errors
This commit is contained in:
parent
17a249c1ce
commit
cd82f4c61f
2 changed files with 4 additions and 3 deletions
|
|
@ -122,6 +122,7 @@ export async function* streamDiffLines({
|
|||
(msg) => msg.role === "user" || msg.role === "tool",
|
||||
) as UserChatMessage | ToolResultChatMessage | undefined),
|
||||
baseSystemMessage: undefined,
|
||||
contextItems: [],
|
||||
})
|
||||
: undefined;
|
||||
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ ${EDIT_MESSAGE}
|
|||
function getUserContextItems(
|
||||
userMsg: UserChatMessage | ToolResultChatMessage | undefined,
|
||||
history: ChatHistoryItem[],
|
||||
): ContextItemWithId[] | undefined {
|
||||
if (!userMsg) return undefined;
|
||||
): ContextItemWithId[] {
|
||||
if (!userMsg) return [];
|
||||
|
||||
// Find the history item that contains the userMsg
|
||||
const historyItem = history.find((item) => {
|
||||
|
|
@ -100,7 +100,7 @@ function getUserContextItems(
|
|||
);
|
||||
});
|
||||
|
||||
return historyItem?.contextItems;
|
||||
return historyItem?.contextItems || [];
|
||||
}
|
||||
|
||||
export function constructMessages(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue