mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 17:24:00 +01:00
fix: chatgpt import
This commit is contained in:
parent
5fdaa1dbda
commit
86f7313923
|
@ -14,12 +14,12 @@ export type OpenAIChat = {
|
|||
mapping: {
|
||||
[key: string]: {
|
||||
id: string;
|
||||
message: {
|
||||
message?: {
|
||||
author: {
|
||||
role: Role;
|
||||
};
|
||||
content: {
|
||||
parts: string[];
|
||||
parts?: string[];
|
||||
};
|
||||
} | null;
|
||||
parent: string | null;
|
||||
|
|
|
@ -102,7 +102,7 @@ export const convertOpenAIToBetterChatGPTFormat = (
|
|||
// Extract message if it exists
|
||||
if (node.message) {
|
||||
const { role } = node.message.author;
|
||||
const content = node.message.content.parts.join('');
|
||||
const content = node.message.content.parts?.join('') || '';
|
||||
if (content.length > 0) messages.push({ role, content });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue