The Base DataModels
We provide different backend-dependent DataModel
s to use.
These data models provide basic functionality for GraphRAGs, Agents etc.
The user can build new data models by inheriting from these base models.
The checking functions works for every type of data models,
e.g. SymbolicDataModel
, JsonDataModel
, DataModel
or Variable
.
ChatMessage
ChatMessages
ChatRole
Bases: str
, Enum
The chat message roles
Source code in synalinks/src/backend/pydantic/base.py
Document
Edge
Embedding
Embeddings
Entities
Entity
Bases: Unique
, Embeddings
, Label
, Stamp
An entity data model
Source code in synalinks/src/backend/pydantic/base.py
GenericIO
Bases: DataModel
A pair of generic inputs/outputs
Source code in synalinks/src/backend/pydantic/base.py
GenericInputs
GenericOutputs
Instructions
KnowledgeGraph
KnowledgeGraphs
Label
Prediction
The generator's prediction
Source code in synalinks/src/backend/pydantic/base.py
Reward
Stamp
Unique
Weight
is_chat_message(x)
Checks if the given data model is a chat message
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_chat_messages(x)
Checks if the given data model are chat messages
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_document(x)
Checks if the given data model is a document
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_edge(x)
Checks if the given data model is an edge
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_embedding(x)
Checks if the given data model is an embedding
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_embeddings(x)
Checks if the given data model are embeddings
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_entities(x)
Checks if the given data model are entities
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_entity(x)
Checks if the given data model is an entity
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_instructions(x)
Checks if the given data model is a instructions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_knowledge_graph(x)
Checks if the given data model is a knowledge graph
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_knowledge_graphs(x)
Checks if the given data model are knowledge graphs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |
Source code in synalinks/src/backend/pydantic/base.py
is_prediction(x)
Checks if the given data model is a prediction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
DataModel | JsonDataModel | SymbolicDataModel | Variable
|
The data model to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the condition is met |