Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Created October 24, 2023 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/5224367dda62a320085858ba5c45260c to your computer and use it in GitHub Desktop.
Save shawngraham/5224367dda62a320085858ba5c45260c to your computer and use it in GitHub Desktop.
template for using with llm
system: 'You are an excellent natural language processor. Extract entities and relationships from the $input.'
prompt: 'Extract entities as indicated in the pattern, and ONLY predicates as indicated in the pattern. Return subject, predicate, object triples, ONLY ACCORDING to entity types and relationships in this pattern:
erDiagram
AUCTIONHOUSE ||--o{ ARTIFACT : auctions
AUCTIONHOUSE ||--o{ PERSON: sells_to
AUCTIONHOUSE ||--o{ MUSEUM: sells_to
MUSEUM {
string name
string city
string country
}
AUCTIONHOUSE {
string name
string city
string country
}
PERSON {
string name
string alias
string role
}
ORGANIZATION {
string name
string city
string country
}
GOVERNMENT_AGENCY {
string name
string country}
GALLERY {
string name
string city
string country
}
ARTIFACT {
string from_culture
string dates_from
}
ART_WORK {
string created_by
string dates_from}
ART_WORK ||--o{ ARTIFACT: is_instance_of
ORGANIZATION ||--|{ GOVERNMENT_AGENCY: is_instance_of
ORGANIZATION ||--|{ GALLERY: is_instance_of
GOVERNMENT_AGENCY ||--O{ ARTIFACT: repatriates
GALLERY ||--o{ ARTIFACT: has_possesion_of
MUSEUM ||--o{ ARTIFACT: has_possesion_of
PERSON ||--o{ ARTIFACT: buys
PERSON ||--o{ MUSEUM: donates_to
PERSON ||--o{ PERSON: works_with
PERSON ||--o{ ORGANIZATION: employed_by
PERSON ||--o{ ORGANIZATION: controls
PERSON ||--o{ PERSON: spouse_of
PERSON ||--o{ AUCTIONHOUSE: buys_at
PERSON ||--o{ PERSON: obtains_from
PERSON ||--o{ ARTIFACT: has_possesion_of
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment