Archived
Add Pi package extension
This commit is contained in:
@@ -19,7 +19,7 @@ export function applyTranscriptEvent(messages: ChatLine[], event: SessionUiEvent
|
||||
|
||||
function applyMessageEndMeta(messages: ChatLine[], rawMessage: unknown): ChatLine[] | undefined {
|
||||
const ended = normalizeMessage(rawMessage)[0];
|
||||
if (ended === undefined || ended.meta === undefined) return undefined;
|
||||
if (ended?.meta === undefined) return undefined;
|
||||
const index = findLastMatchingRole(messages, ended.role);
|
||||
if (index < 0) return undefined;
|
||||
return messages.map((message, i) => i === index ? withMessageMeta(message, rawMessage) : message);
|
||||
|
||||
@@ -77,7 +77,7 @@ export class SessionController {
|
||||
const [page, status] = await Promise.all([api.messages(session.id, { limit: MESSAGE_PAGE_SIZE }), api.status(session.id)]);
|
||||
if (seq !== this.selectionSeq || this.getState().selectedSession?.id !== session.id) return;
|
||||
const history = this.mergeAndCacheHistory(session.id, page);
|
||||
const isReceivingPartialStream = status.isStreaming === true;
|
||||
const isReceivingPartialStream = status.isStreaming;
|
||||
this.catchupStreamSessionId = isReceivingPartialStream ? session.id : undefined;
|
||||
this.setState({ messages: normalizeMessages(history.messages), messagePageStart: history.start, messagePageTotal: history.total, isLoadingEarlierMessages: false, isReceivingPartialStream, status, activity: this.getState().sessionActivities[session.id] });
|
||||
this.applyStatus(status);
|
||||
|
||||
Reference in New Issue
Block a user