prism-models 0.1.2__tar.gz → 0.1.4__tar.gz
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-0.1.2 → prism_models-0.1.4}/PKG-INFO +1 -1
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/__init__.py +2 -1
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/agent_profile.py +27 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/chat.py +6 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/config.py +1 -1
- prism_models-0.1.4/prism_models/migration/versions/2025_10_27_1331_ff3be2c4311f_added_agentcollectionaccess_table.py +50 -0
- prism_models-0.1.4/prism_models/migration/versions/2025_10_28_1333_b789e61df26a_ad_enum_and_field_added.py +46 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models.egg-info/PKG-INFO +1 -1
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models.egg-info/SOURCES.txt +3 -1
- {prism_models-0.1.2 → prism_models-0.1.4}/pyproject.toml +1 -1
- {prism_models-0.1.2 → prism_models-0.1.4}/README.md +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/base.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/content.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/feedback.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/README +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/__init__.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/env.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/script.py.mako +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_11_1516_161f8829d93f_initial_schema.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_11_1558_5e011849ea76_changes_for_feedback.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_14_2243_059af231c2b2_profile_entities.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_15_1646_3219fec0bb10_agent_changes.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_16_1627_f2013b08daac_rename_metadata_to_additional_data.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_17_1147_327febbf555f_display_name_added.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_18_1106_b0bcb7ca1dc9_add_support_for_profile_on_create_convo.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_18_1511_bbc1955191e6_preview_mode.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_26_1115_6eb70e848451_added_publish_status_to_document.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_26_1240_f8b0ea2e743c_drop_unique_title_version_on_document.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_26_1505_07dc8c2589e0_added_chunk_id_and_vector_embeddings_to_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_09_29_1220_46ba2693b883_add_markdown_markdown_file_path_s3_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_02_1520_bf1472a9b021_removed_doc_id_from_config_table_and_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_02_1525_6c0e63e0fef8_removed_doc_id_from_config_table_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_02_1608_1b3eb48f5017_config_id_on_delete_will_be_set_to_null.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_03_1109_ac85b606d8a4_added_docling_hybrid_to_chunkstrategy.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_03_1204_7d1cb343a63f_added_s3_bucket_and_s3_dir_in_source_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_03_1452_f9c750ec2a0b_1_to_1_relationship_between_collection_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_07_1722_5cfa0c462948_added_travel_advisory_enum.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_08_1304_c91eb8e38cc7_added_destination_report_and_event_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_09_1308_796b720ea35f_added_qa_id_to_vovetor.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_16_1611_663c66268631_added_sharepoint_drive_item_id_as_an_.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/migration/versions/2025_10_23_1228_919d07a93f83_added_sharepoint_directory_in_source.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models/qdrant.py +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models.egg-info/dependency_links.txt +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models.egg-info/requires.txt +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/prism_models.egg-info/top_level.txt +0 -0
- {prism_models-0.1.2 → prism_models-0.1.4}/setup.cfg +0 -0
|
@@ -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"),)
|
|
@@ -24,6 +24,7 @@ class ContactSource(PyEnum):
|
|
|
24
24
|
GRID = "GRID"
|
|
25
25
|
CRM = "CRM"
|
|
26
26
|
EXTERNAL = "EXTERNAL"
|
|
27
|
+
MICROSOFT_AD = "MICROSOFT_AD"
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class ConversationType(PyEnum):
|
|
@@ -46,6 +47,7 @@ class MessageStatus(PyEnum):
|
|
|
46
47
|
|
|
47
48
|
class MessageType(PyEnum):
|
|
48
49
|
TEXT = "TEXT"
|
|
50
|
+
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
class Contact(ChatSchemaMixin, BaseModel):
|
|
@@ -78,6 +80,10 @@ class Contact(ChatSchemaMixin, BaseModel):
|
|
|
78
80
|
crm_contact_guid = Column(String(36), nullable=True)
|
|
79
81
|
|
|
80
82
|
account_id = Column(String(36), nullable=True)
|
|
83
|
+
|
|
84
|
+
# oid claim from Azure AD
|
|
85
|
+
azure_ad_object_id = Column(String(36), nullable=True, unique=True, index=True)
|
|
86
|
+
azure_ad_tenant_id = Column(String(36), nullable=True, index=True)
|
|
81
87
|
|
|
82
88
|
conversations = relationship("Conversation", back_populates="contact", cascade="all, delete-orphan")
|
|
83
89
|
|
|
@@ -26,7 +26,7 @@ class Settings(BaseSettings):
|
|
|
26
26
|
@property
|
|
27
27
|
def PG_DATABASE_URL_PRISM(self) -> str:
|
|
28
28
|
"""Get the Prism database URL."""
|
|
29
|
-
return self.PG_DATABASE_URL + "/
|
|
29
|
+
return self.PG_DATABASE_URL + "/prism2"
|
|
30
30
|
|
|
31
31
|
@property
|
|
32
32
|
def is_development(self) -> bool:
|
|
@@ -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 ###
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""AD Enum and field added
|
|
2
|
+
|
|
3
|
+
Revision ID: b789e61df26a
|
|
4
|
+
Revises: ff3be2c4311f
|
|
5
|
+
Create Date: 2025-10-28 13:33:30.377086
|
|
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 = 'b789e61df26a'
|
|
16
|
+
down_revision: Union[str, Sequence[str], None] = 'ff3be2c4311f'
|
|
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
|
+
# Add new MICROSOFT_AD value to the existing contactsource enum type
|
|
24
|
+
op.execute("ALTER TYPE contactsource ADD VALUE IF NOT EXISTS 'MICROSOFT_AD'")
|
|
25
|
+
|
|
26
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
27
|
+
op.add_column('contact', sa.Column('azure_ad_object_id', sa.String(length=36), nullable=True))
|
|
28
|
+
op.add_column('contact', sa.Column('azure_ad_tenant_id', sa.String(length=36), nullable=True))
|
|
29
|
+
op.create_index(op.f('contact_azure_ad_object_id_idx'), 'contact', ['azure_ad_object_id'], unique=True)
|
|
30
|
+
op.create_index(op.f('contact_azure_ad_tenant_id_idx'), 'contact', ['azure_ad_tenant_id'], unique=False)
|
|
31
|
+
# ### end Alembic commands ###
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def downgrade() -> None:
|
|
35
|
+
"""Downgrade schema."""
|
|
36
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
37
|
+
op.drop_index(op.f('contact_azure_ad_tenant_id_idx'), table_name='contact')
|
|
38
|
+
op.drop_index(op.f('contact_azure_ad_object_id_idx'), table_name='contact')
|
|
39
|
+
op.drop_column('contact', 'azure_ad_tenant_id')
|
|
40
|
+
op.drop_column('contact', 'azure_ad_object_id')
|
|
41
|
+
# ### end Alembic commands ###
|
|
42
|
+
|
|
43
|
+
# NOTE: Removing enum values from PostgreSQL types is complex and risky.
|
|
44
|
+
# The 'MICROSOFT_AD' value will remain in the contactsource type after downgrade.
|
|
45
|
+
# If you need to remove it, you would need to recreate the enum type entirely,
|
|
46
|
+
# which requires updating all dependent columns. Not recommended for production.
|
|
@@ -39,4 +39,6 @@ prism_models/migration/versions/2025_10_07_1722_5cfa0c462948_added_travel_adviso
|
|
|
39
39
|
prism_models/migration/versions/2025_10_08_1304_c91eb8e38cc7_added_destination_report_and_event_.py
|
|
40
40
|
prism_models/migration/versions/2025_10_09_1308_796b720ea35f_added_qa_id_to_vovetor.py
|
|
41
41
|
prism_models/migration/versions/2025_10_16_1611_663c66268631_added_sharepoint_drive_item_id_as_an_.py
|
|
42
|
-
prism_models/migration/versions/2025_10_23_1228_919d07a93f83_added_sharepoint_directory_in_source.py
|
|
42
|
+
prism_models/migration/versions/2025_10_23_1228_919d07a93f83_added_sharepoint_directory_in_source.py
|
|
43
|
+
prism_models/migration/versions/2025_10_27_1331_ff3be2c4311f_added_agentcollectionaccess_table.py
|
|
44
|
+
prism_models/migration/versions/2025_10_28_1333_b789e61df26a_ad_enum_and_field_added.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|