prism-models 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.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.

Potentially problematic release.


This version of prism-models might be problematic. Click here for more details.

prism_models/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  __version__ = "0.1.0"
4
4
 
5
5
 
6
- from prism_models.agent_profile import Agent, AgentProfile, AgentProfileStatus, Profile, ProfileCollectionAccess
6
+ from prism_models.agent_profile import Agent, AgentCollectionAccess, AgentProfile, AgentProfileStatus, Profile, ProfileCollectionAccess
7
7
  from prism_models.base import POSTGRES_NAMING_CONVENTION, Base, BaseModel, TimestampMixin
8
8
  from prism_models.chat import Contact, Conversation, ConversationMessage, ConversationMessageMetadata
9
9
  from prism_models.content import Chunk, ChunkConfig, Collection, CollectionDocument, Document, IntegrationConfig, QAPair, Source, Vector
@@ -13,6 +13,7 @@ from prism_models.qdrant import QdrantVectorPayload, DestinationVectorPayload, P
13
13
  __all__ = [
14
14
  "POSTGRES_NAMING_CONVENTION",
15
15
  "Agent",
16
+ "AgentCollectionAccess",
16
17
  "AgentProfile",
17
18
  "AgentProfileStatus",
18
19
  "Augmentation",
@@ -99,3 +99,30 @@ class ProfileCollectionAccess(BaseModel):
99
99
  collection: Mapped["Collection"] = relationship()
100
100
 
101
101
  __table_args__ = (UniqueConstraint("profile_id", "collection_id", name="uq_profile_collection"),)
102
+
103
+
104
+ class AgentCollectionAccess(BaseModel):
105
+ """AgentCollectionAccess model for storing agent collection information."""
106
+
107
+ agent_id: Mapped[int] = mapped_column(
108
+ Integer,
109
+ ForeignKey("agent.id", ondelete="CASCADE"),
110
+ nullable=False,
111
+ index=True,
112
+ )
113
+ collection_id: Mapped[int] = mapped_column(
114
+ Integer,
115
+ ForeignKey("collection.id", ondelete="CASCADE"),
116
+ nullable=False,
117
+ index=True,
118
+ )
119
+ access_granted_at: Mapped[datetime] = mapped_column(
120
+ TIMESTAMP(timezone=True),
121
+ server_default=func.now(),
122
+ nullable=True,
123
+ )
124
+
125
+ agent: Mapped["Agent"] = relationship()
126
+ collection: Mapped["Collection"] = relationship()
127
+
128
+ __table_args__ = (UniqueConstraint("agent_id", "collection_id", name="uq_agent_collection"),)
@@ -0,0 +1,50 @@
1
+ """added AgentCollectionAccess table
2
+
3
+ Revision ID: ff3be2c4311f
4
+ Revises: 919d07a93f83
5
+ Create Date: 2025-10-27 13:31:19.882851
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = 'ff3be2c4311f'
16
+ down_revision: Union[str, Sequence[str], None] = '919d07a93f83'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('agent_collection_access',
25
+ sa.Column('agent_id', sa.Integer(), nullable=False),
26
+ sa.Column('collection_id', sa.Integer(), nullable=False),
27
+ sa.Column('access_granted_at', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=True),
28
+ sa.Column('id', sa.Integer(), nullable=False),
29
+ sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
30
+ sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
31
+ sa.Column('deleted_at', sa.DateTime(timezone=True), nullable=True),
32
+ sa.ForeignKeyConstraint(['agent_id'], ['agent.id'], name=op.f('agent_collection_access_agent_id_fkey'), ondelete='CASCADE'),
33
+ sa.ForeignKeyConstraint(['collection_id'], ['collection.id'], name=op.f('agent_collection_access_collection_id_fkey'), ondelete='CASCADE'),
34
+ sa.PrimaryKeyConstraint('id', name=op.f('agent_collection_access_pkey')),
35
+ sa.UniqueConstraint('agent_id', 'collection_id', name='uq_agent_collection')
36
+ )
37
+ op.create_index(op.f('agent_collection_access_agent_id_idx'), 'agent_collection_access', ['agent_id'], unique=False)
38
+ op.create_index(op.f('agent_collection_access_collection_id_idx'), 'agent_collection_access', ['collection_id'], unique=False)
39
+ op.create_index(op.f('agent_collection_access_id_idx'), 'agent_collection_access', ['id'], unique=False)
40
+ # ### end Alembic commands ###
41
+
42
+
43
+ def downgrade() -> None:
44
+ """Downgrade schema."""
45
+ # ### commands auto generated by Alembic - please adjust! ###
46
+ op.drop_index(op.f('agent_collection_access_id_idx'), table_name='agent_collection_access')
47
+ op.drop_index(op.f('agent_collection_access_collection_id_idx'), table_name='agent_collection_access')
48
+ op.drop_index(op.f('agent_collection_access_agent_id_idx'), table_name='agent_collection_access')
49
+ op.drop_table('agent_collection_access')
50
+ # ### end Alembic commands ###
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prism-models
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: sqlalchemy[asyncio]>=2.0.0
6
6
  Requires-Dist: alembic>=1.16.0
@@ -1,5 +1,5 @@
1
- prism_models/__init__.py,sha256=QNgzPjt8lzBV7j0e70zUoJurYiLMSsVcWEHnQz4hO-c,1396
2
- prism_models/agent_profile.py,sha256=SlZyd59q5DhdMmbcW9SAQCy44sgF_I7arz-M8_71an4,3789
1
+ prism_models/__init__.py,sha256=IMDlzCmXkCSiY2Ag5BUS4KS2muPJrinwgSquMcmLCG0,1448
2
+ prism_models/agent_profile.py,sha256=pyWv0yZlt32iMzSht8z90F-RUZlLqVAFdjJKJlOuMEk,4602
3
3
  prism_models/base.py,sha256=Ka8zNToTiTG0jNgzqqj2goGmPXt8zxuuSMYvotnb8wY,2281
4
4
  prism_models/chat.py,sha256=zncfBav1YdB8AdC-9McY9fsKZ3-2plLLhy_NMd8JoyA,11784
5
5
  prism_models/config.py,sha256=gy_6HknnG17Clv8X_EBhaXEBFBLGR1PLjvN5-SFTo5E,962
@@ -33,7 +33,8 @@ prism_models/migration/versions/2025_10_08_1304_c91eb8e38cc7_added_destination_r
33
33
  prism_models/migration/versions/2025_10_09_1308_796b720ea35f_added_qa_id_to_vovetor.py,sha256=tW58ejf2_NcaK038Igf3zicZQymeVt4I4uzZULNtHV0,1467
34
34
  prism_models/migration/versions/2025_10_16_1611_663c66268631_added_sharepoint_drive_item_id_as_an_.py,sha256=IaG9NDyTGENq65GyrhGoScBb-U82x5V7NBKpG9PYy5Q,968
35
35
  prism_models/migration/versions/2025_10_23_1228_919d07a93f83_added_sharepoint_directory_in_source.py,sha256=dk7jTusquTc9rDlJtduGIi-YiqNpGfex63WQkVLMeuk,923
36
- prism_models-0.1.2.dist-info/METADATA,sha256=RgJqAieqZdMOhxt58L1araYgEVAN49o8xodj5OeTftA,283
37
- prism_models-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- prism_models-0.1.2.dist-info/top_level.txt,sha256=UNzqwpLgFYU0EoyB9LiB1jTtc89A1sQ24fSEyNVvgJI,13
39
- prism_models-0.1.2.dist-info/RECORD,,
36
+ prism_models/migration/versions/2025_10_27_1331_ff3be2c4311f_added_agentcollectionaccess_table.py,sha256=wFa9DJSQjhHSrl2JUA2vgPz8qLcL01xepu_MDHhSjGo,2528
37
+ prism_models-0.1.3.dist-info/METADATA,sha256=na_ong7CxPkGX_glT5-dz1onJgvVffUCAA8h8oLJlB0,283
38
+ prism_models-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
+ prism_models-0.1.3.dist-info/top_level.txt,sha256=UNzqwpLgFYU0EoyB9LiB1jTtc89A1sQ24fSEyNVvgJI,13
40
+ prism_models-0.1.3.dist-info/RECORD,,