Elffuss BraidHub

kikocis/GraphRAG-SDK public

ca14f368bce9 · 3.4 KiBRawPermalink
1ONTOLOGY_DETECTION_SYSTEM_PROMPT = """Create SQL statement which will capture the different entities and the relations between them in the provided text.
2Each table should represent either a single entity type with the entity's attributes as the table columns or a relation between two entities, using foreign keys.
3For example an IMDB document is likely to produce 5 tables: Movie, Actor and Director each with its own columns and ACTED and DIRECTED tables.
4Do not create an ID primary key column but set the most compelling attribute as the entity's primary key
5Make sure to call the run_sql function provided in your tools set for each sql statement generated."""
6
7KNOWLEDGE_EXTRACTION_SYSTEM_PROMPT = """You are a helpful assistant with the goal of extracting
8entities and relationships from text"""
9
10SQL_FOLDING_PROMPT = """The following two CREATE TABLE SQL statments are
11creating the same table name, consolidate the two into a single
12CREATE TABLE SQL statment.
13Remove all duplicated columns.
14Make sure the number of PRIMARY KEYs and FOREIGN KEYs is maintained.
15Reply only with the result SQL statment, the reply should start with:
16CREATE TABLE and end with );
17For example: given the two CREATE TABLE SQL:
18CREATE TABLE Person (FirstName string, LastName string, Age int);
19CREATE TABLE Person (SurName string, ForeName string, Height int);
20The response should be:
21CREATE TABLE Person (FirstName string, LastName string, Age int, Height int);
22"""
23
24SQL_FOCUS_PROMPT = """Given a CREATE TABLE SQL statment the table name
25 represents some entity, in case the number of columns in the table is
26 greater than 5, remove columns which are less descriptive of the entity.
27 Do NOT remove columns which are either a PRIMARY KEY or a FOREIGN KEY.
28 Make sure to leave at least 5 columns.
29 Do NOT rename the table name.
30 Reply only with the result SQL statment, the reply should start with:
31 CREATE TABLE and end with );
32 For example: given the CREATE TABLE SQL:
33 CREATE TABLE Movie (
34 Title string PRIMARY KEY,
35 Genre string,
36 ReleaseYear int,
37 Rating string,
38 Language string,
39 BoxOffice string,
40 streaming_date STRING,
41 runtime STRING
42 );
43 The response should be:
44 CREATE TABLE Movie (
45 Title string PRIMARY KEY,
46 Genre string,
47 ReleaseYear int,
48 Rating string,
49 runtime STRING
50 );
51 Another example: given the CREATE TABLE SQL:
52 CREATE TABLE Episode (
53 show_title VARCHAR(255),
54 show_year VARCHAR(4),
55 season INT,
56 episode_number INT,
57 episode_title VARCHAR(255),
58 air_date DATE,
59 episode_rating DECIMAL(2, 1),
60 FOREIGN KEY (show_title, show_year) REFERENCES TVShow(title, year)
61 );
62 You are not allowed to remove either show_title or show_year as these are part of the table's
63 foreign key.
64 """
65
66RELATIONSHIP_NAMING_PROMPT = """"You are a Cypher expert, help suggest names for
67relationship types connecting source node to destination node.
68Respond only with the suggested name.
69For example given source node of type 'Actor' and destination node of type 'Movie'
70Replay with: ACTED"""
71
72FIND_UNIQUE_ATTRIBUTE_PROMPT = """From the list of attributes describing a graph node
73pick the most suitble attribute to act as a unique identifier of the node.
74Respond only with the suggested attribute name
75For example given a list of attributes: series_title, air_date, season_number, episode_number, title
76Describing the graph entity "Episode" Reply with: title"""