mirror of
https://github.com/pionxzh/chatgpt-exporter.git
synced 2026-07-23 09:00:51 -05:00
fix: conversion problems listed in #222
This commit is contained in:
@@ -454,11 +454,14 @@ function extractConversationResult(conversationMapping: Record<string, Conversat
|
||||
break // Node not found
|
||||
}
|
||||
|
||||
if (node.message?.author.role === 'system') {
|
||||
break // Stop at system message
|
||||
if (node.parent === undefined) {
|
||||
break // Stop at root message.
|
||||
}
|
||||
|
||||
if (node.message?.author.role !== 'system') { // Skip system messages
|
||||
result.unshift(node)
|
||||
}
|
||||
|
||||
result.unshift(node)
|
||||
currentNodeId = node.parent
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ function convertMessageToTavern(node: ConversationNode): TavernMessage | null {
|
||||
return {
|
||||
name: authorRole === 'assistant' ? 'Assistant' : 'You',
|
||||
is_user: authorRole === 'user',
|
||||
// This seems to be always true
|
||||
is_name: true,
|
||||
// This is the opposite of is_user! Not always true.
|
||||
is_name: authorRole === 'assistant',
|
||||
send_date: createTime,
|
||||
mes: text,
|
||||
swipes: [text],
|
||||
|
||||
Reference in New Issue
Block a user