The Base DataModels
We provide different backend-dependent DataModel
s to use.
These data models provide I/O for chatbots, agents, rags, knowledge graphs etc.
The user can build new data models by inheriting from these base models.
The check functions works for every type of data models (by checking the schema)
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
Embedding
Embeddings
Entity
GenericIO
Bases: DataModel
A pair of generic inputs/outputs
Source code in synalinks/src/backend/pydantic/base.py
GenericInputs
GenericOutputs
GenericResult
Instructions
Bases: Entity
The generator's instructions
Source code in synalinks/src/backend/pydantic/base.py
Prediction
The generator's prediction
Source code in synalinks/src/backend/pydantic/base.py
Relation
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_embedded_entity(x)
Checks if the given data model is an embedded 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_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 is an entities model
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 an instructions data model
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 is a knowledge graph model
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 |
Source code in synalinks/src/backend/pydantic/base.py
is_relation(x)
Checks if is a relation model
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_relations(x)
Checks if is an relations model
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_similarity_search(x)
Checks if is a similarity search data model
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_triplet_search(x)
Checks if is a triplet seach data model
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 |