Skip to content

Commit

Permalink
margin
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzeyu91 committed Aug 15, 2024
2 parents a7fa05e + a676e6c commit e0499f9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
<Version>0.1.17</Version>
<Version>0.1.19</Version>
<SKVersion>1.17.1</SKVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
在appsettings.json配置

```
"OpenAI": {
"GraphOpenAI": {
"Key": "sk-xxx",
"EndPoint": "https://api.antsk.cn/",
"ChatModel": "gpt-4o-mini",
Expand Down
7 changes: 0 additions & 7 deletions src/GraphRag.Net/Domain/Model/Constant/SystemConstant.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/GraphRag.Net/Domain/Service/GraphService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using GraphRag.Net.Options;
using GraphRag.Net.Domain.Interface;
using GraphRag.Net.Domain.Model.Constant;
using GraphRag.Net.Domain.Model.Graph;
using GraphRag.Net.Repositories;
using GraphRag.Net.Utils;
Expand Down Expand Up @@ -156,7 +155,7 @@ public async Task InsertGraphDataAsync(string index, string input)
_nodes_Repositories.Update(oldNode);
text2 = $"Name:{oldNode.Name};Type:{oldNode.Type};Desc:{oldNode.Desc}";
nodeDic.Add(n.Id, oldNode.Id);
await textMemory.SaveInformationAsync(SystemConstant.NodeIndex, id: oldNode.Id, text: text2, cancellationToken: default);
await textMemory.SaveInformationAsync(index, id: oldNode.Id, text: text2, cancellationToken: default);
continue;
}

Expand Down
22 changes: 7 additions & 15 deletions src/GraphRag.Net/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,20 @@ static void InitSK(IServiceCollection services,Kernel _kernel = null)
/// </summary>
static void CodeFirst()
{

// 获取仓储服务
var _repository = new Nodes_Repositories();

// 创建数据库(如果不存在)
_repository.GetDB().DbMaintenance.CreateDatabase();

// 获取当前应用程序域中所有程序集
var assemblies = AppDomain.CurrentDomain.GetAssemblies();

// 在所有程序集中查找具有[SugarTable]特性的类
foreach (var assembly in assemblies)
{
// 获取该程序集中所有具有SugarTable特性的类型
var entityTypes = assembly.GetTypes()
var assembly = Assembly.GetExecutingAssembly();
// 获取该程序集中所有具有SugarTable特性的类型
var entityTypes = assembly.GetTypes()
.Where(type => TypeIsEntity(type));

// 为每个找到的类型初始化数据库表
foreach (var type in entityTypes)
{
_repository.GetDB().CodeFirst.InitTables(type);
}
// 为每个找到的类型初始化数据库表
foreach (var type in entityTypes)
{
_repository.GetDB().CodeFirst.InitTables(type);
}
}

Expand Down

0 comments on commit e0499f9

Please sign in to comment.