Skip to content

Commit

Permalink
✨ feat: support native Artifacts just like Claude (lobehub#3985)
Browse files Browse the repository at this point in the history
* ✨ feat: 支持 AntThinking 渲染

* 🚧 wip: 支持 antArtifact 渲染

* 展示

* 展示

* 基本完成流式解析

* 基本完成流式解析

* ✨ feat: support svg render

* ✅ test: fix test

* 优化 lobeThinking 的解析

* i18n

* fix regex

* 💄 style: improve ui

* 🚸 style: improve ux

* i18n

* 💄 style: improve svg renderer

* 💄 style: improve svg renderer

* ✨ feat: 优化 html 类 renderer 效果

* ✨ feat: 支持 react renderer

* 💄 style: add tailwindcss

* fix style

* ✨ feat: 支持下载和复制图片

* ✅ test: fix tests

* i18n

* add tests
  • Loading branch information
arvinxx authored Sep 18, 2024
1 parent d2fe0f0 commit 0c42c46
Show file tree
Hide file tree
Showing 92 changed files with 2,286 additions and 74 deletions.
6 changes: 6 additions & 0 deletions locales/ar/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "مرحبًا، أنا **{{name}}**، {{systemRole}}، دعنا نبدأ الدردشة!",
"agentDefaultMessageWithoutEdit": "مرحبًا، أنا **{{name}}**، دعنا نبدأ المحادثة!",
"agentsAndConversations": "الوكلاء والمحادثات",
"artifact": {
"generating": "جاري الإنشاء",
"thinking": "جاري التفكير",
"thought": "عملية التفكير",
"unknownTitle": "عمل غير مسمى"
},
"backToBottom": "العودة إلى الأسفل",
"chatList": {
"longMessageDetail": "عرض التفاصيل"
Expand Down
16 changes: 16 additions & 0 deletions locales/ar/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "ملف"
}
},
"Plugins": "ملحقات",
"actions": {
"genAiMessage": "إنشاء رسالة مساعد ذكاء اصطناعي",
"summary": "ملخص",
"summaryTooltip": "ملخص للمحتوى الحالي"
},
"artifacts": {
"display": {
"code": "رمز",
"preview": "معاينة"
},
"svg": {
"copyAsImage": "نسخ كصورة",
"copyFail": "فشل النسخ، سبب الخطأ: {{error}}",
"copySuccess": "تم نسخ الصورة بنجاح",
"download": {
"png": "تحميل كـ PNG",
"svg": "تحميل كـ SVG"
}
}
},
"emptyArtifactList": "قائمة القطع الأثرية الحالية فارغة، يرجى استخدام الإضافات في الجلسة ومن ثم التحقق مرة أخرى",
"emptyKnowledgeList": "قائمة المعرفة الحالية فارغة، يرجى فتح قاعدة المعرفة حسب الحاجة في المحادثة قبل العرض",
"files": "ملفات",
Expand Down
6 changes: 6 additions & 0 deletions locales/bg-BG/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Здравей, аз съм **{{name}}**, {{systemRole}}. Нека започнем да чатим!",
"agentDefaultMessageWithoutEdit": "Здравей, аз съм **{{name}}** и нека започнем разговора!",
"agentsAndConversations": "агенти и разговори",
"artifact": {
"generating": "Генериране",
"thinking": "В процес на мислене",
"thought": "Процес на мислене",
"unknownTitle": "Неназован артефакт"
},
"backToBottom": "Върни се в началото",
"chatList": {
"longMessageDetail": "Вижте детайлите"
Expand Down
16 changes: 16 additions & 0 deletions locales/bg-BG/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "Файл"
}
},
"Plugins": "Плъгини",
"actions": {
"genAiMessage": "Създаване на съобщение на помощника",
"summary": "Обобщение",
"summaryTooltip": "Обобщение на текущото съдържание"
},
"artifacts": {
"display": {
"code": "Код",
"preview": "Преглед"
},
"svg": {
"copyAsImage": "Копирай като изображение",
"copyFail": "Копирането не успя, причина за грешката: {{error}}",
"copySuccess": "Изображението е копирано успешно",
"download": {
"png": "Изтегли като PNG",
"svg": "Изтегли като SVG"
}
}
},
"emptyArtifactList": "Списъкът с текущите артефакти е празен. Моля, използвайте добавки в разговора и след това проверете отново.",
"emptyKnowledgeList": "Текущият списък с познания е празен. Моля, активирайте базата данни на познанията по време на сесията, за да я прегледате.",
"files": "файлове",
Expand Down
6 changes: 6 additions & 0 deletions locales/de-DE/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Hallo, ich bin **{{name}}**, {{systemRole}}. Lass uns chatten!",
"agentDefaultMessageWithoutEdit": "Hallo, ich bin **{{name}}**. Lassen Sie uns ins Gespräch kommen!",
"agentsAndConversations": "Agenten und Unterhaltungen",
"artifact": {
"generating": "Wird generiert",
"thinking": "Denken",
"thought": "Denkenprozess",
"unknownTitle": "Unbenanntes Werk"
},
"backToBottom": "Zurück zum Ende",
"chatList": {
"longMessageDetail": "Details anzeigen"
Expand Down
16 changes: 16 additions & 0 deletions locales/de-DE/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "Datei"
}
},
"Plugins": "Plugins",
"actions": {
"genAiMessage": "Assistenten-Nachricht erstellen",
"summary": "Zusammenfassung",
"summaryTooltip": "Zusammenfassung des aktuellen Inhalts"
},
"artifacts": {
"display": {
"code": "Code",
"preview": "Vorschau"
},
"svg": {
"copyAsImage": "Als Bild kopieren",
"copyFail": "Kopieren fehlgeschlagen, Fehlerursache: {{error}}",
"copySuccess": "Bild erfolgreich kopiert",
"download": {
"png": "Als PNG herunterladen",
"svg": "Als SVG herunterladen"
}
}
},
"emptyArtifactList": "Die Liste der Artefakte ist derzeit leer. Bitte verwenden Sie Plugins in der Sitzung und überprüfen Sie sie erneut.",
"emptyKnowledgeList": "Die aktuelle Wissensliste ist leer. Bitte aktivieren Sie die Wissensdatenbank nach Bedarf in der Sitzung, um sie anzuzeigen.",
"files": "Dateien",
Expand Down
6 changes: 6 additions & 0 deletions locales/en-US/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Hello, I'm **{{name}}**, {{systemRole}}. Let's start chatting!",
"agentDefaultMessageWithoutEdit": "Hello, I'm **{{name}}**, let's start chatting!",
"agentsAndConversations": "Assistants and Conversations",
"artifact": {
"generating": "Generating",
"thinking": "Thinking",
"thought": "Thought Process",
"unknownTitle": "Untitled Work"
},
"backToBottom": "Back to bottom",
"chatList": {
"longMessageDetail": "View Details"
Expand Down
16 changes: 16 additions & 0 deletions locales/en-US/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "File"
}
},
"Plugins": "Plugins",
"actions": {
"genAiMessage": "Generate Assistant Message",
"summary": "Summary",
"summaryTooltip": "Summarize current content"
},
"artifacts": {
"display": {
"code": "Code",
"preview": "Preview"
},
"svg": {
"copyAsImage": "Copy as Image",
"copyFail": "Copy failed, reason: {{error}}",
"copySuccess": "Image copied successfully",
"download": {
"png": "Download as PNG",
"svg": "Download as SVG"
}
}
},
"emptyArtifactList": "The current Artifacts list is empty. Please use plugins in the session as needed before viewing.",
"emptyKnowledgeList": "The current knowledge list is empty. Please enable the knowledge base as needed during the conversation before viewing.",
"files": "Files",
Expand Down
6 changes: 6 additions & 0 deletions locales/es-ES/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Hola, soy **{{name}}**, {{systemRole}}, ¡comencemos a chatear!",
"agentDefaultMessageWithoutEdit": "¡Hola, soy **{{name}}**! Comencemos nuestra conversación.",
"agentsAndConversations": "agentesYConversaciones",
"artifact": {
"generating": "Generando",
"thinking": "Pensando",
"thought": "Proceso de pensamiento",
"unknownTitle": "Obra sin título"
},
"backToBottom": "Volver al fondo",
"chatList": {
"longMessageDetail": "Ver detalles"
Expand Down
16 changes: 16 additions & 0 deletions locales/es-ES/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "Archivo"
}
},
"Plugins": "Complementos",
"actions": {
"genAiMessage": "Crear mensaje de IA",
"summary": "Resumen",
"summaryTooltip": "Resumir el contenido actual"
},
"artifacts": {
"display": {
"code": "Código",
"preview": "Vista previa"
},
"svg": {
"copyAsImage": "Copiar como imagen",
"copyFail": "Error al copiar, motivo del error: {{error}}",
"copySuccess": "Imagen copiada con éxito",
"download": {
"png": "Descargar como PNG",
"svg": "Descargar como SVG"
}
}
},
"emptyArtifactList": "La lista de Artefactos actual está vacía. Por favor, utilice los complementos en la conversación y vuelva a intentarlo.",
"emptyKnowledgeList": "La lista de conocimientos actual está vacía. Por favor, activa la base de conocimientos según sea necesario en la conversación antes de volver a revisar.",
"files": "archivos",
Expand Down
6 changes: 6 additions & 0 deletions locales/fr-FR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Bonjour, je suis **{{name}}**, {{systemRole}}. Commençons la conversation !",
"agentDefaultMessageWithoutEdit": "Bonjour, je suis **{{name}}**. Commençons notre conversation !",
"agentsAndConversations": "Agents et conversations",
"artifact": {
"generating": "Génération en cours",
"thinking": "En réflexion",
"thought": "Processus de pensée",
"unknownTitle": "Œuvre sans nom"
},
"backToBottom": "Retour en bas",
"chatList": {
"longMessageDetail": "Voir les détails"
Expand Down
16 changes: 16 additions & 0 deletions locales/fr-FR/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "Fichier"
}
},
"Plugins": "Plugins",
"actions": {
"genAiMessage": "Créer un message d'assistant",
"summary": "Résumé",
"summaryTooltip": "Résumé du contenu actuel"
},
"artifacts": {
"display": {
"code": "Code",
"preview": "Aperçu"
},
"svg": {
"copyAsImage": "Copier en tant qu'image",
"copyFail": "Échec de la copie, raison de l'erreur : {{error}}",
"copySuccess": "Image copiée avec succès",
"download": {
"png": "Télécharger en tant que PNG",
"svg": "Télécharger en tant que SVG"
}
}
},
"emptyArtifactList": "La liste des Artifacts est actuellement vide. Veuillez utiliser les plugins dans la conversation avant de consulter à nouveau.",
"emptyKnowledgeList": "La liste des connaissances est actuellement vide. Veuillez activer la base de connaissances selon vos besoins dans la conversation avant de consulter.",
"files": "Fichiers",
Expand Down
6 changes: 6 additions & 0 deletions locales/it-IT/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Ciao, sono **{{name}}**, {{systemRole}}, iniziamo a chattare!",
"agentDefaultMessageWithoutEdit": "Ciao, sono **{{name}}**. Cominciamo a chiacchierare!",
"agentsAndConversations": "Assistenti e Conversazioni",
"artifact": {
"generating": "Generazione in corso",
"thinking": "In fase di riflessione",
"thought": "Processo di pensiero",
"unknownTitle": "Opera non nominata"
},
"backToBottom": "Torna in fondo",
"chatList": {
"longMessageDetail": "Visualizza dettagli"
Expand Down
16 changes: 16 additions & 0 deletions locales/it-IT/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "File"
}
},
"Plugins": "Plugin",
"actions": {
"genAiMessage": "Genera messaggio AI",
"summary": "Sommario",
"summaryTooltip": "Sommario del contenuto attuale"
},
"artifacts": {
"display": {
"code": "Codice",
"preview": "Anteprima"
},
"svg": {
"copyAsImage": "Copia come immagine",
"copyFail": "Copia fallita, motivo dell'errore: {{error}}",
"copySuccess": "Immagine copiata con successo",
"download": {
"png": "Scarica come PNG",
"svg": "Scarica come SVG"
}
}
},
"emptyArtifactList": "La lista degli Artefatti attuale è vuota, si prega di utilizzare i plugin necessari durante la sessione e poi controllare di nuovo",
"emptyKnowledgeList": "L'elenco delle conoscenze attuale è vuoto. Si prega di attivare il database delle conoscenze durante la conversazione per visualizzarlo.",
"files": "File",
Expand Down
6 changes: 6 additions & 0 deletions locales/ja-JP/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "こんにちは、私は **{{name}}** です、{{systemRole}}、さあ、チャットを始めましょう!",
"agentDefaultMessageWithoutEdit": "こんにちは、私は**{{name}}**です。会話しましょう!",
"agentsAndConversations": "エージェントと会話",
"artifact": {
"generating": "生成中",
"thinking": "思考中",
"thought": "思考過程",
"unknownTitle": "未命名の作品"
},
"backToBottom": "現在に戻る",
"chatList": {
"longMessageDetail": "詳細を見る"
Expand Down
16 changes: 16 additions & 0 deletions locales/ja-JP/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "ファイル"
}
},
"Plugins": "プラグイン",
"actions": {
"genAiMessage": "AIメッセージを生成",
"summary": "サマリー",
"summaryTooltip": "現在の内容を要約"
},
"artifacts": {
"display": {
"code": "コード",
"preview": "プレビュー"
},
"svg": {
"copyAsImage": "画像としてコピー",
"copyFail": "コピーに失敗しました。エラーの理由: {{error}}",
"copySuccess": "画像のコピーに成功しました",
"download": {
"png": "PNGとしてダウンロード",
"svg": "SVGとしてダウンロード"
}
}
},
"emptyArtifactList": "現在、アーティファクトリストは空です。プラグインを使用してセッション中に追加してください。",
"emptyKnowledgeList": "現在の知識リストは空です。会話中に必要に応じて知識ベースを開いてからご覧ください。",
"files": "ファイル",
Expand Down
6 changes: 6 additions & 0 deletions locales/ko-KR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "안녕하세요, 저는 **{{name}}**입니다. {{systemRole}}입니다. 대화를 시작해 봅시다!",
"agentDefaultMessageWithoutEdit": "안녕하세요, 저는 **{{name}}**입니다. 대화를 시작해보세요!",
"agentsAndConversations": "에이전트 및 대화",
"artifact": {
"generating": "생성 중",
"thinking": "생각 중",
"thought": "사고 과정",
"unknownTitle": "제목 없음"
},
"backToBottom": "하단으로 이동",
"chatList": {
"longMessageDetail": "자세히 보기"
Expand Down
16 changes: 16 additions & 0 deletions locales/ko-KR/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
"file": "파일"
}
},
"Plugins": "플러그인",
"actions": {
"genAiMessage": "AI 메시지 생성",
"summary": "요약",
"summaryTooltip": "현재 콘텐츠를 요약합니다"
},
"artifacts": {
"display": {
"code": "코드",
"preview": "미리보기"
},
"svg": {
"copyAsImage": "이미지로 복사",
"copyFail": "복사 실패, 오류 원인: {{error}}",
"copySuccess": "이미지 복사 성공",
"download": {
"png": "PNG로 다운로드",
"svg": "SVG로 다운로드"
}
}
},
"emptyArtifactList": "현재 아티팩트 목록이 비어 있습니다. 플러그인을 사용한 후에 다시 확인해주세요.",
"emptyKnowledgeList": "현재 지식 목록이 비어 있습니다. 대화 중에 필요에 따라 지식 베이스를 활성화한 후 다시 확인해 주세요.",
"files": "파일",
Expand Down
6 changes: 6 additions & 0 deletions locales/nl-NL/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"agentDefaultMessageWithSystemRole": "Hallo, ik ben **{{name}}**, {{systemRole}}, laten we beginnen met praten!",
"agentDefaultMessageWithoutEdit": "Hallo, ik ben **{{name}}**. Laten we beginnen met een gesprek!",
"agentsAndConversations": "agenten en gesprekken",
"artifact": {
"generating": "Genereren",
"thinking": "Denken",
"thought": "Denken proces",
"unknownTitle": "Onbenoemd werk"
},
"backToBottom": "Terug naar onderen",
"chatList": {
"longMessageDetail": "Bekijk details"
Expand Down
Loading

0 comments on commit 0c42c46

Please sign in to comment.