The Base DataModels
We provide different backend-dependent DataModel
s to use.
These data models provide basic functionality for GraphRAGs, MCTS, 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
Edge
Embedding
Embeddings
Entities
Entity
GenericIO
GenericInputs
GenericOutputs
KnowledgeGraph
KnowledgeGraphs
Label
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_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_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 |