ExtractionSchema

org.llm4s.knowledgegraph.extraction.ExtractionSchema
See theExtractionSchema companion object
case class ExtractionSchema(entityTypes: Seq[EntityTypeDefinition], relationshipTypes: Seq[RelationshipTypeDefinition], allowOutOfSchema: Boolean)

Schema for guided knowledge graph extraction.

When provided to an extractor, the LLM prompt is constrained to these types and extracted results are validated against the schema. If allowOutOfSchema is true, entities and relationships outside the schema are preserved but flagged.

Value parameters

allowOutOfSchema

If true, out-of-schema entities/relationships are kept; if false, they are dropped

entityTypes

Expected entity type definitions

relationshipTypes

Expected relationship type definitions

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def entityTypeNames: Seq[String]

All entity type names defined in this schema.

All entity type names defined in this schema.

Attributes

def findEntityType(name: String): Option[EntityTypeDefinition]

Looks up an entity type definition by name (case-insensitive).

Looks up an entity type definition by name (case-insensitive).

Attributes

Looks up a relationship type definition by name (case-insensitive).

Looks up a relationship type definition by name (case-insensitive).

Attributes

def relationshipTypeNames: Seq[String]

All relationship type names defined in this schema.

All relationship type names defined in this schema.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product