corvic-engine 0.3.0rc55__cp38-abi3-win_amd64.whl → 0.3.0rc56__cp38-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- corvic/embed/node2vec.py +2 -2
- corvic/engine/_native.pyd +0 -0
- corvic/model/__init__.py +25 -1
- corvic/model/_agent.py +2 -6
- corvic/model/_base_model.py +43 -21
- corvic/model/_completion_model.py +4 -6
- corvic/model/_feature_view.py +4 -6
- corvic/model/_pipeline.py +2 -6
- corvic/model/_proto_orm_convert.py +123 -164
- corvic/model/_resource.py +2 -6
- corvic/model/_room.py +2 -2
- corvic/model/_source.py +10 -6
- corvic/model/_space.py +2 -6
- corvic/orm/__init__.py +22 -16
- corvic/orm/base.py +1 -1
- {corvic_engine-0.3.0rc55.dist-info → corvic_engine-0.3.0rc56.dist-info}/METADATA +1 -1
- {corvic_engine-0.3.0rc55.dist-info → corvic_engine-0.3.0rc56.dist-info}/RECORD +21 -21
- {corvic_engine-0.3.0rc55.dist-info → corvic_engine-0.3.0rc56.dist-info}/WHEEL +1 -1
- corvic_generated/model/v1alpha/models_pb2.py +16 -16
- corvic_generated/model/v1alpha/models_pb2.pyi +4 -2
- {corvic_engine-0.3.0rc55.dist-info → corvic_engine-0.3.0rc56.dist-info}/licenses/LICENSE +0 -0
corvic/embed/node2vec.py
CHANGED
@@ -176,7 +176,7 @@ class Space:
|
|
176
176
|
left_on=start_id_column_names,
|
177
177
|
right_on=self._node_ids,
|
178
178
|
how="left",
|
179
|
-
|
179
|
+
nulls_equal=True,
|
180
180
|
)
|
181
181
|
.select(["index"])
|
182
182
|
.rename({"index": "start"})
|
@@ -187,7 +187,7 @@ class Space:
|
|
187
187
|
left_on=end_id_column_names,
|
188
188
|
right_on=self._node_ids,
|
189
189
|
how="left",
|
190
|
-
|
190
|
+
nulls_equal=True,
|
191
191
|
)
|
192
192
|
.select(["index"])
|
193
193
|
.rename({"index": "end"})
|
corvic/engine/_native.pyd
CHANGED
Binary file
|
corvic/model/__init__.py
CHANGED
@@ -2,7 +2,13 @@
|
|
2
2
|
|
3
3
|
import corvic.model._feature_type as feature_type
|
4
4
|
from corvic.model._agent import Agent, AgentID
|
5
|
-
from corvic.model._base_model import
|
5
|
+
from corvic.model._base_model import (
|
6
|
+
BaseModel,
|
7
|
+
BelongsToOrgModel,
|
8
|
+
BelongsToRoomModel,
|
9
|
+
HasProtoSelf,
|
10
|
+
UsesOrmID,
|
11
|
+
)
|
6
12
|
from corvic.model._completion_model import (
|
7
13
|
CompletionModel,
|
8
14
|
CompletionModelID,
|
@@ -25,6 +31,14 @@ from corvic.model._pipeline import (
|
|
25
31
|
)
|
26
32
|
from corvic.model._proto_orm_convert import (
|
27
33
|
UNCOMMITTED_ID_PREFIX,
|
34
|
+
OrmBelongsToOrgObj,
|
35
|
+
OrmBelongsToRoomObj,
|
36
|
+
OrmObj,
|
37
|
+
ProtoBelongsToOrgObj,
|
38
|
+
ProtoBelongsToRoomObj,
|
39
|
+
ProtoObj,
|
40
|
+
add_orm_org_mixin_to_session,
|
41
|
+
add_orm_room_mixin_to_session,
|
28
42
|
space_orm_to_proto,
|
29
43
|
timestamp_orm_to_proto,
|
30
44
|
)
|
@@ -60,6 +74,8 @@ __all__ = [
|
|
60
74
|
"Agent",
|
61
75
|
"AgentID",
|
62
76
|
"BaseModel",
|
77
|
+
"BelongsToOrgModel",
|
78
|
+
"BelongsToRoomModel",
|
63
79
|
"ChunkPdfsPipeline",
|
64
80
|
"Column",
|
65
81
|
"CompletionModel",
|
@@ -76,8 +92,14 @@ __all__ = [
|
|
76
92
|
"ImageSpace",
|
77
93
|
"Node2VecParameters",
|
78
94
|
"OcrPdfsPipeline",
|
95
|
+
"OrmObj",
|
96
|
+
"OrmBelongsToOrgObj",
|
97
|
+
"OrmBelongsToRoomObj",
|
79
98
|
"Pipeline",
|
80
99
|
"PipelineID",
|
100
|
+
"ProtoObj",
|
101
|
+
"ProtoBelongsToOrgObj",
|
102
|
+
"ProtoBelongsToRoomObj",
|
81
103
|
"RelationalSpace",
|
82
104
|
"Resource",
|
83
105
|
"ResourceID",
|
@@ -96,6 +118,8 @@ __all__ = [
|
|
96
118
|
"UnknownTransformationPipeline",
|
97
119
|
"UnknownSpace",
|
98
120
|
"UsesOrmID",
|
121
|
+
"add_orm_org_mixin_to_session",
|
122
|
+
"add_orm_room_mixin_to_session",
|
99
123
|
"embedding_model_proto_to_name",
|
100
124
|
"feature_type",
|
101
125
|
"image_model_proto_to_name",
|
corvic/model/_agent.py
CHANGED
@@ -10,7 +10,7 @@ from typing import TypeAlias
|
|
10
10
|
from sqlalchemy import orm as sa_orm
|
11
11
|
|
12
12
|
from corvic import orm, system
|
13
|
-
from corvic.model._base_model import
|
13
|
+
from corvic.model._base_model import BelongsToRoomModel
|
14
14
|
from corvic.model._defaults import Defaults
|
15
15
|
from corvic.model._proto_orm_convert import (
|
16
16
|
agent_delete_orms,
|
@@ -27,7 +27,7 @@ FeatureViewID: TypeAlias = orm.FeatureViewID
|
|
27
27
|
AgentID: TypeAlias = orm.AgentID
|
28
28
|
|
29
29
|
|
30
|
-
class Agent(
|
30
|
+
class Agent(BelongsToRoomModel[AgentID, models_pb2.Agent, orm.Agent]):
|
31
31
|
"""A corvic agent represents a named agent that can produce embeddings."""
|
32
32
|
|
33
33
|
@classmethod
|
@@ -133,10 +133,6 @@ class Agent(BaseModel[AgentID, models_pb2.Agent, orm.Agent]):
|
|
133
133
|
def name(self) -> str:
|
134
134
|
return self.proto_self.name
|
135
135
|
|
136
|
-
@property
|
137
|
-
def room_id(self) -> RoomID:
|
138
|
-
return RoomID(self.proto_self.room_id)
|
139
|
-
|
140
136
|
@property
|
141
137
|
def parameters(self) -> AgentParameters:
|
142
138
|
return self.proto_self.agent_parameters
|
corvic/model/_base_model.py
CHANGED
@@ -5,29 +5,29 @@ import datetime
|
|
5
5
|
import functools
|
6
6
|
import uuid
|
7
7
|
from collections.abc import Callable, Iterable, Iterator, Sequence
|
8
|
-
from typing import Final, Generic
|
8
|
+
from typing import Final, Generic
|
9
9
|
|
10
10
|
import sqlalchemy as sa
|
11
11
|
import sqlalchemy.orm as sa_orm
|
12
12
|
import structlog
|
13
|
-
from google.protobuf import timestamp_pb2
|
14
13
|
from typing_extensions import Self
|
15
14
|
|
16
15
|
from corvic import orm, system
|
17
|
-
from corvic.model._proto_orm_convert import
|
16
|
+
from corvic.model._proto_orm_convert import (
|
17
|
+
ID,
|
18
|
+
UNCOMMITTED_ID_PREFIX,
|
19
|
+
OrmBelongsToOrgObj,
|
20
|
+
OrmBelongsToRoomObj,
|
21
|
+
OrmObj,
|
22
|
+
ProtoBelongsToOrgObj,
|
23
|
+
ProtoBelongsToRoomObj,
|
24
|
+
ProtoObj,
|
25
|
+
)
|
18
26
|
from corvic.result import InvalidArgumentError, NotFoundError, Ok
|
19
27
|
|
20
28
|
_logger = structlog.get_logger()
|
21
29
|
|
22
30
|
|
23
|
-
class _ModelProto(Protocol):
|
24
|
-
id: str
|
25
|
-
created_at: timestamp_pb2.Timestamp
|
26
|
-
|
27
|
-
|
28
|
-
_ProtoObj = TypeVar("_ProtoObj", bound=_ModelProto)
|
29
|
-
|
30
|
-
|
31
31
|
def _generate_uncommitted_id_str():
|
32
32
|
return f"{UNCOMMITTED_ID_PREFIX}{uuid.uuid4()}"
|
33
33
|
|
@@ -43,11 +43,11 @@ def _create_or_join_session(
|
|
43
43
|
yield session
|
44
44
|
|
45
45
|
|
46
|
-
class HasProtoSelf(Generic[
|
46
|
+
class HasProtoSelf(Generic[ProtoObj], abc.ABC):
|
47
47
|
client: Final[system.Client]
|
48
|
-
proto_self: Final[
|
48
|
+
proto_self: Final[ProtoObj]
|
49
49
|
|
50
|
-
def __init__(self, client: system.Client, proto_self:
|
50
|
+
def __init__(self, client: system.Client, proto_self: ProtoObj):
|
51
51
|
self.proto_self = proto_self
|
52
52
|
self.client = client
|
53
53
|
|
@@ -58,8 +58,8 @@ class HasProtoSelf(Generic[_ProtoObj], abc.ABC):
|
|
58
58
|
return None
|
59
59
|
|
60
60
|
|
61
|
-
class UsesOrmID(Generic[ID,
|
62
|
-
def __init__(self, client: system.Client, proto_self:
|
61
|
+
class UsesOrmID(Generic[ID, ProtoObj], HasProtoSelf[ProtoObj]):
|
62
|
+
def __init__(self, client: system.Client, proto_self: ProtoObj):
|
63
63
|
if not proto_self.id:
|
64
64
|
proto_self.id = _generate_uncommitted_id_str()
|
65
65
|
super().__init__(client, proto_self)
|
@@ -73,7 +73,7 @@ class UsesOrmID(Generic[ID, _ProtoObj], HasProtoSelf[_ProtoObj]):
|
|
73
73
|
return self.id_class().from_str(self.proto_self.id)
|
74
74
|
|
75
75
|
|
76
|
-
class BaseModel(Generic[ID,
|
76
|
+
class BaseModel(Generic[ID, ProtoObj, OrmObj], UsesOrmID[ID, ProtoObj]):
|
77
77
|
"""Base for orm wrappers providing a unified update mechanism."""
|
78
78
|
|
79
79
|
@classmethod
|
@@ -82,12 +82,12 @@ class BaseModel(Generic[ID, _ProtoObj, OrmObj], UsesOrmID[ID, _ProtoObj]):
|
|
82
82
|
|
83
83
|
@classmethod
|
84
84
|
@abc.abstractmethod
|
85
|
-
def orm_to_proto(cls, orm_obj: OrmObj) ->
|
85
|
+
def orm_to_proto(cls, orm_obj: OrmObj) -> ProtoObj: ...
|
86
86
|
|
87
87
|
@classmethod
|
88
88
|
@abc.abstractmethod
|
89
89
|
def proto_to_orm(
|
90
|
-
cls, proto_obj:
|
90
|
+
cls, proto_obj: ProtoObj, session: orm.Session
|
91
91
|
) -> Ok[OrmObj] | InvalidArgumentError: ...
|
92
92
|
|
93
93
|
@classmethod
|
@@ -102,7 +102,7 @@ class BaseModel(Generic[ID, _ProtoObj, OrmObj], UsesOrmID[ID, _ProtoObj]):
|
|
102
102
|
obj_id: ID,
|
103
103
|
client: system.Client,
|
104
104
|
existing_session: sa_orm.Session | None = None,
|
105
|
-
) -> Ok[
|
105
|
+
) -> Ok[ProtoObj] | NotFoundError:
|
106
106
|
"""Create a model object by loading it from the database."""
|
107
107
|
with _create_or_join_session(client, existing_session) as session:
|
108
108
|
orm_self = session.get(cls.orm_class(), obj_id)
|
@@ -146,7 +146,7 @@ class BaseModel(Generic[ID, _ProtoObj, OrmObj], UsesOrmID[ID, _ProtoObj]):
|
|
146
146
|
]
|
147
147
|
| None = None,
|
148
148
|
existing_session: sa_orm.Session | None = None,
|
149
|
-
) -> Ok[list[
|
149
|
+
) -> Ok[list[ProtoObj]] | NotFoundError | InvalidArgumentError:
|
150
150
|
"""List sources that exist in storage."""
|
151
151
|
orm_class = cls.orm_class()
|
152
152
|
with _create_or_join_session(client, existing_session) as session:
|
@@ -231,3 +231,25 @@ class BaseModel(Generic[ID, _ProtoObj, OrmObj], UsesOrmID[ID, _ProtoObj]):
|
|
231
231
|
proto_self=new_proto_self,
|
232
232
|
)
|
233
233
|
)
|
234
|
+
|
235
|
+
|
236
|
+
class BelongsToOrgModel(
|
237
|
+
Generic[ID, ProtoBelongsToOrgObj, OrmBelongsToOrgObj],
|
238
|
+
BaseModel[ID, ProtoBelongsToOrgObj, OrmBelongsToOrgObj],
|
239
|
+
):
|
240
|
+
"""Base for orm wrappers with org mixin providing a unified update mechanism."""
|
241
|
+
|
242
|
+
@property
|
243
|
+
def org_id(self) -> orm.OrgID:
|
244
|
+
return orm.OrgID().from_str(self.proto_self.org_id)
|
245
|
+
|
246
|
+
|
247
|
+
class BelongsToRoomModel(
|
248
|
+
Generic[ID, ProtoBelongsToRoomObj, OrmBelongsToRoomObj],
|
249
|
+
BelongsToOrgModel[ID, ProtoBelongsToRoomObj, OrmBelongsToRoomObj],
|
250
|
+
):
|
251
|
+
"""Base for orm wrappers with room mixin providing a unified update mechanism."""
|
252
|
+
|
253
|
+
@property
|
254
|
+
def room_id(self) -> orm.RoomID:
|
255
|
+
return orm.RoomID().from_str(self.proto_self.room_id)
|
@@ -11,7 +11,7 @@ from google.protobuf import timestamp_pb2
|
|
11
11
|
from sqlalchemy import orm as sa_orm
|
12
12
|
|
13
13
|
from corvic import orm, system
|
14
|
-
from corvic.model._base_model import
|
14
|
+
from corvic.model._base_model import BelongsToOrgModel
|
15
15
|
from corvic.model._defaults import Defaults
|
16
16
|
from corvic.model._proto_orm_convert import (
|
17
17
|
completion_model_delete_orms,
|
@@ -29,7 +29,9 @@ UNIX_TIMESTAMP_START_DATETIME = timestamp_pb2.Timestamp(seconds=0, nanos=0)
|
|
29
29
|
|
30
30
|
|
31
31
|
class CompletionModel(
|
32
|
-
|
32
|
+
BelongsToOrgModel[
|
33
|
+
CompletionModelID, models_pb2.CompletionModel, orm.CompletionModel
|
34
|
+
]
|
33
35
|
):
|
34
36
|
"""Completion Models."""
|
35
37
|
|
@@ -61,10 +63,6 @@ class CompletionModel(
|
|
61
63
|
def name(self) -> str:
|
62
64
|
return self.proto_self.name
|
63
65
|
|
64
|
-
@property
|
65
|
-
def org_id(self) -> OrgID:
|
66
|
-
return OrgID(self.proto_self.org_id)
|
67
|
-
|
68
66
|
@property
|
69
67
|
def provider(self) -> Literal["openai-generic", "azure-openai"] | None:
|
70
68
|
match self.proto_self.parameters.WhichOneof("params"):
|
corvic/model/_feature_view.py
CHANGED
@@ -18,7 +18,7 @@ from sqlalchemy.orm.interfaces import LoaderOption
|
|
18
18
|
from typing_extensions import Self
|
19
19
|
|
20
20
|
from corvic import op_graph, orm, system
|
21
|
-
from corvic.model._base_model import
|
21
|
+
from corvic.model._base_model import BelongsToRoomModel, UsesOrmID
|
22
22
|
from corvic.model._defaults import Defaults
|
23
23
|
from corvic.model._proto_orm_convert import (
|
24
24
|
feature_view_delete_orms,
|
@@ -642,7 +642,9 @@ class DeepGnnCsvUrlMetadata(DataclassAsTypedMetadataMixin):
|
|
642
642
|
output_csv_url: str
|
643
643
|
|
644
644
|
|
645
|
-
class FeatureView(
|
645
|
+
class FeatureView(
|
646
|
+
BelongsToRoomModel[FeatureViewID, models_pb2.FeatureView, orm.FeatureView]
|
647
|
+
):
|
646
648
|
"""FeatureViews describe how Sources should be modeled to create a feature space.
|
647
649
|
|
648
650
|
Example:
|
@@ -738,10 +740,6 @@ class FeatureView(BaseModel[FeatureViewID, models_pb2.FeatureView, orm.FeatureVi
|
|
738
740
|
pass
|
739
741
|
return Ok([cls.from_proto(proto, client) for proto in protos])
|
740
742
|
|
741
|
-
@property
|
742
|
-
def room_id(self):
|
743
|
-
return RoomID(self.proto_self.room_id)
|
744
|
-
|
745
743
|
@property
|
746
744
|
def source_ids(self):
|
747
745
|
return [fv_source.source.id for fv_source in self.feature_view_sources]
|
corvic/model/_pipeline.py
CHANGED
@@ -15,7 +15,7 @@ from typing_extensions import Self
|
|
15
15
|
|
16
16
|
import corvic.table
|
17
17
|
from corvic import op_graph, orm, system
|
18
|
-
from corvic.model._base_model import
|
18
|
+
from corvic.model._base_model import BelongsToRoomModel
|
19
19
|
from corvic.model._defaults import Defaults
|
20
20
|
from corvic.model._proto_orm_convert import (
|
21
21
|
pipeline_delete_orms,
|
@@ -31,7 +31,7 @@ PipelineID: TypeAlias = orm.PipelineID
|
|
31
31
|
RoomID: TypeAlias = orm.RoomID
|
32
32
|
|
33
33
|
|
34
|
-
class Pipeline(
|
34
|
+
class Pipeline(BelongsToRoomModel[PipelineID, models_pb2.Pipeline, orm.Pipeline]):
|
35
35
|
"""Pipelines map resources to sources."""
|
36
36
|
|
37
37
|
@classmethod
|
@@ -152,10 +152,6 @@ class Pipeline(BaseModel[PipelineID, models_pb2.Pipeline, orm.Pipeline]):
|
|
152
152
|
case Ok(protos):
|
153
153
|
return Ok([cls.from_proto(proto, client) for proto in protos])
|
154
154
|
|
155
|
-
@property
|
156
|
-
def room_id(self):
|
157
|
-
return RoomID(self.proto_self.room_id)
|
158
|
-
|
159
155
|
@property
|
160
156
|
def name(self):
|
161
157
|
return self.proto_self.name
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import datetime
|
2
2
|
from collections.abc import Callable, Sequence
|
3
|
-
from typing import Any, Protocol, TypeVar
|
3
|
+
from typing import Any, Protocol, TypeVar
|
4
4
|
|
5
5
|
import sqlalchemy as sa
|
6
6
|
import sqlalchemy.orm as sa_orm
|
@@ -14,26 +14,30 @@ from corvic_generated.orm.v1 import feature_view_pb2
|
|
14
14
|
|
15
15
|
UNCOMMITTED_ID_PREFIX = "__uncommitted_object-"
|
16
16
|
|
17
|
-
_Proto = TypeVar(
|
18
|
-
"_Proto",
|
19
|
-
models_pb2.Resource,
|
20
|
-
models_pb2.Source,
|
21
|
-
models_pb2.FeatureView,
|
22
|
-
models_pb2.Space,
|
23
|
-
models_pb2.FeatureViewSource,
|
24
|
-
models_pb2.Agent,
|
25
|
-
models_pb2.Pipeline,
|
26
|
-
models_pb2.Room,
|
27
|
-
models_pb2.CompletionModel,
|
28
|
-
)
|
29
17
|
ID = TypeVar("ID", bound=orm.BaseID[Any])
|
30
18
|
|
31
19
|
|
20
|
+
class _ModelProto(Protocol):
|
21
|
+
id: str
|
22
|
+
created_at: timestamp_pb2.Timestamp
|
23
|
+
|
24
|
+
|
25
|
+
class _ModelBelongsToOrgProto(_ModelProto, Protocol):
|
26
|
+
org_id: str
|
27
|
+
|
28
|
+
|
29
|
+
class _ModelBelongsToRoomProto(_ModelBelongsToOrgProto, Protocol):
|
30
|
+
room_id: str
|
31
|
+
|
32
|
+
|
33
|
+
ProtoObj = TypeVar("ProtoObj", bound=_ModelProto)
|
34
|
+
ProtoBelongsToOrgObj = TypeVar("ProtoBelongsToOrgObj", bound=_ModelBelongsToOrgProto)
|
35
|
+
ProtoBelongsToRoomObj = TypeVar("ProtoBelongsToRoomObj", bound=_ModelBelongsToRoomProto)
|
36
|
+
|
37
|
+
|
32
38
|
class _OrmModel(Protocol[ID]):
|
33
39
|
id: sa_orm.Mapped[ID | None]
|
34
40
|
|
35
|
-
org_id: sa_orm.Mapped[orm.OrgID | None]
|
36
|
-
|
37
41
|
@sa.ext.hybrid.hybrid_property
|
38
42
|
def created_at(self) -> datetime.datetime | None: ...
|
39
43
|
|
@@ -42,7 +46,17 @@ class _OrmModel(Protocol[ID]):
|
|
42
46
|
def _created_at_expression(cls): ...
|
43
47
|
|
44
48
|
|
49
|
+
class _OrmBelongsToOrgModel(_OrmModel[ID], Protocol):
|
50
|
+
org_id: sa_orm.Mapped[orm.OrgID | None]
|
51
|
+
|
52
|
+
|
53
|
+
class _OrmBelongsToRoomModel(_OrmBelongsToOrgModel[ID], Protocol):
|
54
|
+
room_id: sa_orm.Mapped[orm.RoomID | None]
|
55
|
+
|
56
|
+
|
45
57
|
OrmObj = TypeVar("OrmObj", bound=_OrmModel[Any])
|
58
|
+
OrmBelongsToOrgObj = TypeVar("OrmBelongsToOrgObj", bound=_OrmBelongsToOrgModel[Any])
|
59
|
+
OrmBelongsToRoomObj = TypeVar("OrmBelongsToRoomObj", bound=_OrmBelongsToRoomModel[Any])
|
46
60
|
|
47
61
|
|
48
62
|
def _translate_orm_id(
|
@@ -58,39 +72,6 @@ def _translate_orm_id(
|
|
58
72
|
return Ok(parsed_obj_id)
|
59
73
|
|
60
74
|
|
61
|
-
def _translate_orm_ids(
|
62
|
-
proto_obj: _Proto, obj_id_class: type[ID]
|
63
|
-
) -> Ok[tuple[ID | None, orm.RoomID | None]] | orm.InvalidORMIdentifierError:
|
64
|
-
match _translate_orm_id(proto_obj.id, obj_id_class):
|
65
|
-
case orm.InvalidORMIdentifierError() as err:
|
66
|
-
return err
|
67
|
-
case Ok(obj_id):
|
68
|
-
pass
|
69
|
-
|
70
|
-
match proto_obj:
|
71
|
-
case (
|
72
|
-
models_pb2.Resource()
|
73
|
-
| models_pb2.Source()
|
74
|
-
| models_pb2.FeatureView()
|
75
|
-
| models_pb2.Space()
|
76
|
-
| models_pb2.Agent()
|
77
|
-
| models_pb2.Pipeline()
|
78
|
-
| models_pb2.FeatureViewSource()
|
79
|
-
):
|
80
|
-
room_id = orm.RoomID(proto_obj.room_id)
|
81
|
-
match room_id.to_db():
|
82
|
-
case orm.InvalidORMIdentifierError() as err:
|
83
|
-
return err
|
84
|
-
case Ok():
|
85
|
-
pass
|
86
|
-
case models_pb2.CompletionModel():
|
87
|
-
room_id = None
|
88
|
-
case models_pb2.Room():
|
89
|
-
room_id = cast(orm.RoomID, obj_id)
|
90
|
-
|
91
|
-
return Ok((obj_id, room_id))
|
92
|
-
|
93
|
-
|
94
75
|
def timestamp_orm_to_proto(
|
95
76
|
timestamp_orm: datetime.datetime | None,
|
96
77
|
) -> timestamp_pb2.Timestamp | None:
|
@@ -247,43 +228,51 @@ def completion_model_orm_to_proto(
|
|
247
228
|
)
|
248
229
|
|
249
230
|
|
250
|
-
def
|
251
|
-
orm_obj:
|
252
|
-
|
253
|
-
|
254
|
-
|
231
|
+
def add_orm_org_mixin_to_session(
|
232
|
+
orm_obj: OrmBelongsToOrgObj,
|
233
|
+
proto_obj: _ModelBelongsToOrgProto,
|
234
|
+
id_class: type[ID],
|
235
|
+
session: sa_orm.Session,
|
236
|
+
) -> Ok[OrmBelongsToOrgObj] | orm.InvalidORMIdentifierError:
|
237
|
+
match _translate_orm_id(proto_obj.id, id_class):
|
238
|
+
case Ok(orm_id):
|
239
|
+
orm_obj.id = orm_id
|
240
|
+
case orm.InvalidORMIdentifierError() as err:
|
241
|
+
return err
|
242
|
+
if proto_obj.org_id:
|
243
|
+
org_id = orm.OrgID(proto_obj.org_id)
|
244
|
+
match org_id.to_db():
|
245
|
+
case Ok():
|
246
|
+
orm_obj.org_id = org_id
|
247
|
+
case orm.InvalidORMIdentifierError() as err:
|
248
|
+
return err
|
249
|
+
orm_obj.org_id = org_id
|
255
250
|
if not orm_obj.id:
|
256
251
|
session.add(orm_obj)
|
257
252
|
else:
|
258
253
|
orm_obj = session.merge(orm_obj)
|
259
|
-
return orm_obj
|
254
|
+
return Ok(orm_obj)
|
260
255
|
|
261
256
|
|
262
|
-
def
|
263
|
-
|
264
|
-
|
265
|
-
|
257
|
+
def add_orm_room_mixin_to_session(
|
258
|
+
orm_obj: OrmBelongsToRoomObj,
|
259
|
+
proto_obj: _ModelBelongsToRoomProto,
|
260
|
+
id_class: type[ID],
|
261
|
+
session: sa_orm.Session,
|
262
|
+
) -> Ok[OrmBelongsToRoomObj] | orm.InvalidORMIdentifierError:
|
263
|
+
room_id = orm.RoomID(proto_obj.room_id)
|
264
|
+
match room_id.to_db():
|
265
|
+
case Ok():
|
266
|
+
pass
|
266
267
|
case orm.InvalidORMIdentifierError() as err:
|
267
268
|
return err
|
268
|
-
|
269
|
-
|
270
|
-
if not room_id:
|
271
|
-
return InvalidArgumentError("room id required to commit")
|
269
|
+
orm_obj.room_id = orm.RoomID(proto_obj.room_id)
|
270
|
+
return add_orm_org_mixin_to_session(orm_obj, proto_obj, id_class, session)
|
272
271
|
|
273
|
-
orm_obj = orm.Resource(
|
274
|
-
id=obj_id,
|
275
|
-
name=proto_obj.name,
|
276
|
-
description=proto_obj.description,
|
277
|
-
mime_type=proto_obj.mime_type,
|
278
|
-
md5=proto_obj.md5,
|
279
|
-
url=proto_obj.url,
|
280
|
-
size=proto_obj.size,
|
281
|
-
original_path=proto_obj.original_path,
|
282
|
-
latest_event=proto_obj.recent_events[-1] if proto_obj.recent_events else None,
|
283
|
-
room_id=room_id,
|
284
|
-
)
|
285
|
-
_add_orm_to_session(orm_obj, proto_obj.org_id, session)
|
286
272
|
|
273
|
+
def _resource_pipeline_to_orm(
|
274
|
+
proto_obj: models_pb2.Resource, orm_obj: orm.Resource, session: sa_orm.Session
|
275
|
+
) -> Ok[None] | InvalidArgumentError:
|
287
276
|
if proto_obj.pipeline_id:
|
288
277
|
match _translate_orm_id(proto_obj.pipeline_id, orm.PipelineID):
|
289
278
|
case orm.InvalidORMIdentifierError() as err:
|
@@ -299,18 +288,41 @@ def resource_proto_to_orm(
|
|
299
288
|
resource_id=orm_obj.id,
|
300
289
|
name=proto_obj.pipeline_input_name,
|
301
290
|
pipeline_id=pipeline_id,
|
302
|
-
room_id=room_id,
|
291
|
+
room_id=orm_obj.room_id,
|
303
292
|
)
|
304
293
|
if orm_obj.org_id:
|
305
294
|
pipeline_input.org_id = orm_obj.org_id
|
306
295
|
orm_obj.pipeline_ref = session.merge(pipeline_input)
|
296
|
+
return Ok(None)
|
307
297
|
|
308
|
-
|
298
|
+
|
299
|
+
def resource_proto_to_orm(
|
300
|
+
proto_obj: models_pb2.Resource, session: sa_orm.Session
|
301
|
+
) -> Ok[orm.Resource] | InvalidArgumentError:
|
302
|
+
orm_obj = orm.Resource(
|
303
|
+
name=proto_obj.name,
|
304
|
+
description=proto_obj.description,
|
305
|
+
mime_type=proto_obj.mime_type,
|
306
|
+
md5=proto_obj.md5,
|
307
|
+
url=proto_obj.url,
|
308
|
+
size=proto_obj.size,
|
309
|
+
original_path=proto_obj.original_path,
|
310
|
+
latest_event=proto_obj.recent_events[-1] if proto_obj.recent_events else None,
|
311
|
+
)
|
312
|
+
add_orm_room_mixin_to_session(orm_obj, proto_obj, orm.ResourceID, session)
|
313
|
+
|
314
|
+
match _resource_pipeline_to_orm(proto_obj, orm_obj, session):
|
315
|
+
case Ok(None):
|
316
|
+
return Ok(orm_obj)
|
317
|
+
case InvalidArgumentError() as err:
|
318
|
+
return err
|
309
319
|
|
310
320
|
|
311
321
|
def _ensure_id(
|
312
|
-
proto_obj:
|
313
|
-
proto_to_orm: Callable[
|
322
|
+
proto_obj: ProtoObj,
|
323
|
+
proto_to_orm: Callable[
|
324
|
+
[ProtoObj, sa_orm.Session], Ok[OrmObj] | InvalidArgumentError
|
325
|
+
],
|
314
326
|
id_type: type[ID],
|
315
327
|
session: sa_orm.Session,
|
316
328
|
) -> Ok[ID] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
@@ -333,23 +345,19 @@ def _ensure_id(
|
|
333
345
|
def pipeline_proto_to_orm( # noqa: C901
|
334
346
|
proto_obj: models_pb2.Pipeline, session: sa_orm.Session
|
335
347
|
) -> Ok[orm.Pipeline] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
336
|
-
match _translate_orm_ids(proto_obj, orm.PipelineID):
|
337
|
-
case orm.InvalidORMIdentifierError() as err:
|
338
|
-
return err
|
339
|
-
case Ok((obj_id, room_id)):
|
340
|
-
pass
|
341
|
-
if not room_id:
|
342
|
-
return InvalidArgumentError("room id required to commit")
|
343
|
-
|
344
348
|
inputs = list[orm.PipelineInput]()
|
345
349
|
orm_obj = orm.Pipeline(
|
346
|
-
id=obj_id,
|
347
350
|
name=proto_obj.name,
|
348
|
-
room_id=room_id,
|
349
351
|
transformation=proto_obj.pipeline_transformation,
|
350
352
|
description=proto_obj.description,
|
351
353
|
)
|
352
|
-
|
354
|
+
if proto_obj.org_id:
|
355
|
+
orm_obj.org_id = orm.OrgID(proto_obj.org_id)
|
356
|
+
match add_orm_room_mixin_to_session(orm_obj, proto_obj, orm.PipelineID, session):
|
357
|
+
case Ok(orm_obj):
|
358
|
+
pass
|
359
|
+
case orm.InvalidORMIdentifierError() as err:
|
360
|
+
return err
|
353
361
|
session.flush()
|
354
362
|
|
355
363
|
if not orm_obj.id:
|
@@ -364,7 +372,10 @@ def pipeline_proto_to_orm( # noqa: C901
|
|
364
372
|
pass
|
365
373
|
outputs.append(
|
366
374
|
orm.PipelineOutput(
|
367
|
-
source_id=source_id,
|
375
|
+
source_id=source_id,
|
376
|
+
name=name,
|
377
|
+
pipeline_id=orm_obj.id,
|
378
|
+
room_id=orm_obj.room_id,
|
368
379
|
)
|
369
380
|
)
|
370
381
|
|
@@ -380,21 +391,11 @@ def pipeline_proto_to_orm( # noqa: C901
|
|
380
391
|
def source_proto_to_orm(
|
381
392
|
proto_obj: models_pb2.Source, session: sa_orm.Session
|
382
393
|
) -> Ok[orm.Source] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
383
|
-
match _translate_orm_ids(proto_obj, orm.SourceID):
|
384
|
-
case orm.InvalidORMIdentifierError() as err:
|
385
|
-
return err
|
386
|
-
case Ok((obj_id, room_id)):
|
387
|
-
pass
|
388
|
-
if not room_id:
|
389
|
-
return InvalidArgumentError("room id required to commit")
|
390
|
-
|
391
394
|
orm_obj = orm.Source(
|
392
|
-
id=obj_id,
|
393
395
|
name=proto_obj.name,
|
394
396
|
table_op_graph=proto_obj.table_op_graph,
|
395
|
-
room_id=room_id,
|
396
397
|
)
|
397
|
-
return
|
398
|
+
return add_orm_room_mixin_to_session(orm_obj, proto_obj, orm.SourceID, session)
|
398
399
|
|
399
400
|
|
400
401
|
def _update_agent_associations(
|
@@ -431,21 +432,15 @@ def _update_agent_associations(
|
|
431
432
|
def agent_proto_to_orm(
|
432
433
|
proto_obj: models_pb2.Agent, session: sa_orm.Session
|
433
434
|
) -> Ok[orm.Agent] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
434
|
-
match _translate_orm_ids(proto_obj, orm.AgentID):
|
435
|
-
case orm.InvalidORMIdentifierError() as err:
|
436
|
-
return err
|
437
|
-
case Ok((obj_id, room_id)):
|
438
|
-
pass
|
439
|
-
if not room_id:
|
440
|
-
return InvalidArgumentError("room id required to commit")
|
441
|
-
|
442
435
|
orm_obj = orm.Agent(
|
443
|
-
id=obj_id,
|
444
436
|
name=proto_obj.name,
|
445
437
|
parameters=proto_obj.agent_parameters,
|
446
|
-
room_id=room_id,
|
447
438
|
)
|
448
|
-
|
439
|
+
match add_orm_room_mixin_to_session(orm_obj, proto_obj, orm.AgentID, session):
|
440
|
+
case Ok(agent):
|
441
|
+
pass
|
442
|
+
case orm.InvalidORMIdentifierError() as err:
|
443
|
+
return err
|
449
444
|
session.flush()
|
450
445
|
|
451
446
|
if not agent.id:
|
@@ -462,14 +457,6 @@ def agent_proto_to_orm(
|
|
462
457
|
def space_proto_to_orm(
|
463
458
|
proto_obj: models_pb2.Space, session: sa_orm.Session
|
464
459
|
) -> Ok[orm.Space] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
465
|
-
match _translate_orm_ids(proto_obj, orm.SpaceID):
|
466
|
-
case orm.InvalidORMIdentifierError() as err:
|
467
|
-
return err
|
468
|
-
case Ok((obj_id, room_id)):
|
469
|
-
pass
|
470
|
-
if not room_id:
|
471
|
-
return InvalidArgumentError("room id required to commit")
|
472
|
-
|
473
460
|
match _ensure_id(
|
474
461
|
proto_obj.feature_view, feature_view_proto_to_orm, orm.FeatureViewID, session
|
475
462
|
):
|
@@ -482,38 +469,29 @@ def space_proto_to_orm(
|
|
482
469
|
raise InternalError("internal assertion did not hold")
|
483
470
|
|
484
471
|
orm_obj = orm.Space(
|
485
|
-
id=obj_id,
|
486
472
|
name=proto_obj.name,
|
487
473
|
description=proto_obj.description,
|
488
|
-
room_id=room_id,
|
489
474
|
feature_view_id=feature_view_id,
|
490
475
|
parameters=proto_obj.space_parameters,
|
491
476
|
auto_sync=proto_obj.auto_sync,
|
492
477
|
)
|
493
|
-
return
|
478
|
+
return add_orm_room_mixin_to_session(orm_obj, proto_obj, orm.SpaceID, session)
|
494
479
|
|
495
480
|
|
496
|
-
def feature_view_proto_to_orm(
|
481
|
+
def feature_view_proto_to_orm(
|
497
482
|
proto_obj: models_pb2.FeatureView, session: sa_orm.Session
|
498
483
|
) -> Ok[orm.FeatureView] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
499
|
-
match _translate_orm_ids(proto_obj, orm.FeatureViewID):
|
500
|
-
case orm.InvalidORMIdentifierError() as err:
|
501
|
-
return err
|
502
|
-
case Ok((obj_id, room_id)):
|
503
|
-
pass
|
504
|
-
if not room_id:
|
505
|
-
return InvalidArgumentError("room id required to commit")
|
506
|
-
|
507
484
|
orm_obj = orm.FeatureView(
|
508
|
-
id=obj_id,
|
509
485
|
name=proto_obj.name,
|
510
486
|
description=proto_obj.description,
|
511
|
-
room_id=room_id,
|
512
487
|
)
|
513
488
|
if proto_obj.org_id:
|
514
489
|
orm_obj.org_id = orm.OrgID(proto_obj.org_id)
|
515
|
-
|
516
|
-
|
490
|
+
match add_orm_room_mixin_to_session(orm_obj, proto_obj, orm.FeatureViewID, session):
|
491
|
+
case Ok(orm_obj):
|
492
|
+
pass
|
493
|
+
case orm.InvalidORMIdentifierError() as err:
|
494
|
+
return err
|
517
495
|
session.flush()
|
518
496
|
|
519
497
|
if not orm_obj.id:
|
@@ -573,57 +551,38 @@ def _feature_view_source_proto_to_orm(
|
|
573
551
|
return err
|
574
552
|
case Ok(source_id):
|
575
553
|
pass
|
576
|
-
match _translate_orm_id(proto_obj.id, orm.FeatureViewSourceID):
|
577
|
-
case orm.InvalidORMIdentifierError() as err:
|
578
|
-
return err
|
579
|
-
case Ok(obj_id):
|
580
|
-
pass
|
581
554
|
|
582
555
|
orm_obj = orm.FeatureViewSource(
|
583
|
-
room_id=orm.RoomID(proto_obj.room_id),
|
584
|
-
id=obj_id,
|
585
556
|
table_op_graph=proto_obj.table_op_graph,
|
586
557
|
drop_disconnected=proto_obj.drop_disconnected,
|
587
558
|
source_id=source_id,
|
588
559
|
feature_view_id=feature_view_id,
|
589
560
|
)
|
590
|
-
return
|
561
|
+
return add_orm_room_mixin_to_session(
|
562
|
+
orm_obj, proto_obj, orm.FeatureViewSourceID, session
|
563
|
+
)
|
591
564
|
|
592
565
|
|
593
566
|
def room_proto_to_orm(
|
594
567
|
proto_obj: models_pb2.Room, session: sa_orm.Session
|
595
568
|
) -> Ok[orm.Room] | orm.InvalidORMIdentifierError | InvalidArgumentError:
|
596
|
-
|
597
|
-
|
598
|
-
return err
|
599
|
-
case Ok((obj_id, _)):
|
600
|
-
pass
|
601
|
-
|
602
|
-
orm_obj = orm.Room(
|
603
|
-
id=obj_id,
|
604
|
-
name=proto_obj.name,
|
605
|
-
)
|
606
|
-
return Ok(_add_orm_to_session(orm_obj, proto_obj.org_id, session))
|
569
|
+
orm_obj = orm.Room(name=proto_obj.name)
|
570
|
+
return add_orm_org_mixin_to_session(orm_obj, proto_obj, orm.RoomID, session)
|
607
571
|
|
608
572
|
|
609
573
|
def completion_model_proto_to_orm(
|
610
574
|
proto_obj: models_pb2.CompletionModel, session: sa_orm.Session
|
611
575
|
) -> Ok[orm.CompletionModel] | InvalidArgumentError:
|
612
|
-
match _translate_orm_ids(proto_obj, orm.CompletionModelID):
|
613
|
-
case orm.InvalidORMIdentifierError() as err:
|
614
|
-
return err
|
615
|
-
case Ok((obj_id, _)):
|
616
|
-
pass
|
617
|
-
|
618
576
|
orm_obj = orm.CompletionModel(
|
619
|
-
id=obj_id,
|
620
577
|
name=proto_obj.name,
|
621
578
|
description=proto_obj.description,
|
622
579
|
parameters=proto_obj.parameters,
|
623
580
|
secret_api_key=proto_obj.secret_api_key,
|
624
581
|
last_validation_time=proto_obj.last_validation_time.ToDatetime(),
|
625
582
|
)
|
626
|
-
return
|
583
|
+
return add_orm_org_mixin_to_session(
|
584
|
+
orm_obj, proto_obj, orm.CompletionModelID, session
|
585
|
+
)
|
627
586
|
|
628
587
|
|
629
588
|
def source_delete_orms(
|
corvic/model/_resource.py
CHANGED
@@ -15,7 +15,7 @@ from sqlalchemy.orm.interfaces import LoaderOption
|
|
15
15
|
from typing_extensions import Self
|
16
16
|
|
17
17
|
from corvic import orm, system
|
18
|
-
from corvic.model._base_model import
|
18
|
+
from corvic.model._base_model import BelongsToRoomModel
|
19
19
|
from corvic.model._defaults import Defaults
|
20
20
|
from corvic.model._proto_orm_convert import (
|
21
21
|
resource_delete_orms,
|
@@ -32,7 +32,7 @@ RoomID: TypeAlias = orm.RoomID
|
|
32
32
|
PipelineID: TypeAlias = orm.PipelineID
|
33
33
|
|
34
34
|
|
35
|
-
class Resource(
|
35
|
+
class Resource(BelongsToRoomModel[ResourceID, models_pb2.Resource, orm.Resource]):
|
36
36
|
"""Resources represent import data."""
|
37
37
|
|
38
38
|
@classmethod
|
@@ -67,10 +67,6 @@ class Resource(BaseModel[ResourceID, models_pb2.Resource, orm.Resource]):
|
|
67
67
|
def name(self) -> str:
|
68
68
|
return self.proto_self.name
|
69
69
|
|
70
|
-
@property
|
71
|
-
def room_id(self) -> RoomID:
|
72
|
-
return RoomID(self.proto_self.room_id)
|
73
|
-
|
74
70
|
@property
|
75
71
|
def pipeline_id(self) -> PipelineID | None:
|
76
72
|
return PipelineID(self.proto_self.pipeline_id) or None
|
corvic/model/_room.py
CHANGED
@@ -8,7 +8,7 @@ from typing import TypeAlias
|
|
8
8
|
import structlog
|
9
9
|
|
10
10
|
from corvic import orm, system
|
11
|
-
from corvic.model._base_model import
|
11
|
+
from corvic.model._base_model import BelongsToOrgModel
|
12
12
|
from corvic.model._defaults import Defaults
|
13
13
|
from corvic.model._proto_orm_convert import (
|
14
14
|
room_delete_orms,
|
@@ -25,7 +25,7 @@ RoomID: TypeAlias = orm.RoomID
|
|
25
25
|
FeatureViewID: TypeAlias = orm.FeatureViewID
|
26
26
|
|
27
27
|
|
28
|
-
class Room(
|
28
|
+
class Room(BelongsToOrgModel[RoomID, models_pb2.Room, orm.Room]):
|
29
29
|
"""Rooms contain conversations and tables."""
|
30
30
|
|
31
31
|
@classmethod
|
corvic/model/_source.py
CHANGED
@@ -15,7 +15,7 @@ from sqlalchemy.orm.interfaces import LoaderOption
|
|
15
15
|
from typing_extensions import Self
|
16
16
|
|
17
17
|
from corvic import op_graph, orm, system
|
18
|
-
from corvic.model._base_model import
|
18
|
+
from corvic.model._base_model import BelongsToRoomModel
|
19
19
|
from corvic.model._defaults import Defaults
|
20
20
|
from corvic.model._proto_orm_convert import (
|
21
21
|
source_delete_orms,
|
@@ -46,7 +46,7 @@ def foreign_key(
|
|
46
46
|
)
|
47
47
|
|
48
48
|
|
49
|
-
class Source(
|
49
|
+
class Source(BelongsToRoomModel[SourceID, models_pb2.Source, orm.Source]):
|
50
50
|
"""Sources describe how resources should be treated.
|
51
51
|
|
52
52
|
Example:
|
@@ -269,14 +269,18 @@ class Source(BaseModel[SourceID, models_pb2.Source, orm.Source]):
|
|
269
269
|
self.client, op_graph.op.from_proto(self.proto_self.table_op_graph)
|
270
270
|
)
|
271
271
|
|
272
|
+
@functools.cached_property
|
273
|
+
def prop_table(self):
|
274
|
+
if self.proto_self.prop_table_op_graph is None:
|
275
|
+
return None
|
276
|
+
return Table.from_ops(
|
277
|
+
self.client, op_graph.op.from_proto(self.proto_self.prop_table_op_graph)
|
278
|
+
)
|
279
|
+
|
272
280
|
@property
|
273
281
|
def name(self) -> str:
|
274
282
|
return self.proto_self.name
|
275
283
|
|
276
|
-
@property
|
277
|
-
def room_id(self) -> RoomID:
|
278
|
-
return RoomID(self.proto_self.room_id)
|
279
|
-
|
280
284
|
@property
|
281
285
|
def pipeline_id(self) -> PipelineID | None:
|
282
286
|
return PipelineID(self.proto_self.pipeline_id) or None
|
corvic/model/_space.py
CHANGED
@@ -14,7 +14,7 @@ from sqlalchemy import orm as sa_orm
|
|
14
14
|
from typing_extensions import Self
|
15
15
|
|
16
16
|
from corvic import op_graph, orm, system
|
17
|
-
from corvic.model._base_model import
|
17
|
+
from corvic.model._base_model import BelongsToRoomModel
|
18
18
|
from corvic.model._defaults import Defaults
|
19
19
|
from corvic.model._feature_view import FeatureView, FeatureViewEdgeTableMetadata
|
20
20
|
from corvic.model._proto_orm_convert import (
|
@@ -61,7 +61,7 @@ name_to_proto_image_model = {
|
|
61
61
|
}
|
62
62
|
|
63
63
|
|
64
|
-
class Space(
|
64
|
+
class Space(BelongsToRoomModel[SpaceID, models_pb2.Space, orm.Space]):
|
65
65
|
"""Spaces apply embedding methods to FeatureViews.
|
66
66
|
|
67
67
|
Example:
|
@@ -105,10 +105,6 @@ class Space(BaseModel[SpaceID, models_pb2.Space, orm.Space]):
|
|
105
105
|
def name(self):
|
106
106
|
return self.proto_self.name
|
107
107
|
|
108
|
-
@property
|
109
|
-
def room_id(self):
|
110
|
-
return RoomID(self.proto_self.room_id)
|
111
|
-
|
112
108
|
@property
|
113
109
|
def description(self):
|
114
110
|
return self.proto_self.description
|
corvic/orm/__init__.py
CHANGED
@@ -39,6 +39,7 @@ from corvic.orm.keys import (
|
|
39
39
|
ForeignKey,
|
40
40
|
primary_key_foreign_column,
|
41
41
|
primary_key_identity_column,
|
42
|
+
primary_key_uuid_column,
|
42
43
|
)
|
43
44
|
from corvic.orm.mixins import (
|
44
45
|
BelongsToOrgMixin,
|
@@ -66,11 +67,11 @@ from corvic_generated.status.v1 import event_pb2
|
|
66
67
|
# and if sub-orm-model updates are required they are explicit.
|
67
68
|
|
68
69
|
|
69
|
-
class Org(SoftDeleteMixin, OrgBase):
|
70
|
+
class Org(SoftDeleteMixin, OrgBase, kw_only=True):
|
70
71
|
"""An organization it a top level grouping of resources."""
|
71
72
|
|
72
73
|
|
73
|
-
class Room(BelongsToOrgMixin, SoftDeleteMixin, Base):
|
74
|
+
class Room(BelongsToOrgMixin, SoftDeleteMixin, Base, kw_only=True):
|
74
75
|
"""A Room is a logical collection of Documents."""
|
75
76
|
|
76
77
|
__tablename__ = "room"
|
@@ -88,15 +89,17 @@ class BelongsToRoomMixin(sa_orm.MappedAsDataclass):
|
|
88
89
|
room_id: sa_orm.Mapped[RoomID | None] = sa_orm.mapped_column(
|
89
90
|
ForeignKey(Room).make(ondelete="CASCADE"),
|
90
91
|
nullable=True,
|
92
|
+
default=None,
|
91
93
|
)
|
92
94
|
|
93
95
|
|
94
|
-
class DefaultObjects(Base):
|
96
|
+
class DefaultObjects(Base, kw_only=True):
|
95
97
|
"""Holds the identifiers for default objects."""
|
96
98
|
|
97
99
|
__tablename__ = "default_objects"
|
98
|
-
default_org: sa_orm.Mapped[OrgID] = sa_orm.mapped_column(
|
99
|
-
ForeignKey(Org).make(ondelete="CASCADE")
|
100
|
+
default_org: sa_orm.Mapped[OrgID | None] = sa_orm.mapped_column(
|
101
|
+
ForeignKey(Org).make(ondelete="CASCADE"),
|
102
|
+
nullable=False,
|
100
103
|
)
|
101
104
|
default_room: sa_orm.Mapped[RoomID | None] = sa_orm.mapped_column(
|
102
105
|
ForeignKey(Room).make(ondelete="CASCADE"), nullable=True, default=None
|
@@ -104,7 +107,7 @@ class DefaultObjects(Base):
|
|
104
107
|
version: sa_orm.Mapped[int | None] = primary_key_identity_column(type_=INT_PK_TYPE)
|
105
108
|
|
106
109
|
|
107
|
-
class Resource(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
110
|
+
class Resource(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
108
111
|
"""A Resource is a reference to some durably stored file.
|
109
112
|
|
110
113
|
E.g., a document could be a PDF file, an image, or a text transcript of a
|
@@ -129,7 +132,7 @@ class Resource(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
129
132
|
)
|
130
133
|
|
131
134
|
|
132
|
-
class Source(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
135
|
+
class Source(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
133
136
|
"""A source."""
|
134
137
|
|
135
138
|
__tablename__ = "source"
|
@@ -152,7 +155,7 @@ class Source(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
152
155
|
return self.name
|
153
156
|
|
154
157
|
|
155
|
-
class Pipeline(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
158
|
+
class Pipeline(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
156
159
|
"""A resource to source pipeline."""
|
157
160
|
|
158
161
|
__tablename__ = "pipeline"
|
@@ -172,7 +175,7 @@ class Pipeline(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
172
175
|
)
|
173
176
|
|
174
177
|
|
175
|
-
class PipelineInput(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
178
|
+
class PipelineInput(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
176
179
|
"""Pipeline input resources."""
|
177
180
|
|
178
181
|
__tablename__ = "pipeline_input"
|
@@ -190,7 +193,7 @@ class PipelineInput(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
190
193
|
)
|
191
194
|
|
192
195
|
|
193
|
-
class PipelineOutput(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
196
|
+
class PipelineOutput(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
194
197
|
"""Objects for tracking pipeline output sources."""
|
195
198
|
|
196
199
|
__tablename__ = "pipeline_output"
|
@@ -208,7 +211,9 @@ class PipelineOutput(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
208
211
|
)
|
209
212
|
|
210
213
|
|
211
|
-
class FeatureView(
|
214
|
+
class FeatureView(
|
215
|
+
SoftDeleteMixin, BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True
|
216
|
+
):
|
212
217
|
"""A FeatureView is a logical collection of sources used by various spaces."""
|
213
218
|
|
214
219
|
__tablename__ = "feature_view"
|
@@ -233,7 +238,7 @@ class FeatureView(SoftDeleteMixin, BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
233
238
|
)
|
234
239
|
|
235
240
|
|
236
|
-
class FeatureViewSource(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
241
|
+
class FeatureViewSource(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
237
242
|
"""A source inside of a feature view."""
|
238
243
|
|
239
244
|
__tablename__ = "feature_view_source"
|
@@ -257,7 +262,7 @@ class FeatureViewSource(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
257
262
|
)
|
258
263
|
|
259
264
|
|
260
|
-
class Space(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
265
|
+
class Space(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
261
266
|
"""A space is a named evaluation of space parameters."""
|
262
267
|
|
263
268
|
__tablename__ = "space"
|
@@ -322,7 +327,7 @@ class SpaceRun(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
|
322
327
|
)
|
323
328
|
|
324
329
|
|
325
|
-
class Agent(SoftDeleteMixin, BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
330
|
+
class Agent(SoftDeleteMixin, BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
326
331
|
"""An Agent."""
|
327
332
|
|
328
333
|
__tablename__ = "agent"
|
@@ -344,7 +349,7 @@ class Agent(SoftDeleteMixin, BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
344
349
|
)
|
345
350
|
|
346
351
|
|
347
|
-
class AgentSpaceAssociation(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
352
|
+
class AgentSpaceAssociation(BelongsToOrgMixin, BelongsToRoomMixin, Base, kw_only=True):
|
348
353
|
__tablename__ = "agent_space_association"
|
349
354
|
|
350
355
|
space_run_id: sa_orm.Mapped[SpaceRunID | None] = sa_orm.mapped_column(
|
@@ -358,7 +363,7 @@ class AgentSpaceAssociation(BelongsToOrgMixin, BelongsToRoomMixin, Base):
|
|
358
363
|
)
|
359
364
|
|
360
365
|
|
361
|
-
class CompletionModel(SoftDeleteMixin, BelongsToOrgMixin, Base):
|
366
|
+
class CompletionModel(SoftDeleteMixin, BelongsToOrgMixin, Base, kw_only=True):
|
362
367
|
"""A customer's custom completion model definition."""
|
363
368
|
|
364
369
|
__tablename__ = "completion_model"
|
@@ -441,6 +446,7 @@ __all__ = [
|
|
441
446
|
"UserMessageID",
|
442
447
|
"primary_key_foreign_column",
|
443
448
|
"primary_key_identity_column",
|
449
|
+
"primary_key_uuid_column",
|
444
450
|
"ProtoMessageDecorator",
|
445
451
|
"IntIDDecorator",
|
446
452
|
]
|
corvic/orm/base.py
CHANGED
@@ -178,7 +178,7 @@ class OrgBase(Base):
|
|
178
178
|
# overriding table_args is the recommending way of defining these base model types
|
179
179
|
__table_args__: ClassVar[Any] = ({"extend_existing": True},)
|
180
180
|
|
181
|
-
id: sa_orm.Mapped[OrgID] = primary_key_uuid_column()
|
181
|
+
id: sa_orm.Mapped[OrgID | None] = primary_key_uuid_column()
|
182
182
|
|
183
183
|
@property
|
184
184
|
def name(self) -> str:
|
@@ -1,9 +1,9 @@
|
|
1
|
-
corvic_engine-0.3.
|
2
|
-
corvic_engine-0.3.
|
3
|
-
corvic_engine-0.3.
|
1
|
+
corvic_engine-0.3.0rc56.dist-info/METADATA,sha256=kGcTUywSpPxHTYF5tu-LPySqBXMZgKxvNVgkOssAn0A,1876
|
2
|
+
corvic_engine-0.3.0rc56.dist-info/WHEEL,sha256=hKPP3BCTWtTwj6SFaSI--T5aOGqh_llYfbZ_BsqivwA,94
|
3
|
+
corvic_engine-0.3.0rc56.dist-info/licenses/LICENSE,sha256=DSS1OD0oIgssKOmAzkMRBv5jvvVuZQbrIv8lpl9DXY8,1035
|
4
4
|
corvic/context/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
corvic/context/__init__.py,sha256=zBnPiP-tStGSVMG_0-G_0ay6-yIX2aerW_oYRzAex74,1702
|
6
|
-
corvic/embed/node2vec.py,sha256=
|
6
|
+
corvic/embed/node2vec.py,sha256=XIJjFDdT-JnmZ43lgP-K-dLgnR17L_uaJqBPAYlsPsk,11148
|
7
7
|
corvic/embed/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
corvic/embed/__init__.py,sha256=cZZSrRXmezJuTafcQgrB1rbitqXZTVY1B5ryRzAlvgs,144
|
9
9
|
corvic/embedding_metric/embeddings.py,sha256=5jvSY0cg5P-Wg_KN7DsrcPo5AfJ_1-XKdErx_dNN5B8,14082
|
@@ -13,20 +13,20 @@ corvic/engine/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
corvic/engine/_native.pyi,sha256=KYMPtvXqHZ-jMgZohLf4se3rr-rBpCihmjANcr6s8ag,1390
|
14
14
|
corvic/engine/__init__.py,sha256=XL4Vg7rNcBi29ccVelpeFizR9oJtGYXDn84W9zok9d4,975
|
15
15
|
corvic/model/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
corvic/model/_agent.py,sha256=
|
17
|
-
corvic/model/_base_model.py,sha256=
|
18
|
-
corvic/model/_completion_model.py,sha256=
|
16
|
+
corvic/model/_agent.py,sha256=8tle_IGhy0LTPd1nNXDfBypnzF3CI7S9fhZbDsVxnZc,4737
|
17
|
+
corvic/model/_base_model.py,sha256=WYBBPa1TeU9wchh-UBFlMwuQMDY5cKHBlDznhLbnSHA,8989
|
18
|
+
corvic/model/_completion_model.py,sha256=f_ud3xW1iFXSijGMo0WYDmLfmM6mQayAcjTW37AM3q8,7337
|
19
19
|
corvic/model/_defaults.py,sha256=yoKPPSmYJCE5YAD5jLTEmT4XNf_zXoggNK-uyG8MfVs,1524
|
20
20
|
corvic/model/_errors.py,sha256=Ctlq04SDwHzJPvLaL1rzqzwVqf2b50EILfW3cH4vnh8,261
|
21
21
|
corvic/model/_feature_type.py,sha256=Y-_-wa9fv7XaCAkxfjjoCLxxK2Ftfba-PMefD7bNXzs,917
|
22
|
-
corvic/model/_feature_view.py,sha256=
|
23
|
-
corvic/model/_pipeline.py,sha256=
|
24
|
-
corvic/model/_proto_orm_convert.py,sha256=
|
25
|
-
corvic/model/_resource.py,sha256=
|
26
|
-
corvic/model/_room.py,sha256=
|
27
|
-
corvic/model/_source.py,sha256=
|
28
|
-
corvic/model/_space.py,sha256=
|
29
|
-
corvic/model/__init__.py,sha256=
|
22
|
+
corvic/model/_feature_view.py,sha256=gdcXzsMuxpJ7vwbIGYgZlLYNxi2zvdZXvFsb36x6lKg,49694
|
23
|
+
corvic/model/_pipeline.py,sha256=c16ap3yHQXqBmjG_2bMzz8hBYJCr14V2WxwlAYOw5Zw,16279
|
24
|
+
corvic/model/_proto_orm_convert.py,sha256=jmzmaaUkSxeHB5OMef92AyGw7sorJ6pP4ylbeKXoHvA,26120
|
25
|
+
corvic/model/_resource.py,sha256=w5m6mmD8KrHJ8efPTfRV0JKaCmkDRaxlGeuRMmVbw10,7773
|
26
|
+
corvic/model/_room.py,sha256=36mXngZ38L4mr6_LgUm-QgsUUaoGMiYQRfvXLV_jd-4,2914
|
27
|
+
corvic/model/_source.py,sha256=A1Jk4r5mB0f-Y3L8esaQFCUAu7CCTlwAm7f4qSnvjsM,9603
|
28
|
+
corvic/model/_space.py,sha256=13ggLTCQMNTYYpP5PldMqtJiKp3sWOVRhQcktmoHefA,35590
|
29
|
+
corvic/model/__init__.py,sha256=Lb-yC04t17Hr2TlnGfn5Ewzd2h1nH4hb9tKdMNAak9s,3075
|
30
30
|
corvic/op_graph/aggregation.py,sha256=8X6vqXD7dLHrhYJU0BqmhUsWGbzD1zSP5Db5VHdIru4,6187
|
31
31
|
corvic/op_graph/encoders.py,sha256=93wYoBCn_us5lRCkqvjaP0LTg3LBB3yEfhzICv06bB0,10460
|
32
32
|
corvic/op_graph/errors.py,sha256=I4NE5053d0deGm5xx5EmyP4f98qx42xnIsW1IA-2hy4,163
|
@@ -40,7 +40,7 @@ corvic/op_graph/sample_strategy.py,sha256=DrbtJ3ORkIRfyIE_FdlOh_UMnCW_K9jL1LeonV
|
|
40
40
|
corvic/op_graph/_schema.py,sha256=STbxY5PIqIA6xkSDeK8k72Nutsxq5jGe7e_aT35aznI,5733
|
41
41
|
corvic/op_graph/_transformations.py,sha256=L9Au_GcciPynww4ZXojMtNdPJ36Qboc9gn0bVzXLifU,9445
|
42
42
|
corvic/op_graph/__init__.py,sha256=1DMrQfuuS3FkLa9DXYDjSDLurdxxpG5H1jB2ctaa9xo,1444
|
43
|
-
corvic/orm/base.py,sha256=
|
43
|
+
corvic/orm/base.py,sha256=95nkqycCZ1FaWAhTsa7zbZ0YuwNFkMUW7Wk8yhtYau8,8824
|
44
44
|
corvic/orm/errors.py,sha256=uFhFXpVG6pby1lndJZHGHxv3Y0Fbt0RiaZ-CqDfuY1o,545
|
45
45
|
corvic/orm/func/utc_func.py,sha256=-FC6w9wBWXejMv1AICT2Gg7tdkSo7gqL2dFT-YKPGQ4,4518
|
46
46
|
corvic/orm/func/uuid_func.py,sha256=oXPjDGAl3mvlNtvcvBrLmRRHPJgtKffShIPbHm-EswA,1152
|
@@ -50,7 +50,7 @@ corvic/orm/keys.py,sha256=Ag6Xbpvxev-VByT1KJ8ChUn9vKVEzkkMXxrjvtADCtY,2182
|
|
50
50
|
corvic/orm/mixins.py,sha256=HfmzJ7LblHtddbbkDmv7nNWURL87Bnj8NeOnNbfmSN4,17794
|
51
51
|
corvic/orm/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
52
|
corvic/orm/_proto_columns.py,sha256=tcOu92UjFJFYZLasS6sWJQBDRK26yrnmpTii_LDY4iw,913
|
53
|
-
corvic/orm/__init__.py,sha256=
|
53
|
+
corvic/orm/__init__.py,sha256=Yzfn_GyCGHzf-wt-CmtamW15PyuZ7tHI7IqQw-3aPmQ,14827
|
54
54
|
corvic/pa_scalar/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
55
55
|
corvic/pa_scalar/_const.py,sha256=1nk6w3Y7crd3J5jSCq7DRVa1lcGk4H1RUr1l4NjnlzE,868
|
56
56
|
corvic/pa_scalar/_from_value.py,sha256=fS3TNPcPI3jAKGmcUIhn8rdqdQEAwgTLEneVxFUeK6M,27531
|
@@ -156,7 +156,7 @@ corvic_generated/ingest/v2/table_pb2.py,sha256=aTJHaliZm5DMtp7gslNxyn9uDagz-2-_e
|
|
156
156
|
corvic_generated/ingest/v2/table_pb2_grpc.py,sha256=tVs7wMWyAfvHcCQEiUOHLwaptKxgMFG6E7Ki9vNmmvQ,8151
|
157
157
|
corvic_generated/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
158
|
corvic_generated/model/v1alpha/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
159
|
-
corvic_generated/model/v1alpha/models_pb2.py,sha256=
|
159
|
+
corvic_generated/model/v1alpha/models_pb2.py,sha256=Jvw4rYuekrbjI7sx0QPcLnTDL5aXI3l0drMiM7dy4ac,8703
|
160
160
|
corvic_generated/model/v1alpha/models_pb2_grpc.py,sha256=_bXoS025FcWrXR1E_3Mh4GHB1RMvgz8lIpit-Awnf-s,163
|
161
161
|
corvic_generated/orm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
162
162
|
corvic_generated/orm/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -220,7 +220,7 @@ corvic_generated/ingest/v2/source_pb2.pyi,sha256=k7FdbgurQLk0JA1WiTUerznzxLv8b50
|
|
220
220
|
corvic_generated/ingest/v2/source_pb2_grpc.pyi,sha256=VG5gpql2SREHgqMC_ycT-QJBVpPeSYKOYS2COgGrZa4,6195
|
221
221
|
corvic_generated/ingest/v2/table_pb2.pyi,sha256=p22F8kv0HfM-9OzGP88bLofxmUtxfLR5eVN0HOxXiEo,4382
|
222
222
|
corvic_generated/ingest/v2/table_pb2_grpc.pyi,sha256=AEXYNtrU4xyENumcCrkD2FmFV7T1UVidxxeZ5pyE4Qc,4554
|
223
|
-
corvic_generated/model/v1alpha/models_pb2.pyi,sha256=
|
223
|
+
corvic_generated/model/v1alpha/models_pb2.pyi,sha256=K8clNf_M36tu0DEOb4Lo4l_fh4DA2IOD3c1uTI07Wgo,11513
|
224
224
|
corvic_generated/model/v1alpha/models_pb2_grpc.pyi,sha256=H9-ADaiKR9iyVZvmnXutZqWwRRCDxjUIktkfJrJFIHg,417
|
225
225
|
corvic_generated/orm/v1/agent_pb2.pyi,sha256=AxcZC0AJqiOyu_5quSMR-E0MjVhDY7b5ym4uZa7WFug,4670
|
226
226
|
corvic_generated/orm/v1/agent_pb2_grpc.pyi,sha256=H9-ADaiKR9iyVZvmnXutZqWwRRCDxjUIktkfJrJFIHg,417
|
@@ -244,5 +244,5 @@ corvic_generated/status/v1/event_pb2.pyi,sha256=eU-ibrYpvEAJSIDlSa62-bC96AQU1ykF
|
|
244
244
|
corvic_generated/status/v1/event_pb2_grpc.pyi,sha256=H9-ADaiKR9iyVZvmnXutZqWwRRCDxjUIktkfJrJFIHg,417
|
245
245
|
corvic_generated/status/v1/service_pb2.pyi,sha256=iXLR2FOKQJpBgvBzpD2kVwcYOCksP2aRwK4JYaI9CBw,558
|
246
246
|
corvic_generated/status/v1/service_pb2_grpc.pyi,sha256=OoAnaZ64FD0UTzPoRhYvQU8ecoilhHj3ySjSfHbVDaU,1501
|
247
|
-
corvic/engine/_native.pyd,sha256=
|
248
|
-
corvic_engine-0.3.
|
247
|
+
corvic/engine/_native.pyd,sha256=XkU3bVVXAk3up15IfaE0ih1d0_Lo8jRl_mJp1ZwbBls,438272
|
248
|
+
corvic_engine-0.3.0rc56.dist-info/RECORD,,
|
@@ -22,7 +22,7 @@ from corvic_generated.status.v1 import event_pb2 as corvic_dot_status_dot_v1_dot
|
|
22
22
|
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
23
23
|
|
24
24
|
|
25
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!corvic/model/v1alpha/models.proto\x12\x14\x63orvic.model.v1alpha\x1a\x19\x63orvic/orm/v1/agent.proto\x1a$corvic/orm/v1/completion_model.proto\x1a corvic/orm/v1/feature_view.proto\x1a\x1c\x63orvic/orm/v1/pipeline.proto\x1a\x19\x63orvic/orm/v1/space.proto\x1a\x19\x63orvic/orm/v1/table.proto\x1a\x1c\x63orvic/status/v1/event.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x01\n\x04Room\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x15\n\x06org_id\x18\x03 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_at\"\xd8\x03\n\x08Resource\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scription\x12\x1b\n\tmime_type\x18\x04 \x01(\tR\x08mimeType\x12\x10\n\x03url\x18\x05 \x01(\tR\x03url\x12\x12\n\x04size\x18\x06 \x01(\x04R\x04size\x12\x10\n\x03md5\x18\x07 \x01(\tR\x03md5\x12#\n\roriginal_path\x18\x08 \x01(\tR\x0coriginalPath\x12\x17\n\x07room_id\x18\t \x01(\tR\x06roomId\x12\x15\n\x06org_id\x18\x0b \x01(\tR\x05orgId\x12\x1f\n\x0bpipeline_id\x18\r \x01(\tR\npipelineId\x12.\n\x13pipeline_input_name\x18\x0f \x01(\tR\x11pipelineInputName\x12<\n\rrecent_events\x18\x0e \x03(\x0b\x32\x17.corvic.status.v1.EventR\x0crecentEvents\x12>\n\ncreated_at\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_at\"\
|
25
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!corvic/model/v1alpha/models.proto\x12\x14\x63orvic.model.v1alpha\x1a\x19\x63orvic/orm/v1/agent.proto\x1a$corvic/orm/v1/completion_model.proto\x1a corvic/orm/v1/feature_view.proto\x1a\x1c\x63orvic/orm/v1/pipeline.proto\x1a\x19\x63orvic/orm/v1/space.proto\x1a\x19\x63orvic/orm/v1/table.proto\x1a\x1c\x63orvic/status/v1/event.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x01\n\x04Room\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x15\n\x06org_id\x18\x03 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_at\"\xd8\x03\n\x08Resource\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scription\x12\x1b\n\tmime_type\x18\x04 \x01(\tR\x08mimeType\x12\x10\n\x03url\x18\x05 \x01(\tR\x03url\x12\x12\n\x04size\x18\x06 \x01(\x04R\x04size\x12\x10\n\x03md5\x18\x07 \x01(\tR\x03md5\x12#\n\roriginal_path\x18\x08 \x01(\tR\x0coriginalPath\x12\x17\n\x07room_id\x18\t \x01(\tR\x06roomId\x12\x15\n\x06org_id\x18\x0b \x01(\tR\x05orgId\x12\x1f\n\x0bpipeline_id\x18\r \x01(\tR\npipelineId\x12.\n\x13pipeline_input_name\x18\x0f \x01(\tR\x11pipelineInputName\x12<\n\rrecent_events\x18\x0e \x03(\x0b\x32\x17.corvic.status.v1.EventR\x0crecentEvents\x12>\n\ncreated_at\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_at\"\xfc\x02\n\x06Source\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x43\n\x0etable_op_graph\x18\x03 \x01(\x0b\x32\x1d.corvic.orm.v1.TableComputeOpR\x0ctableOpGraph\x12\x17\n\x07room_id\x18\x04 \x01(\tR\x06roomId\x12\x15\n\x06org_id\x18\x06 \x01(\tR\x05orgId\x12\x1f\n\x0bpipeline_id\x18\x08 \x01(\tR\npipelineId\x12>\n\ncreated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x12Q\n\x13prop_table_op_graph\x18\t \x01(\x0b\x32\x1d.corvic.orm.v1.TableComputeOpH\x01R\x10propTableOpGraph\x88\x01\x01\x42\r\n\x0b_created_atB\x16\n\x14_prop_table_op_graph\"\xe9\x03\n\x08Pipeline\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\t \x01(\tR\x0b\x64\x65scription\x12\x17\n\x07room_id\x18\x03 \x01(\tR\x06roomId\x12X\n\x0esource_outputs\x18\x05 \x03(\x0b\x32\x31.corvic.model.v1alpha.Pipeline.SourceOutputsEntryR\rsourceOutputs\x12^\n\x17pipeline_transformation\x18\x06 \x01(\x0b\x32%.corvic.orm.v1.PipelineTransformationR\x16pipelineTransformation\x12\x15\n\x06org_id\x18\x07 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x1a^\n\x12SourceOutputsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32\x1c.corvic.model.v1alpha.SourceR\x05value:\x02\x38\x01\x42\r\n\x0b_created_at\"\xca\x02\n\x11\x46\x65\x61tureViewSource\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x34\n\x06source\x18\x02 \x01(\x0b\x32\x1c.corvic.model.v1alpha.SourceR\x06source\x12\x43\n\x0etable_op_graph\x18\x03 \x01(\x0b\x32\x1d.corvic.orm.v1.TableComputeOpR\x0ctableOpGraph\x12+\n\x11\x64rop_disconnected\x18\x04 \x01(\x08R\x10\x64ropDisconnected\x12\x15\n\x06org_id\x18\x05 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x12\x17\n\x07room_id\x18\x07 \x01(\tR\x06roomIdB\r\n\x0b_created_at\"\x9c\x03\n\x0b\x46\x65\x61tureView\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scription\x12\x17\n\x07room_id\x18\x04 \x01(\tR\x06roomId\x12P\n\x13\x66\x65\x61ture_view_output\x18\x05 \x01(\x0b\x32 .corvic.orm.v1.FeatureViewOutputR\x11\x66\x65\x61tureViewOutput\x12Y\n\x14\x66\x65\x61ture_view_sources\x18\x06 \x03(\x0b\x32\'.corvic.model.v1alpha.FeatureViewSourceR\x12\x66\x65\x61tureViewSources\x12\x1b\n\tspace_ids\x18\x07 \x03(\tR\x08spaceIds\x12\x15\n\x06org_id\x18\x08 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_at\"\xfa\x02\n\x05Space\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scription\x12\x17\n\x07room_id\x18\x04 \x01(\tR\x06roomId\x12I\n\x10space_parameters\x18\x05 \x01(\x0b\x32\x1e.corvic.orm.v1.SpaceParametersR\x0fspaceParameters\x12\x44\n\x0c\x66\x65\x61ture_view\x18\x06 \x01(\x0b\x32!.corvic.model.v1alpha.FeatureViewR\x0b\x66\x65\x61tureView\x12\x1b\n\tauto_sync\x18\t \x01(\x08R\x08\x61utoSync\x12\x15\n\x06org_id\x18\x07 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_at\"\x85\x02\n\x05\x41gent\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12\x17\n\x07room_id\x18\x03 \x01(\tR\x06roomId\x12I\n\x10\x61gent_parameters\x18\x04 \x01(\x0b\x32\x1e.corvic.orm.v1.AgentParametersR\x0f\x61gentParameters\x12\x15\n\x06org_id\x18\x05 \x01(\tR\x05orgId\x12>\n\ncreated_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x42\r\n\x0b_created_atJ\x04\x08\x06\x10\x07R\x08messages\"\x99\x03\n\x0f\x43ompletionModel\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scription\x12\x15\n\x06org_id\x18\x04 \x01(\tR\x05orgId\x12H\n\nparameters\x18\x05 \x01(\x0b\x32(.corvic.orm.v1.CompletionModelParametersR\nparameters\x12$\n\x0esecret_api_key\x18\x06 \x01(\tR\x0csecretApiKey\x12>\n\ncreated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\tcreatedAt\x88\x01\x01\x12Q\n\x14last_validation_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x12lastValidationTime\x88\x01\x01\x42\r\n\x0b_created_atB\x17\n\x15_last_validation_timeb\x06proto3')
|
26
26
|
|
27
27
|
_globals = globals()
|
28
28
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -36,19 +36,19 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
36
36
|
_globals['_RESOURCE']._serialized_start=453
|
37
37
|
_globals['_RESOURCE']._serialized_end=925
|
38
38
|
_globals['_SOURCE']._serialized_start=928
|
39
|
-
_globals['_SOURCE']._serialized_end=
|
40
|
-
_globals['_PIPELINE']._serialized_start=
|
41
|
-
_globals['_PIPELINE']._serialized_end=
|
42
|
-
_globals['_PIPELINE_SOURCEOUTPUTSENTRY']._serialized_start=
|
43
|
-
_globals['_PIPELINE_SOURCEOUTPUTSENTRY']._serialized_end=
|
44
|
-
_globals['_FEATUREVIEWSOURCE']._serialized_start=
|
45
|
-
_globals['_FEATUREVIEWSOURCE']._serialized_end=
|
46
|
-
_globals['_FEATUREVIEW']._serialized_start=
|
47
|
-
_globals['_FEATUREVIEW']._serialized_end=
|
48
|
-
_globals['_SPACE']._serialized_start=
|
49
|
-
_globals['_SPACE']._serialized_end=
|
50
|
-
_globals['_AGENT']._serialized_start=
|
51
|
-
_globals['_AGENT']._serialized_end=
|
52
|
-
_globals['_COMPLETIONMODEL']._serialized_start=
|
53
|
-
_globals['_COMPLETIONMODEL']._serialized_end=
|
39
|
+
_globals['_SOURCE']._serialized_end=1308
|
40
|
+
_globals['_PIPELINE']._serialized_start=1311
|
41
|
+
_globals['_PIPELINE']._serialized_end=1800
|
42
|
+
_globals['_PIPELINE_SOURCEOUTPUTSENTRY']._serialized_start=1691
|
43
|
+
_globals['_PIPELINE_SOURCEOUTPUTSENTRY']._serialized_end=1785
|
44
|
+
_globals['_FEATUREVIEWSOURCE']._serialized_start=1803
|
45
|
+
_globals['_FEATUREVIEWSOURCE']._serialized_end=2133
|
46
|
+
_globals['_FEATUREVIEW']._serialized_start=2136
|
47
|
+
_globals['_FEATUREVIEW']._serialized_end=2548
|
48
|
+
_globals['_SPACE']._serialized_start=2551
|
49
|
+
_globals['_SPACE']._serialized_end=2929
|
50
|
+
_globals['_AGENT']._serialized_start=2932
|
51
|
+
_globals['_AGENT']._serialized_end=3193
|
52
|
+
_globals['_COMPLETIONMODEL']._serialized_start=3196
|
53
|
+
_globals['_COMPLETIONMODEL']._serialized_end=3605
|
54
54
|
# @@protoc_insertion_point(module_scope)
|
@@ -58,7 +58,7 @@ class Resource(_message.Message):
|
|
58
58
|
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., mime_type: _Optional[str] = ..., url: _Optional[str] = ..., size: _Optional[int] = ..., md5: _Optional[str] = ..., original_path: _Optional[str] = ..., room_id: _Optional[str] = ..., org_id: _Optional[str] = ..., pipeline_id: _Optional[str] = ..., pipeline_input_name: _Optional[str] = ..., recent_events: _Optional[_Iterable[_Union[_event_pb2.Event, _Mapping]]] = ..., created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
|
59
59
|
|
60
60
|
class Source(_message.Message):
|
61
|
-
__slots__ = ("id", "name", "table_op_graph", "room_id", "org_id", "pipeline_id", "created_at")
|
61
|
+
__slots__ = ("id", "name", "table_op_graph", "room_id", "org_id", "pipeline_id", "created_at", "prop_table_op_graph")
|
62
62
|
ID_FIELD_NUMBER: _ClassVar[int]
|
63
63
|
NAME_FIELD_NUMBER: _ClassVar[int]
|
64
64
|
TABLE_OP_GRAPH_FIELD_NUMBER: _ClassVar[int]
|
@@ -66,6 +66,7 @@ class Source(_message.Message):
|
|
66
66
|
ORG_ID_FIELD_NUMBER: _ClassVar[int]
|
67
67
|
PIPELINE_ID_FIELD_NUMBER: _ClassVar[int]
|
68
68
|
CREATED_AT_FIELD_NUMBER: _ClassVar[int]
|
69
|
+
PROP_TABLE_OP_GRAPH_FIELD_NUMBER: _ClassVar[int]
|
69
70
|
id: str
|
70
71
|
name: str
|
71
72
|
table_op_graph: _table_pb2.TableComputeOp
|
@@ -73,7 +74,8 @@ class Source(_message.Message):
|
|
73
74
|
org_id: str
|
74
75
|
pipeline_id: str
|
75
76
|
created_at: _timestamp_pb2.Timestamp
|
76
|
-
|
77
|
+
prop_table_op_graph: _table_pb2.TableComputeOp
|
78
|
+
def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., table_op_graph: _Optional[_Union[_table_pb2.TableComputeOp, _Mapping]] = ..., room_id: _Optional[str] = ..., org_id: _Optional[str] = ..., pipeline_id: _Optional[str] = ..., created_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., prop_table_op_graph: _Optional[_Union[_table_pb2.TableComputeOp, _Mapping]] = ...) -> None: ...
|
77
79
|
|
78
80
|
class Pipeline(_message.Message):
|
79
81
|
__slots__ = ("id", "name", "description", "room_id", "source_outputs", "pipeline_transformation", "org_id", "created_at")
|
File without changes
|