refactor(GraphRAG): Remove GraphRAG related files and references from the project
This commit is contained in:
parent
b828d1f54f
commit
46c7df6f5b
@ -1,68 +0,0 @@
|
|||||||
<head>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="https://unpkg.com/3d-force-graph"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="3d-graph"></div>
|
|
||||||
<script src="./js/bridge.js"></script>
|
|
||||||
<script type="module">
|
|
||||||
import { getQueryParam } from './js/utils.js'
|
|
||||||
|
|
||||||
const apiUrl = getQueryParam('apiUrl')
|
|
||||||
const modelId = getQueryParam('modelId')
|
|
||||||
const jsonUrl = `${apiUrl}/v1/global_graph/${modelId}`
|
|
||||||
|
|
||||||
const infoCard = document.createElement('div')
|
|
||||||
infoCard.style.position = 'fixed'
|
|
||||||
infoCard.style.backgroundColor = 'rgba(255, 255, 255, 0.9)'
|
|
||||||
infoCard.style.padding = '8px'
|
|
||||||
infoCard.style.borderRadius = '4px'
|
|
||||||
infoCard.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)'
|
|
||||||
infoCard.style.fontSize = '12px'
|
|
||||||
infoCard.style.maxWidth = '200px'
|
|
||||||
infoCard.style.display = 'none'
|
|
||||||
infoCard.style.zIndex = '1000'
|
|
||||||
document.body.appendChild(infoCard)
|
|
||||||
|
|
||||||
document.addEventListener('mousemove', (event) => {
|
|
||||||
infoCard.style.left = `${event.clientX + 10}px`
|
|
||||||
infoCard.style.top = `${event.clientY + 10}px`
|
|
||||||
})
|
|
||||||
|
|
||||||
const elem = document.getElementById('3d-graph')
|
|
||||||
const Graph = ForceGraph3D()(elem)
|
|
||||||
.jsonUrl(jsonUrl)
|
|
||||||
.nodeAutoColorBy((node) => node.properties.type || 'default')
|
|
||||||
.nodeVal((node) => node.properties.degree)
|
|
||||||
.linkWidth((link) => link.properties.weight)
|
|
||||||
.onNodeHover((node) => {
|
|
||||||
if (node) {
|
|
||||||
infoCard.innerHTML = `
|
|
||||||
<div style="font-weight: bold; margin-bottom: 4px; color: #333;">
|
|
||||||
${node.properties.title}
|
|
||||||
</div>
|
|
||||||
<div style="color: #666;">
|
|
||||||
${node.properties.description}
|
|
||||||
</div>`
|
|
||||||
infoCard.style.display = 'block'
|
|
||||||
} else {
|
|
||||||
infoCard.style.display = 'none'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.onNodeClick((node) => {
|
|
||||||
const url = `${apiUrl}/v1/references/${modelId}/entities/${node.properties.human_readable_id}`
|
|
||||||
window.api.minApp({
|
|
||||||
url,
|
|
||||||
windowOptions: {
|
|
||||||
title: node.properties.title,
|
|
||||||
width: 500,
|
|
||||||
height: 800
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
@ -14,7 +14,6 @@ import GiteeAIProviderLogo from '@renderer/assets/images/providers/gitee-ai.png'
|
|||||||
import GithubProviderLogo from '@renderer/assets/images/providers/github.png'
|
import GithubProviderLogo from '@renderer/assets/images/providers/github.png'
|
||||||
import GoogleProviderLogo from '@renderer/assets/images/providers/google.png'
|
import GoogleProviderLogo from '@renderer/assets/images/providers/google.png'
|
||||||
import GPUStackProviderLogo from '@renderer/assets/images/providers/gpustack.svg'
|
import GPUStackProviderLogo from '@renderer/assets/images/providers/gpustack.svg'
|
||||||
import GraphRagProviderLogo from '@renderer/assets/images/providers/graph-rag.png'
|
|
||||||
import GrokProviderLogo from '@renderer/assets/images/providers/grok.png'
|
import GrokProviderLogo from '@renderer/assets/images/providers/grok.png'
|
||||||
import GroqProviderLogo from '@renderer/assets/images/providers/groq.png'
|
import GroqProviderLogo from '@renderer/assets/images/providers/groq.png'
|
||||||
import HyperbolicProviderLogo from '@renderer/assets/images/providers/hyperbolic.png'
|
import HyperbolicProviderLogo from '@renderer/assets/images/providers/hyperbolic.png'
|
||||||
@ -64,7 +63,6 @@ const PROVIDER_LOGO_MAP = {
|
|||||||
gemini: GoogleProviderLogo,
|
gemini: GoogleProviderLogo,
|
||||||
stepfun: StepProviderLogo,
|
stepfun: StepProviderLogo,
|
||||||
doubao: BytedanceProviderLogo,
|
doubao: BytedanceProviderLogo,
|
||||||
'graphrag-kylin-mountain': GraphRagProviderLogo,
|
|
||||||
minimax: MinimaxProviderLogo,
|
minimax: MinimaxProviderLogo,
|
||||||
github: GithubProviderLogo,
|
github: GithubProviderLogo,
|
||||||
copilot: GithubProviderLogo,
|
copilot: GithubProviderLogo,
|
||||||
|
|||||||
@ -699,7 +699,6 @@
|
|||||||
"gitee-ai": "Gitee AI",
|
"gitee-ai": "Gitee AI",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "Tencent Hunyuan",
|
"hunyuan": "Tencent Hunyuan",
|
||||||
|
|||||||
@ -699,7 +699,6 @@
|
|||||||
"gitee-ai": "Gitee AI",
|
"gitee-ai": "Gitee AI",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "腾讯混元",
|
"hunyuan": "腾讯混元",
|
||||||
|
|||||||
@ -699,7 +699,6 @@
|
|||||||
"gitee-ai": "Gitee AI",
|
"gitee-ai": "Gitee AI",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "Tencent Hunyuan",
|
"hunyuan": "Tencent Hunyuan",
|
||||||
|
|||||||
@ -699,7 +699,6 @@
|
|||||||
"gitee-ai": "Gitee AI",
|
"gitee-ai": "Gitee AI",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "腾讯混元",
|
"hunyuan": "腾讯混元",
|
||||||
|
|||||||
@ -699,7 +699,6 @@
|
|||||||
"gitee-ai": "Gitee AI",
|
"gitee-ai": "Gitee AI",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "騰訊混元",
|
"hunyuan": "騰訊混元",
|
||||||
|
|||||||
@ -643,7 +643,6 @@
|
|||||||
"gitee-ai": "Gitee AI",
|
"gitee-ai": "Gitee AI",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "Tencent Hunyuan",
|
"hunyuan": "Tencent Hunyuan",
|
||||||
|
|||||||
@ -643,7 +643,6 @@
|
|||||||
"gitee-ai": "Gitee IA",
|
"gitee-ai": "Gitee IA",
|
||||||
"github": "GitHub Modelos",
|
"github": "GitHub Modelos",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "Tencent Hùnyuán",
|
"hunyuan": "Tencent Hùnyuán",
|
||||||
|
|||||||
@ -643,7 +643,6 @@
|
|||||||
"gitee-ai": "Gitee IA",
|
"gitee-ai": "Gitee IA",
|
||||||
"github": "GitHub Modèles",
|
"github": "GitHub Modèles",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Grok",
|
"grok": "Grok",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "Tencent HunYuan",
|
"hunyuan": "Tencent HunYuan",
|
||||||
|
|||||||
@ -643,7 +643,6 @@
|
|||||||
"gitee-ai": "Gitee IA",
|
"gitee-ai": "Gitee IA",
|
||||||
"github": "GitHub Models",
|
"github": "GitHub Models",
|
||||||
"gpustack": "GPUStack",
|
"gpustack": "GPUStack",
|
||||||
"graphrag-kylin-mountain": "GraphRAG",
|
|
||||||
"grok": "Compreender",
|
"grok": "Compreender",
|
||||||
"groq": "Groq",
|
"groq": "Groq",
|
||||||
"hunyuan": "Tencent Hún Yuán",
|
"hunyuan": "Tencent Hún Yuán",
|
||||||
|
|||||||
@ -1,50 +0,0 @@
|
|||||||
import { useMinappPopup } from '@renderer/hooks/useMinappPopup'
|
|
||||||
import { MinAppType, Provider } from '@renderer/types'
|
|
||||||
import { Button } from 'antd'
|
|
||||||
import { FC } from 'react'
|
|
||||||
import { useTranslation } from 'react-i18next'
|
|
||||||
import styled from 'styled-components'
|
|
||||||
|
|
||||||
import { SettingSubtitle } from '..'
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
provider: Provider
|
|
||||||
}
|
|
||||||
|
|
||||||
const GraphRAGSettings: FC<Props> = ({ provider }) => {
|
|
||||||
const apiUrl = provider.apiHost
|
|
||||||
const modalId = provider.models.filter((model) => model.id.includes('global'))[0]?.id
|
|
||||||
const { t } = useTranslation()
|
|
||||||
const { openMinapp } = useMinappPopup()
|
|
||||||
|
|
||||||
const onShowGraphRAG = async () => {
|
|
||||||
const { appPath } = await window.api.getAppInfo()
|
|
||||||
const url = `file://${appPath}/resources/graphrag.html?apiUrl=${apiUrl}&modelId=${modalId}`
|
|
||||||
|
|
||||||
const app: MinAppType = {
|
|
||||||
id: 'graphrag',
|
|
||||||
name: t('words.knowledgeGraph'),
|
|
||||||
logo: '',
|
|
||||||
url
|
|
||||||
}
|
|
||||||
|
|
||||||
openMinapp(app)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!modalId) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container>
|
|
||||||
<SettingSubtitle>{t('words.knowledgeGraph')}</SettingSubtitle>
|
|
||||||
<Button style={{ marginTop: 10 }} onClick={onShowGraphRAG}>
|
|
||||||
{t('words.visualization')}
|
|
||||||
</Button>
|
|
||||||
</Container>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const Container = styled.div``
|
|
||||||
|
|
||||||
export default GraphRAGSettings
|
|
||||||
@ -31,7 +31,6 @@ import {
|
|||||||
import ApiCheckPopup from './ApiCheckPopup'
|
import ApiCheckPopup from './ApiCheckPopup'
|
||||||
import GithubCopilotSettings from './GithubCopilotSettings'
|
import GithubCopilotSettings from './GithubCopilotSettings'
|
||||||
import GPUStackSettings from './GPUStackSettings'
|
import GPUStackSettings from './GPUStackSettings'
|
||||||
import GraphRAGSettings from './GraphRAGSettings'
|
|
||||||
import HealthCheckPopup from './HealthCheckPopup'
|
import HealthCheckPopup from './HealthCheckPopup'
|
||||||
import LMStudioSettings from './LMStudioSettings'
|
import LMStudioSettings from './LMStudioSettings'
|
||||||
import ModelList, { ModelStatus } from './ModelList'
|
import ModelList, { ModelStatus } from './ModelList'
|
||||||
@ -380,9 +379,6 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
|
|||||||
{provider.id === 'ollama' && <OllamSettings />}
|
{provider.id === 'ollama' && <OllamSettings />}
|
||||||
{provider.id === 'lmstudio' && <LMStudioSettings />}
|
{provider.id === 'lmstudio' && <LMStudioSettings />}
|
||||||
{provider.id === 'gpustack' && <GPUStackSettings />}
|
{provider.id === 'gpustack' && <GPUStackSettings />}
|
||||||
{provider.id === 'graphrag-kylin-mountain' && provider.models.length > 0 && (
|
|
||||||
<GraphRAGSettings provider={provider} />
|
|
||||||
)}
|
|
||||||
{provider.id === 'copilot' && <GithubCopilotSettings provider={provider} setApiKey={setApiKey} />}
|
{provider.id === 'copilot' && <GithubCopilotSettings provider={provider} setApiKey={setApiKey} />}
|
||||||
<SettingSubtitle style={{ marginBottom: 5 }}>
|
<SettingSubtitle style={{ marginBottom: 5 }}>
|
||||||
<Space align="center" style={{ width: '100%', justifyContent: 'space-between' }}>
|
<Space align="center" style={{ width: '100%', justifyContent: 'space-between' }}>
|
||||||
|
|||||||
@ -289,10 +289,6 @@ export async function fetchSuggestions({
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.owned_by !== 'graphrag') {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
if (model.id.endsWith('global')) {
|
if (model.id.endsWith('global')) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user