Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/Infrastructure/BotSharp.Abstraction/Graph/IGraphDb.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using BotSharp.Abstraction.Graph.Models;
using BotSharp.Abstraction.Graph.Options;
using BotSharp.Abstraction.Graph.Requests;
using BotSharp.Abstraction.Graph.Responses;

namespace BotSharp.Abstraction.Graph;

Expand All @@ -11,17 +9,4 @@ public interface IGraphDb

Task<GraphQueryResult> ExecuteQueryAsync(string query, GraphQueryExecuteOptions? options = null)
=> throw new NotImplementedException();

#region Node
Task<GraphNode?> GetNodeAsync(string graphId, string nodeId)
=> throw new NotImplementedException();
Task<GraphNode> CreateNodeAsync(string graphId, GraphNodeCreationModel node)
=> throw new NotImplementedException();
Task<GraphNode> UpdateNodeAsync(string graphId, string nodeId, GraphNodeUpdateModel node)
=> throw new NotImplementedException();
Task<GraphNode> UpsertNodeAsync(string graphId, string nodeId, GraphNodeUpdateModel node)
=> throw new NotImplementedException();
Task<GraphNodeDeleteResponse?> DeleteNodeAsync(string graphId, string nodeId)
=> throw new NotImplementedException();
#endregion
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
using BotSharp.Abstraction.Graph.Models;
using BotSharp.Abstraction.Graph.Options;
using BotSharp.Abstraction.Graph.Requests;
using BotSharp.Abstraction.Graph.Responses;

namespace BotSharp.Abstraction.Graph;

public interface IGraphKnowledgeService
{
Task<GraphQueryResult> ExecuteQueryAsync(string query, GraphQueryOptions? options = null);

#region Node
Task<GraphNode?> GetNodeAsync(string graphId, string nodeId, GraphNodeOptions? options = null);
Task<GraphNode> CreateNodeAsync(string graphId, GraphNodeCreationModel node, GraphNodeOptions? options = null);
Task<GraphNode> UpdateNodeAsync(string graphId, string nodeId, GraphNodeUpdateModel node, GraphNodeOptions? options = null);
Task<GraphNode> UpsertNodeAsync(string graphId, string nodeId, GraphNodeUpdateModel node, GraphNodeOptions? options = null);
Task<GraphNodeDeleteResponse?> DeleteNodeAsync(string graphId, string nodeId, GraphNodeOptions? options = null);
#endregion
}

This file was deleted.

15 changes: 0 additions & 15 deletions src/Infrastructure/BotSharp.Abstraction/Graph/Models/GraphNode.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

62 changes: 0 additions & 62 deletions src/Plugins/BotSharp.Plugin.Membase/GraphDb/MembaseGraphDb.Node.cs

This file was deleted.

11 changes: 0 additions & 11 deletions src/Plugins/BotSharp.Plugin.Membase/Models/Graph/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ public class Node
public NodeEmbedding? Embedding { get; set; }
public DateTime? Time { get; set; } = DateTime.UtcNow;

public GraphNode ToGraphNode()
{
return new GraphNode
{
Id = Id,
Labels = Labels ?? [],
Properties = Properties ?? new(),
Time = Time
};
}

public override string ToString()
{
var labelsString = Labels.Count > 0 ? string.Join(", ", Labels) : "No Labels";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using BotSharp.Abstraction.Graph.Requests;

namespace BotSharp.Plugin.Membase.Models;

public class NodeCreationModel
Expand All @@ -9,22 +7,6 @@ public class NodeCreationModel
public object? Properties { get; set; }
public NodeEmbedding? Embedding { get; set; }
public DateTime? Time { get; set; }

public static NodeCreationModel From(GraphNodeCreationModel request)
{
return new NodeCreationModel
{
Id = request.Id,
Labels = request.Labels,
Properties = request.Properties,
Time = request.Time,
Embedding = request?.Embedding != null ? new NodeEmbedding
{
Model = request.Embedding.Model,
Vector = request.Embedding.Vector
} : null
};
}
}

public class NodeEmbedding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using BotSharp.Abstraction.Graph.Requests;

namespace BotSharp.Plugin.Membase.Models;

public class NodeUpdateModel
Expand All @@ -9,20 +7,4 @@ public class NodeUpdateModel
public object? Properties { get; set; }
public NodeEmbedding? Embedding { get; set; }
public DateTime? Time { get; set; }

public static NodeUpdateModel From(GraphNodeUpdateModel request)
{
return new NodeUpdateModel
{
Id = request.Id,
Labels = request.Labels,
Properties = request.Properties,
Time = request.Time,
Embedding = request?.Embedding != null ? new NodeEmbedding
{
Model = request.Embedding.Model,
Vector = request.Embedding.Vector
} : null
};
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BotSharp.Abstraction.Graph.Models;
using BotSharp.Plugin.Membase.Models.Graph;

namespace BotSharp.Plugin.Membase.Services;

Expand Down Expand Up @@ -29,7 +30,7 @@ public async Task<GraphQueryResult> Execute(string graphId, string query, Dictio
};
}

public async Task<GraphNode> MergeNode(string graphId, GraphNode node)
public async Task<Node> MergeNode(string graphId, Node node)
{
var newNode = await _membase.MergeNodeAsync(graphId, node.Id, new NodeUpdateModel
{
Expand Down
Loading