Compare commits

..

No commits in common. "c5e7030dd199bdcdef95f61b5352f18a80df74d4" and "13e48411c1d29538b30141aa332b163ace2a899b" have entirely different histories.

17 changed files with 456 additions and 542 deletions

View File

@ -1,17 +0,0 @@
diff --git a/src/csv-loader.js b/src/csv-loader.js
index b53938d5e763b9f31e928492966bac5ef2c2e9a6..ddd469865d68bc420fd14e5097ed77f350c448a7 100644
--- a/src/csv-loader.js
+++ b/src/csv-loader.js
@@ -23,8 +23,11 @@ export class CsvLoader extends BaseLoader {
const parser = parse(buffer, this.csvParseOptions);
this.debug('CSV parsing started...');
for await (const record of parser) {
+ const stringified = Object.entries(record)
+ .map(([key, value]) => `${key}: ${value}`)
+ .join("\n");
yield {
- pageContent: cleanString(record.join(',')),
+ pageContent: cleanString(stringified),
metadata: {
type: 'CsvLoader',
source: this.filePathOrUrl,

View File

@ -117,8 +117,7 @@ For more detailed guidelines, please refer to our [Contributing Guide](./CONTRIB
Thank you for your support and contributions!
## Related Projects
- [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system, supporting mainstream models like OpenAI, Azure, and Anthropic. Features unified API interface, suitable for key management and secondary distribution.
* [one-api](https://github.com/songquanpeng/one-api):LLM API management and distribution system, supporting mainstream models like OpenAI, Azure, and Anthropic. Features unified API interface, suitable for key management and secondary distribution.
# 🚀 Contributors

View File

@ -118,8 +118,7 @@ Cherry Studioへの貢献を歓迎します以下の方法で貢献できま
ご支援と貢献に感謝します!
## 関連頁版
- [one-api](https://github.com/songquanpeng/one-api):LLM APIの管理・配信システム。OpenAI、Azure、Anthropicなどの主要モデルに対応し、統一APIインターフェースを提供。APIキー管理と再配布に利用可能。
* [one-api](https://github.com/songquanpeng/one-api):LLM APIの管理・配信システム。OpenAI、Azure、Anthropicなどの主要モデルに対応し、統一APIインターフェースを提供。APIキー管理と再配布に利用可能。
# 🚀 コントリビューター

View File

@ -118,8 +118,7 @@ $ yarn build:linux
感谢您的支持和贡献!
## 相关项目
- [one-api](https://github.com/songquanpeng/one-api):LLM API管理及分发系统支持OpenAI、Azure、Anthropic等主流模型统一API接口可用于密钥管理与二次分发。
* [one-api](https://github.com/songquanpeng/one-api):LLM API管理及分发系统支持OpenAI、Azure、Anthropic等主流模型统一API接口可用于密钥管理与二次分发。
# 🚀 贡献者

View File

@ -20,8 +20,7 @@ export default defineConfig({
'@llm-tools/embedjs-loader-xml',
'@llm-tools/embedjs-loader-pdf',
'@llm-tools/embedjs-loader-sitemap',
'@llm-tools/embedjs-libsql',
'@llm-tools/embedjs-loader-image'
'@llm-tools/embedjs-libsql'
]
}),
...visualizerPlugin('main')

View File

@ -53,8 +53,7 @@
"@google/generative-ai": "^0.21.0",
"@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.28-8e4393fa2d.patch",
"@llm-tools/embedjs-libsql": "^0.1.28",
"@llm-tools/embedjs-loader-csv": "patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch",
"@llm-tools/embedjs-loader-image": "^0.1.28",
"@llm-tools/embedjs-loader-csv": "^0.1.28",
"@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.28-81647ffac6.patch",
"@llm-tools/embedjs-loader-msoffice": "^0.1.28",
"@llm-tools/embedjs-loader-pdf": "^0.1.28",

View File

@ -1,5 +1,6 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ -42,9 +43,8 @@
<p class="mb-4">如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。</p>
<p>
除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问
<a href="http://www.apache.org/licenses/LICENSE-2.0" class="text-blue-500 underline"
>http://www.apache.org/licenses/LICENSE-2.0</a
>
<a href="http://www.apache.org/licenses/LICENSE-2.0"
class="text-blue-500 underline">http://www.apache.org/licenses/LICENSE-2.0</a>
</p>
</div>
<h1 class="text-3xl font-bold mb-6 text-center">Cherry Studio License</h1>
@ -57,23 +57,28 @@
<h3 class="text-xl font-semibold mb-2">I. Commercial Use License</h3>
<ol class="list-decimal list-inside mb-4">
<li>
<strong>Free Commercial Use</strong>: Users can use the software for commercial purposes without modifying
<strong>Free Commercial Use</strong>: Users can use the software for commercial purposes without
modifying
the code.
</li>
<li>
<strong>Commercial License Required</strong>: A commercial license is required if any of the following
<strong>Commercial License Required</strong>: A commercial license is required if any of the
following
conditions are met:
<ol class="list-decimal list-inside ml-4">
<li>
You modify, develop, or alter the software, including but not limited to changes to the application
You modify, develop, or alter the software, including but not limited to changes to the
application
name, logo, code, or functionality.
</li>
<li>You provide multi-tenant services to enterprise customers with 10 or more users.</li>
<li>
You pre-install or integrate the software into hardware devices or products and bundle it for sale.
You pre-install or integrate the software into hardware devices or products and bundle it
for sale.
</li>
<li>
You are engaging in large-scale procurement for government or educational institutions, especially
You are engaging in large-scale procurement for government or educational institutions,
especially
involving security, data privacy, or other sensitive requirements.
</li>
</ol>
@ -82,11 +87,13 @@
<h3 class="text-xl font-semibold mb-2">II. Contributor Agreement</h3>
<ol class="list-decimal list-inside mb-4">
<li>
<strong>License Adjustment</strong>: The producer reserves the right to adjust the open-source license as
<strong>License Adjustment</strong>: The producer reserves the right to adjust the open-source
license as
needed, making it stricter or more lenient.
</li>
<li>
<strong>Commercial Use</strong>: Any code you contribute may be used for commercial purposes, including but
<strong>Commercial Use</strong>: Any code you contribute may be used for commercial purposes,
including but
not limited to cloud business operations.
</li>
</ol>
@ -101,11 +108,11 @@
<p>
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache
License 2.0. Detailed information about the Apache License 2.0 can be found at
<a href="http://www.apache.org/licenses/LICENSE-2.0" class="text-blue-500 underline"
>http://www.apache.org/licenses/LICENSE-2.0</a
>
<a href="http://www.apache.org/licenses/LICENSE-2.0"
class="text-blue-500 underline">http://www.apache.org/licenses/LICENSE-2.0</a>
</p>
</div>
</div>
</body>
</html>

View File

@ -1,5 +1,6 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ -17,8 +18,7 @@
<!-- Loading状态 -->
<div v-if="loading" class="text-center py-8">
<div
class="inline-block animate-spin rounded-full h-8 w-8 border-4"
<div class="inline-block animate-spin rounded-full h-8 w-8 border-4"
:class="isDark ? 'border-gray-700 border-t-blue-500' : 'border-gray-300 border-t-blue-500'"></div>
</div>
@ -27,14 +27,10 @@
<!-- Release 列表 -->
<div v-else class="space-y-8">
<div
v-for="release in releases"
:key="release.id"
class="relative pl-8"
<div v-for="release in releases" :key="release.id" class="relative pl-8"
:class="isDark ? 'border-l-2 border-gray-700' : 'border-l-2 border-gray-200'">
<div class="absolute -left-2 top-0 w-4 h-4 rounded-full bg-green-500"></div>
<div
class="rounded-lg shadow-sm p-6 transition-shadow"
<div class="rounded-lg shadow-sm p-6 transition-shadow"
:class="isDark ? 'bg-black hover:shadow-md hover:shadow-black' : 'bg-white hover:shadow-md'">
<div class="flex items-start justify-between mb-4">
<div>
@ -45,15 +41,12 @@
{{ formatDate(release.published_at) }}
</p>
</div>
<span
class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium"
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium"
:class="isDark ? 'bg-green-900 text-green-200' : 'bg-green-100 text-green-800'">
{{ release.tag_name }}
</span>
</div>
<div
class="prose"
:class="isDark ? 'text-gray-300 dark-prose' : 'text-gray-600'"
<div class="prose" :class="isDark ? 'text-gray-300 dark-prose' : 'text-gray-600'"
v-html="renderMarkdown(release.body)"></div>
</div>
</div>
@ -205,4 +198,5 @@
}
</style>
</body>
</html>

View File

@ -120,7 +120,6 @@ class KnowledgeService {
if (item.type === 'file') {
const file = item.content as FileType
console.log(file)
if (file.ext === '.pdf') {
return await ragApplication.addLoader(
@ -166,27 +165,6 @@ class KnowledgeService {
)
}
if (file.ext === '.csv') {
try {
const module = await import('@llm-tools/embedjs-loader-csv/src/index.js')
// 使用module中的功能
console.log(module.CsvLoader) // 假设模块导出了一个默认值
return await ragApplication.addLoader(
new module.CsvLoader({
filePathOrUrl: file.path,
chunkSize: base.chunkSize,
chunkOverlap: base.chunkOverlap,
csvParseOptions: {
columns: true
}
}) as any,
forceReload
)
} catch (error) {
console.error('加载模块时出错:', error)
}
}
if (['.md'].includes(file.ext)) {
return await ragApplication.addLoader(
new MarkdownLoader({

View File

@ -1,10 +1,10 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<meta
http-equiv="Content-Security-Policy"
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; connect-src blob: *; script-src 'self' 'unsafe-eval' *; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' *; font-src 'self' data: *; img-src 'self' data: file: * blob:; frame-src * file:" />
<style>
@ -38,4 +38,5 @@
<script type="module" src="/src/init.ts"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@ -95,14 +95,14 @@ export const Box = styled.div<BoxProps>`
box-sizing: border-box;
border: ${(props) => props?.border || 'none'};
gap: ${(p) => (p.gap ? getElementValue(p.gap) : 0)};
margin: ${(props) => (props.m || props.margin ? (props.m ?? props.margin) : 'none')};
margin: ${(props) => (props.m || props.margin ? props.m ?? props.margin : 'none')};
margin-top: ${(props) => (props.mt || props.marginTop ? getElementValue(props.mt || props.marginTop) : 'default')};
margin-bottom: ${(props) =>
props.mb || props.marginBottom ? getElementValue(props.mb ?? props.marginBottom) : 'default'};
margin-left: ${(props) => (props.ml || props.marginLeft ? getElementValue(props.ml ?? props.marginLeft) : 'default')};
margin-right: ${(props) =>
props.mr || props.marginRight ? getElementValue(props.mr ?? props.marginRight) : 'default'};
padding: ${(props) => (props.p || props.padding ? (props.p ?? props.padding) : 'none')};
padding: ${(props) => (props.p || props.padding ? props.p ?? props.padding : 'none')};
padding-top: ${(props) => (props.pt || props.paddingTop ? getElementValue(props.pt ?? props.paddingTop) : 'auto')};
padding-bottom: ${(props) =>
props.pb || props.paddingBottom ? getElementValue(props.pb ?? props.paddingBottom) : 'auto'};

View File

@ -222,10 +222,6 @@ export const EMBEDDING_MODELS = [
{
id: 'embed-multilingual-v2.0',
max_context: 256
},
{
id: 'text-embedding-004',
max_context: 2048
}
]

View File

@ -1191,12 +1191,7 @@ export function isWebSearchModel(model: Model): boolean {
}
if (provider.id === 'aihubmix') {
const models = [
'gemini-2.0-flash-search',
'gemini-2.0-flash-exp-search',
'gemini-2.0-pro-exp-02-05-search'
]
return models.includes(model?.id)
return model?.id === 'gemini-2.0-flash-exp-search'
}
if (provider.id === 'zhipu') {

View File

@ -32,7 +32,7 @@
"title": "智能體"
},
"assistants": {
"abbr": "助",
"abbr": "助",
"clear.content": "清空話題會刪除助手下所有主題和文件,確定要繼續嗎?",
"clear.title": "清空話題",
"copy.title": "複製助手",
@ -107,7 +107,7 @@
"settings.set_as_default": "設為預設助手",
"settings.show_line_numbers": "代码顯示行號",
"settings.temperature": "溫度",
"settings.temperature.tip": "模型產生文字的隨機程度。數值越高,回應內容越具多樣性、創意性及隨機性;設定為 0 則會依據事實回答。一般聊天建議設定為 0.7",
"settings.temperature.tip": "較低的值使模型更具創造性和不可預測性,較高的值則使其更具確定性和精確性。",
"settings.top_p": "Top-P",
"settings.top_p.tip": "模型生成文本的隨機程度。值越小AI 生成的內容越單調也越容易理解值越大AI 回覆的詞彙範圍越大,越多樣化",
"suggestions.title": "建議的問題",

View File

@ -33,7 +33,7 @@ interface KnowledgeContentProps {
selectedBase: KnowledgeBase
}
const fileTypes = ['.pdf', '.docx', '.pptx', '.xlsx', '.txt', '.md', '.html', '.csv']
const fileTypes = ['.pdf', '.docx', '.pptx', '.xlsx', '.txt', '.md', '.html']
const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
const { t } = useTranslation()

View File

@ -1,8 +1,9 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Selection Menu</title>
<style>
:root {
@ -133,7 +134,7 @@
</menu>
<script>
document.querySelectorAll('button').forEach((button) => {
document.querySelectorAll('button').forEach(button => {
button.addEventListener('click', () => {
const action = button.getAttribute('data-action')
window.api.selectionMenu.action(action)
@ -141,4 +142,5 @@
})
</script>
</body>
</html>

View File

@ -1518,7 +1518,7 @@ __metadata:
languageName: node
linkType: hard
"@llm-tools/embedjs-loader-csv@npm:0.1.28":
"@llm-tools/embedjs-loader-csv@npm:^0.1.28":
version: 0.1.28
resolution: "@llm-tools/embedjs-loader-csv@npm:0.1.28"
dependencies:
@ -1531,35 +1531,6 @@ __metadata:
languageName: node
linkType: hard
"@llm-tools/embedjs-loader-csv@patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch":
version: 0.1.28
resolution: "@llm-tools/embedjs-loader-csv@patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch::version=0.1.28&hash=c89b03"
dependencies:
"@llm-tools/embedjs-interfaces": "npm:0.1.28"
"@llm-tools/embedjs-utils": "npm:0.1.28"
csv-parse: "npm:^5.6.0"
debug: "npm:^4.4.0"
md5: "npm:^2.3.0"
checksum: 10c0/ed1e6f498293bfaa33e9fa7d1ad9cf916c39fc84e2cf29597be4e134913968e4a75017b081baaea6c550cf5910ea57ff5db3dccde5afe2b1c05b3bba741d384e
languageName: node
linkType: hard
"@llm-tools/embedjs-loader-image@npm:^0.1.28":
version: 0.1.28
resolution: "@llm-tools/embedjs-loader-image@npm:0.1.28"
dependencies:
"@langchain/core": "npm:^0.3.26"
"@llm-tools/embedjs-interfaces": "npm:0.1.28"
"@llm-tools/embedjs-utils": "npm:0.1.28"
debug: "npm:^4.4.0"
exifremove: "npm:^1.0.1"
md5: "npm:^2.3.0"
mime: "npm:^4.0.6"
stream-mime-type: "npm:^2.0.0"
checksum: 10c0/e9414dde0d10afe1541bfe464b80f5cb61ec523f28dce62ab931a3f4ffde93c5589fde8e7a7f5751e7dc20d68fe2d28883925ba65e2542ee9d43002591568af1
languageName: node
linkType: hard
"@llm-tools/embedjs-loader-markdown@npm:0.1.28":
version: 0.1.28
resolution: "@llm-tools/embedjs-loader-markdown@npm:0.1.28"
@ -3000,8 +2971,7 @@ __metadata:
"@kangfenmao/keyv-storage": "npm:^0.1.0"
"@llm-tools/embedjs": "patch:@llm-tools/embedjs@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-npm-0.1.28-8e4393fa2d.patch"
"@llm-tools/embedjs-libsql": "npm:^0.1.28"
"@llm-tools/embedjs-loader-csv": "patch:@llm-tools/embedjs-loader-csv@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-csv-npm-0.1.28-a5dac8addd.patch"
"@llm-tools/embedjs-loader-image": "npm:^0.1.28"
"@llm-tools/embedjs-loader-csv": "npm:^0.1.28"
"@llm-tools/embedjs-loader-markdown": "patch:@llm-tools/embedjs-loader-markdown@npm%3A0.1.28#~/.yarn/patches/@llm-tools-embedjs-loader-markdown-npm-0.1.28-81647ffac6.patch"
"@llm-tools/embedjs-loader-msoffice": "npm:^0.1.28"
"@llm-tools/embedjs-loader-pdf": "npm:^0.1.28"
@ -5975,13 +5945,6 @@ __metadata:
languageName: node
linkType: hard
"exifremove@npm:^1.0.1":
version: 1.0.1
resolution: "exifremove@npm:1.0.1"
checksum: 10c0/df5a30087b262a35f2932e4d8b567206ec5f39518740c1552361e9a6eee0a38819359bd8ab2bd5df391647c4dea8d572995852f355cf8fc504df6b1685d82921
languageName: node
linkType: hard
"expand-template@npm:^2.0.3":
version: 2.0.3
resolution: "expand-template@npm:2.0.3"