refactor(GraphRAG): Remove GraphRAG related files and references from the project

This commit is contained in:
kangfenmao 2025-04-06 08:11:04 +08:00
parent b828d1f54f
commit 46c7df6f5b
14 changed files with 0 additions and 137 deletions

View File

@ -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>

View File

@ -14,7 +14,6 @@ import GiteeAIProviderLogo from '@renderer/assets/images/providers/gitee-ai.png'
import GithubProviderLogo from '@renderer/assets/images/providers/github.png'
import GoogleProviderLogo from '@renderer/assets/images/providers/google.png'
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 GroqProviderLogo from '@renderer/assets/images/providers/groq.png'
import HyperbolicProviderLogo from '@renderer/assets/images/providers/hyperbolic.png'
@ -64,7 +63,6 @@ const PROVIDER_LOGO_MAP = {
gemini: GoogleProviderLogo,
stepfun: StepProviderLogo,
doubao: BytedanceProviderLogo,
'graphrag-kylin-mountain': GraphRagProviderLogo,
minimax: MinimaxProviderLogo,
github: GithubProviderLogo,
copilot: GithubProviderLogo,

View File

@ -699,7 +699,6 @@
"gitee-ai": "Gitee AI",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "Tencent Hunyuan",

View File

@ -699,7 +699,6 @@
"gitee-ai": "Gitee AI",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "腾讯混元",

View File

@ -699,7 +699,6 @@
"gitee-ai": "Gitee AI",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "Tencent Hunyuan",

View File

@ -699,7 +699,6 @@
"gitee-ai": "Gitee AI",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "腾讯混元",

View File

@ -699,7 +699,6 @@
"gitee-ai": "Gitee AI",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "騰訊混元",

View File

@ -643,7 +643,6 @@
"gitee-ai": "Gitee AI",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "Tencent Hunyuan",

View File

@ -643,7 +643,6 @@
"gitee-ai": "Gitee IA",
"github": "GitHub Modelos",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "Tencent Hùnyuán",

View File

@ -643,7 +643,6 @@
"gitee-ai": "Gitee IA",
"github": "GitHub Modèles",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Grok",
"groq": "Groq",
"hunyuan": "Tencent HunYuan",

View File

@ -643,7 +643,6 @@
"gitee-ai": "Gitee IA",
"github": "GitHub Models",
"gpustack": "GPUStack",
"graphrag-kylin-mountain": "GraphRAG",
"grok": "Compreender",
"groq": "Groq",
"hunyuan": "Tencent Hún Yuán",

View File

@ -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

View File

@ -31,7 +31,6 @@ import {
import ApiCheckPopup from './ApiCheckPopup'
import GithubCopilotSettings from './GithubCopilotSettings'
import GPUStackSettings from './GPUStackSettings'
import GraphRAGSettings from './GraphRAGSettings'
import HealthCheckPopup from './HealthCheckPopup'
import LMStudioSettings from './LMStudioSettings'
import ModelList, { ModelStatus } from './ModelList'
@ -380,9 +379,6 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
{provider.id === 'ollama' && <OllamSettings />}
{provider.id === 'lmstudio' && <LMStudioSettings />}
{provider.id === 'gpustack' && <GPUStackSettings />}
{provider.id === 'graphrag-kylin-mountain' && provider.models.length > 0 && (
<GraphRAGSettings provider={provider} />
)}
{provider.id === 'copilot' && <GithubCopilotSettings provider={provider} setApiKey={setApiKey} />}
<SettingSubtitle style={{ marginBottom: 5 }}>
<Space align="center" style={{ width: '100%', justifyContent: 'space-between' }}>

View File

@ -289,10 +289,6 @@ export async function fetchSuggestions({
return []
}
if (model.owned_by !== 'graphrag') {
return []
}
if (model.id.endsWith('global')) {
return []
}