The Base DataModels
We provide different backend-dependent DataModels to use.
These data models provide I/O for chatbots, agents, rags 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.
Embedding
Bases: DataModel
An embedding vector
Source code in synalinks/src/backend/pydantic/base.py
EmbeddingRequest
Bases: DataModel
Input for an embedding model: a single text or a batch.
Source code in synalinks/src/backend/pydantic/base.py
Embeddings
Bases: DataModel
A list of embeddings
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
Bases: DataModel
A generic inputs
Source code in synalinks/src/backend/pydantic/base.py
GenericOutputs
Bases: DataModel
A generic outputs
Source code in synalinks/src/backend/pydantic/base.py
GenericResult
Bases: DataModel
A generic result
Source code in synalinks/src/backend/pydantic/base.py
Instructions
Bases: Trainable
The instructions for the language model
Source code in synalinks/src/backend/pydantic/base.py
is_embedded(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_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_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_stamped(x)
Checks if the given data model is stamped
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_trainable(x)
Checks if the given data model is Trainable
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 |