Skip to content

Commit

Permalink
fix: use knowledge graph instead of database
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Selman <danscode@selman.org>
  • Loading branch information
dselman committed Jun 27, 2024
1 parent b1a025c commit b407910
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/TextToGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TextToGraphOptions, ToolMessage } from './types';

/**
* Converts natural language text to Graph Nodes and merges them
* into the property graph.
* into the knowlege graph.
*/
export class TextToGraph {
conversation: Conversation;
Expand All @@ -25,7 +25,7 @@ export class TextToGraph {
}

/**
* Converts text to graph nodes and relationships and adds them to the property graph
* Converts text to graph nodes and relationships and adds them to the knowlege graph
* @param text the text to extract nodes and relationships from
* @returns an object that describes which nodes and relationships were added
*/
Expand Down
4 changes: 2 additions & 2 deletions src/graphmodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ export class GraphModel {
result.push({
type: "function",
function: {
description: `Add a relationship ${relationship.getName()} from node ${node.getName()} to node ${relationship.getType()} to the property graph`,
description: `Add a relationship ${relationship.getName()} from node ${node.getName()} to node ${relationship.getType()} to the knowledge graph`,
name: `merge_relationship_${node.getName().toLowerCase()}_${relationship.getName().toLowerCase()}`,
function: (async (args: { sourceType: string, sourceIdentfiier: string, targetType: string, targetIdentfiier: string, sourcePropertyName: string }) => {
const context = await this.openSession();
Expand Down Expand Up @@ -901,7 +901,7 @@ export class GraphModel {
result.push({
type: "function",
function: {
description: `Add a node ${node.getName()} to the property graph`,
description: `Add a node ${node.getName()} to the knowledge graph`,
name: `merge_node_${node.getName().toLowerCase()}`,
function: (async (args: { identifier: string }) => {
const { identifier } = args;
Expand Down
4 changes: 2 additions & 2 deletions src/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { RunnableToolFunction } from "openai/lib/RunnableFunction";
export function getTextToGraphPrompt(textToGraphPrompt:string, ctoModel:string, text:string) : ChatCompletionSystemMessageParam {
return {
role: 'system',
content: `You are an expert assistant that converts natural language text into a property graph.
content: `You are an expert assistant that converts natural language text into a knowlege graph.
${textToGraphPrompt}
A property graph is composed of nodes, with relationships between the nodes. Nodes have a label and a set of properties.
A knowledge graph is composed of nodes, with relationships between the nodes. Nodes have a label and a set of properties.
The structure of the nodes and relationships that you output must conform to a schema defined by an Accord Project Concerto model.
Here is the Concerto model you must use:
Expand Down

0 comments on commit b407910

Please sign in to comment.