prism-models 0.6.6__tar.gz → 0.7.3__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.
- {prism_models-0.6.6 → prism_models-0.7.3}/PKG-INFO +1 -1
- prism_models-0.7.3/README.md +154 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/__init__.py +10 -1
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/agent_profile.py +31 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/chat.py +9 -2
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py +1 -1
- prism_models-0.7.3/prism_models/migration/versions/2026_01_14_1742_147509a82af8_changed_user_role_enums.py +54 -0
- prism_models-0.7.3/prism_models/migration/versions/2026_01_15_1010_3b7d0b2e9f5a_add_contact_profile_table.py +71 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models.egg-info/PKG-INFO +1 -1
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models.egg-info/SOURCES.txt +3 -1
- {prism_models-0.6.6 → prism_models-0.7.3}/pyproject.toml +12 -1
- prism_models-0.6.6/README.md +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/base.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/config.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/content.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/feedback.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/README +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/__init__.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/env.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/script.py.mako +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_11_1516_161f8829d93f_initial_schema.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_11_1558_5e011849ea76_changes_for_feedback.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_14_2243_059af231c2b2_profile_entities.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_15_1646_3219fec0bb10_agent_changes.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_16_1627_f2013b08daac_rename_metadata_to_additional_data.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_17_1147_327febbf555f_display_name_added.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_18_1106_b0bcb7ca1dc9_add_support_for_profile_on_create_convo.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_18_1511_bbc1955191e6_preview_mode.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_26_1115_6eb70e848451_added_publish_status_to_document.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_26_1240_f8b0ea2e743c_drop_unique_title_version_on_document.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_26_1505_07dc8c2589e0_added_chunk_id_and_vector_embeddings_to_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_09_29_1220_46ba2693b883_add_markdown_markdown_file_path_s3_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_02_1520_bf1472a9b021_removed_doc_id_from_config_table_and_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_02_1525_6c0e63e0fef8_removed_doc_id_from_config_table_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_02_1608_1b3eb48f5017_config_id_on_delete_will_be_set_to_null.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_03_1109_ac85b606d8a4_added_docling_hybrid_to_chunkstrategy.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_03_1204_7d1cb343a63f_added_s3_bucket_and_s3_dir_in_source_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_03_1452_f9c750ec2a0b_1_to_1_relationship_between_collection_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_07_1722_5cfa0c462948_added_travel_advisory_enum.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_08_1304_c91eb8e38cc7_added_destination_report_and_event_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_09_1308_796b720ea35f_added_qa_id_to_vovetor.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_16_1611_663c66268631_added_sharepoint_drive_item_id_as_an_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_23_1228_919d07a93f83_added_sharepoint_directory_in_source.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_27_1331_ff3be2c4311f_added_agentcollectionaccess_table.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_10_28_1333_b789e61df26a_ad_enum_and_field_added.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_03_1633_cc27b20a106e_removed_collection_from_source_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_03_1653_bf5c2ce928e3_removed_collection_from_source_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_03_1738_b733b48d78b5_remove_source.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1450_8a7e56260eba_added_collection_ids_sync_enabled_and_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1626_4c4148ac2d21_removed_qna_related_columns_from_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1648_b228888a01ee_added_chunk_config_to_source.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_06_1656_7d0982bae4db_added_chunk_config_to_source_again_last_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1727_b9663951b5c1_removed_un_used_fields_from_feedback.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1749_3d37806383a2_simplified_feedback.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1838_8c3c862b565e_removed_is_upvoted_from_message.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_12_1841_54a2f12a1573_added_vote_field.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_13_1215_fa00286fe6cd_add_type_column_to_chunk_table.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_14_1216_2c62317520f9_add_rerieved_and_created_chunks_and_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_17_1259_a3bc4e4c08a0_agent_and_profile_entity_changes.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_17_1325_df5b1cdc2c36_agentprofile_contact_entity_changes.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_17_1716_ed91cdf82ef3_adding_feedback_enum.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_20_0008_80f5954656f0_feedback_chunk_entity_added.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_20_0109_58be389d0ed7_feedback_chunks_changes.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_20_0158_98eb0c87e65e_feedback_chunk_chnages.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1207_bbee88729aae_add_feedback_columns.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1625_8c50f64287fe_added_sequence_column_to_chunk_table_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1654_e7ae98ce2121_removed_sync_enabled.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1758_24b3f480777b_refactor_feedback_analysis_for_unified_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_21_1801_5a52fb845dc0_refactor_feedback_analysis_for_unified_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_24_1124_dc57fb290621_added_conversation_context_to_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_11_25_1847_c6c36663acd5_added_user_preferences_table.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_12_07_2236_88f01df468f2_added_sparse_embeddings_field_in_vector_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/migration/versions/2025_12_09_1146_6abdd3f001ab_adding_orchestrator_model_to_profile_.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models/qdrant.py +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models.egg-info/dependency_links.txt +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models.egg-info/requires.txt +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/prism_models.egg-info/top_level.txt +0 -0
- {prism_models-0.6.6 → prism_models-0.7.3}/setup.cfg +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Installing prism-models from AWS CodeArtifact
|
|
2
|
+
|
|
3
|
+
This package is published to AWS CodeArtifact. Projects that depend on it need to configure their environment to authenticate with the private registry.
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
### AWS CodeArtifact Details
|
|
8
|
+
|
|
9
|
+
- **Domain**: `globalrescue`
|
|
10
|
+
- **Domain Owner**: `687144405948`
|
|
11
|
+
- **Region**: `us-east-2`
|
|
12
|
+
- **Repository URL**: `https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/`
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## For Projects Using `uv`
|
|
17
|
+
|
|
18
|
+
### 1. Add the index to `pyproject.toml`
|
|
19
|
+
|
|
20
|
+
```toml
|
|
21
|
+
[[tool.uv.index]]
|
|
22
|
+
name = "private"
|
|
23
|
+
url = "https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/"
|
|
24
|
+
default = true
|
|
25
|
+
|
|
26
|
+
[[tool.uv.index]]
|
|
27
|
+
name = "pypi"
|
|
28
|
+
url = "https://pypi.org/simple"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2. Authenticate before installing
|
|
32
|
+
|
|
33
|
+
**Local development (SSO):**
|
|
34
|
+
```bash
|
|
35
|
+
aws sso login --profile <your-profile>
|
|
36
|
+
export AWS_PROFILE=<your-profile>
|
|
37
|
+
|
|
38
|
+
# Get token and set it
|
|
39
|
+
export UV_INDEX_PRIVATE_PASSWORD=$(aws codeartifact get-authorization-token \
|
|
40
|
+
--domain globalrescue \
|
|
41
|
+
--domain-owner 687144405948 \
|
|
42
|
+
--region us-east-2 \
|
|
43
|
+
--query authorizationToken \
|
|
44
|
+
--output text)
|
|
45
|
+
|
|
46
|
+
# Now install
|
|
47
|
+
uv sync
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**CI/CD (with IAM role):**
|
|
51
|
+
```bash
|
|
52
|
+
export UV_INDEX_PRIVATE_PASSWORD=$(aws codeartifact get-authorization-token \
|
|
53
|
+
--domain globalrescue \
|
|
54
|
+
--domain-owner 687144405948 \
|
|
55
|
+
--region us-east-2 \
|
|
56
|
+
--query authorizationToken \
|
|
57
|
+
--output text)
|
|
58
|
+
|
|
59
|
+
uv sync
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## For Projects Using `pip`
|
|
65
|
+
|
|
66
|
+
### 1. Get the repository URL with credentials
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
aws codeartifact login --tool pip \
|
|
70
|
+
--domain globalrescue \
|
|
71
|
+
--domain-owner 687144405948 \
|
|
72
|
+
--region us-east-2 \
|
|
73
|
+
--repository pypi
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
This automatically configures pip to use CodeArtifact for the session.
|
|
77
|
+
|
|
78
|
+
### 2. Or manually configure pip
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Get the token
|
|
82
|
+
TOKEN=$(aws codeartifact get-authorization-token \
|
|
83
|
+
--domain globalrescue \
|
|
84
|
+
--domain-owner 687144405948 \
|
|
85
|
+
--region us-east-2 \
|
|
86
|
+
--query authorizationToken \
|
|
87
|
+
--output text)
|
|
88
|
+
|
|
89
|
+
# Install with extra index
|
|
90
|
+
pip install prism-models \
|
|
91
|
+
--index-url https://aws:${TOKEN}@globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/ \
|
|
92
|
+
--extra-index-url https://pypi.org/simple/
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## GitLab CI/CD Example
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
install-dependencies:
|
|
101
|
+
script:
|
|
102
|
+
- |
|
|
103
|
+
export UV_INDEX_PRIVATE_PASSWORD=$(aws codeartifact get-authorization-token \
|
|
104
|
+
--domain globalrescue \
|
|
105
|
+
--domain-owner 687144405948 \
|
|
106
|
+
--region us-east-2 \
|
|
107
|
+
--query authorizationToken \
|
|
108
|
+
--output text)
|
|
109
|
+
- uv sync
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Required AWS Permissions
|
|
115
|
+
|
|
116
|
+
The IAM user/role needs these permissions:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"Version": "2012-10-17",
|
|
121
|
+
"Statement": [
|
|
122
|
+
{
|
|
123
|
+
"Effect": "Allow",
|
|
124
|
+
"Action": [
|
|
125
|
+
"codeartifact:GetAuthorizationToken",
|
|
126
|
+
"codeartifact:GetRepositoryEndpoint",
|
|
127
|
+
"codeartifact:ReadFromRepository"
|
|
128
|
+
],
|
|
129
|
+
"Resource": "*"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"Effect": "Allow",
|
|
133
|
+
"Action": "sts:GetServiceBearerToken",
|
|
134
|
+
"Resource": "*",
|
|
135
|
+
"Condition": {
|
|
136
|
+
"StringEquals": {
|
|
137
|
+
"sts:AWSServiceName": "codeartifact.amazonaws.com"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Troubleshooting
|
|
148
|
+
|
|
149
|
+
| Error | Solution |
|
|
150
|
+
|-------|----------|
|
|
151
|
+
| `401 Unauthorized` | Token expired - run `aws codeartifact get-authorization-token` again |
|
|
152
|
+
| `ExpiredTokenException` | Run `aws sso login` again (tokens last 12 hours by default) |
|
|
153
|
+
| `Could not find a version` | Check the package name and that it's published to CodeArtifact |
|
|
154
|
+
| `Access Denied` | Check IAM permissions for CodeArtifact access |
|
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
__version__ = "0.1.0"
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
from prism_models.agent_profile import
|
|
6
|
+
from prism_models.agent_profile import (
|
|
7
|
+
Agent,
|
|
8
|
+
AgentCollectionAccess,
|
|
9
|
+
AgentProfile,
|
|
10
|
+
AgentProfileStatus,
|
|
11
|
+
ContactProfile,
|
|
12
|
+
Profile,
|
|
13
|
+
ProfileCollectionAccess,
|
|
14
|
+
)
|
|
7
15
|
from prism_models.base import POSTGRES_NAMING_CONVENTION, Base, BaseModel, TimestampMixin
|
|
8
16
|
from prism_models.chat import Contact, Conversation, ConversationMessage, ConversationMessageMetadata, UserPreferences
|
|
9
17
|
from prism_models.content import Chunk, ChunkConfig, Collection, CollectionDocument, Document, IntegrationConfig, Source, Vector
|
|
@@ -24,6 +32,7 @@ __all__ = [
|
|
|
24
32
|
"Collection",
|
|
25
33
|
"CollectionDocument",
|
|
26
34
|
"Contact",
|
|
35
|
+
"ContactProfile",
|
|
27
36
|
"Conversation",
|
|
28
37
|
"ConversationMessage",
|
|
29
38
|
"ConversationMessageMetadata",
|
|
@@ -42,6 +42,37 @@ class Profile(BaseModel):
|
|
|
42
42
|
def __repr__(self) -> str:
|
|
43
43
|
return f"<Profile(id={self.id}, name='{self.name}', active={self.is_active})>"
|
|
44
44
|
|
|
45
|
+
|
|
46
|
+
class ContactProfile(BaseModel):
|
|
47
|
+
"""Association between Contact and Profile."""
|
|
48
|
+
|
|
49
|
+
contact_id: Mapped[int] = mapped_column(
|
|
50
|
+
Integer,
|
|
51
|
+
ForeignKey("contact.id", ondelete="CASCADE"),
|
|
52
|
+
nullable=False,
|
|
53
|
+
index=True,
|
|
54
|
+
)
|
|
55
|
+
profile_id: Mapped[int] = mapped_column(
|
|
56
|
+
Integer,
|
|
57
|
+
ForeignKey("profile.id", ondelete="CASCADE"),
|
|
58
|
+
nullable=False,
|
|
59
|
+
index=True,
|
|
60
|
+
)
|
|
61
|
+
assigned_by_contact_id: Mapped[int | None] = mapped_column(
|
|
62
|
+
Integer,
|
|
63
|
+
ForeignKey("contact.id", ondelete="SET NULL"),
|
|
64
|
+
nullable=True,
|
|
65
|
+
index=True,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
contact: Mapped["Contact"] = relationship(foreign_keys=[contact_id], back_populates="contact_profiles")
|
|
69
|
+
profile: Mapped["Profile"] = relationship()
|
|
70
|
+
assigned_by_contact: Mapped["Contact"] = relationship(foreign_keys=[assigned_by_contact_id])
|
|
71
|
+
|
|
72
|
+
__table_args__ = (
|
|
73
|
+
UniqueConstraint("contact_id", "profile_id", name="uq_contact_profile"),
|
|
74
|
+
)
|
|
75
|
+
|
|
45
76
|
class AgentType(str, Enum):
|
|
46
77
|
ORCHESTRATOR_AGENT = "ORCHESTRATOR"
|
|
47
78
|
DOMAIN_AGENT = "DOMAIN"
|
|
@@ -39,7 +39,7 @@ class ContactRole(PyEnum):
|
|
|
39
39
|
ADMIN = "ADMIN"
|
|
40
40
|
MANAGER = "MANAGER"
|
|
41
41
|
USER = "USER"
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
class ConversationType(PyEnum):
|
|
@@ -81,6 +81,7 @@ class Contact(ChatSchemaMixin, BaseModel):
|
|
|
81
81
|
Relationships:
|
|
82
82
|
- conversations: One-to-many relationship with Conversation model
|
|
83
83
|
- user_preferences: One-to-one relationship with UserPreferences model
|
|
84
|
+
- contact_profiles: One-to-many relationship with ContactProfile model
|
|
84
85
|
"""
|
|
85
86
|
|
|
86
87
|
email = Column(String(300), nullable=True)
|
|
@@ -111,7 +112,7 @@ class Contact(ChatSchemaMixin, BaseModel):
|
|
|
111
112
|
Enum(ContactRole),
|
|
112
113
|
default=ContactRole.USER,
|
|
113
114
|
nullable=False,
|
|
114
|
-
server_default="
|
|
115
|
+
server_default="USER"
|
|
115
116
|
)
|
|
116
117
|
manager_contact_id = Column(
|
|
117
118
|
Integer,
|
|
@@ -137,6 +138,12 @@ class Contact(ChatSchemaMixin, BaseModel):
|
|
|
137
138
|
cascade="all, delete-orphan",
|
|
138
139
|
uselist=False # One-to-one relationship
|
|
139
140
|
)
|
|
141
|
+
contact_profiles: Mapped[list["ContactProfile"]] = relationship(
|
|
142
|
+
"ContactProfile",
|
|
143
|
+
back_populates="contact",
|
|
144
|
+
cascade="all, delete-orphan",
|
|
145
|
+
foreign_keys="ContactProfile.contact_id",
|
|
146
|
+
)
|
|
140
147
|
|
|
141
148
|
|
|
142
149
|
class UserPreferences(BaseModel):
|
|
@@ -37,7 +37,7 @@ def upgrade() -> None:
|
|
|
37
37
|
op.add_column('contact', sa.Column('manager_contact_id', sa.Integer(), nullable=True))
|
|
38
38
|
op.create_index(op.f('contact_manager_contact_id_idx'), 'contact', ['manager_contact_id'], unique=False)
|
|
39
39
|
op.create_foreign_key(op.f('contact_manager_contact_id_fkey'), 'contact', 'contact', ['manager_contact_id'], ['id'], ondelete='SET NULL')
|
|
40
|
-
op.drop_index(op.f('idx_document_title_trgm'), table_name='document', postgresql_ops={'title': 'gin_trgm_ops'}, postgresql_using='gin')
|
|
40
|
+
op.drop_index(op.f('idx_document_title_trgm'), table_name='document', postgresql_ops={'title': 'gin_trgm_ops'}, postgresql_using='gin', if_exists=True)
|
|
41
41
|
# ### end Alembic commands ###
|
|
42
42
|
|
|
43
43
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Changed user role enums
|
|
2
|
+
|
|
3
|
+
Revision ID: 147509a82af8
|
|
4
|
+
Revises: 4d9291a3acb1
|
|
5
|
+
Create Date: 2026-01-14 17:42:10.143289
|
|
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 = '147509a82af8'
|
|
16
|
+
down_revision: Union[str, Sequence[str], None] = '4d9291a3acb1'
|
|
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.execute("CREATE TYPE contactrole_new AS ENUM ('ADMIN', 'MANAGER', 'USER')")
|
|
25
|
+
op.execute("ALTER TABLE contact ALTER COLUMN contact_role DROP DEFAULT")
|
|
26
|
+
op.execute(
|
|
27
|
+
"ALTER TABLE contact ALTER COLUMN contact_role TYPE contactrole_new "
|
|
28
|
+
"USING (CASE "
|
|
29
|
+
"WHEN contact_role::text IN ('ADMIN', 'MANAGER') THEN contact_role::text "
|
|
30
|
+
"ELSE 'USER' "
|
|
31
|
+
"END)::contactrole_new"
|
|
32
|
+
)
|
|
33
|
+
op.execute("ALTER TABLE contact ALTER COLUMN contact_role SET DEFAULT 'USER'")
|
|
34
|
+
op.execute("DROP TYPE contactrole")
|
|
35
|
+
op.execute("ALTER TYPE contactrole_new RENAME TO contactrole")
|
|
36
|
+
# ### end Alembic commands ###
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def downgrade() -> None:
|
|
40
|
+
"""Downgrade schema."""
|
|
41
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
42
|
+
op.execute("CREATE TYPE contactrole_old AS ENUM ('ADMIN', 'ACCOUNT_ADMIN', 'MANAGER', 'VIEWER')")
|
|
43
|
+
op.execute("ALTER TABLE contact ALTER COLUMN contact_role DROP DEFAULT")
|
|
44
|
+
op.execute(
|
|
45
|
+
"ALTER TABLE contact ALTER COLUMN contact_role TYPE contactrole_old "
|
|
46
|
+
"USING (CASE "
|
|
47
|
+
"WHEN contact_role::text IN ('ADMIN', 'MANAGER') THEN contact_role::text "
|
|
48
|
+
"ELSE 'VIEWER' "
|
|
49
|
+
"END)::contactrole_old"
|
|
50
|
+
)
|
|
51
|
+
op.execute("ALTER TABLE contact ALTER COLUMN contact_role SET DEFAULT 'VIEWER'")
|
|
52
|
+
op.execute("DROP TYPE contactrole")
|
|
53
|
+
op.execute("ALTER TYPE contactrole_old RENAME TO contactrole")
|
|
54
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Add contact_profile table
|
|
2
|
+
|
|
3
|
+
Revision ID: 3b7d0b2e9f5a
|
|
4
|
+
Revises: 147509a82af8
|
|
5
|
+
Create Date: 2026-01-15 10:10:00.000000
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
from alembic import op
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# revision identifiers, used by Alembic.
|
|
16
|
+
revision: str = "3b7d0b2e9f5a"
|
|
17
|
+
down_revision: Union[str, Sequence[str], None] = "147509a82af8"
|
|
18
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
19
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def upgrade() -> None:
|
|
23
|
+
"""Upgrade schema."""
|
|
24
|
+
op.create_table(
|
|
25
|
+
"contact_profile",
|
|
26
|
+
sa.Column("contact_id", sa.Integer(), nullable=False),
|
|
27
|
+
sa.Column("profile_id", sa.Integer(), nullable=False),
|
|
28
|
+
sa.Column("assigned_by_contact_id", sa.Integer(), nullable=True),
|
|
29
|
+
sa.Column("id", sa.Integer(), nullable=False),
|
|
30
|
+
sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
|
|
31
|
+
sa.Column("updated_at", sa.DateTime(timezone=True), server_default=sa.text("now()"), nullable=False),
|
|
32
|
+
sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True),
|
|
33
|
+
sa.ForeignKeyConstraint(
|
|
34
|
+
["assigned_by_contact_id"],
|
|
35
|
+
["contact.id"],
|
|
36
|
+
name=op.f("contact_profile_assigned_by_contact_id_fkey"),
|
|
37
|
+
ondelete="SET NULL",
|
|
38
|
+
),
|
|
39
|
+
sa.ForeignKeyConstraint(
|
|
40
|
+
["contact_id"],
|
|
41
|
+
["contact.id"],
|
|
42
|
+
name=op.f("contact_profile_contact_id_fkey"),
|
|
43
|
+
ondelete="CASCADE",
|
|
44
|
+
),
|
|
45
|
+
sa.ForeignKeyConstraint(
|
|
46
|
+
["profile_id"],
|
|
47
|
+
["profile.id"],
|
|
48
|
+
name=op.f("contact_profile_profile_id_fkey"),
|
|
49
|
+
ondelete="CASCADE",
|
|
50
|
+
),
|
|
51
|
+
sa.PrimaryKeyConstraint("id", name=op.f("contact_profile_pkey")),
|
|
52
|
+
sa.UniqueConstraint("contact_id", "profile_id", name="uq_contact_profile"),
|
|
53
|
+
)
|
|
54
|
+
op.create_index(
|
|
55
|
+
op.f("contact_profile_assigned_by_contact_id_idx"),
|
|
56
|
+
"contact_profile",
|
|
57
|
+
["assigned_by_contact_id"],
|
|
58
|
+
unique=False,
|
|
59
|
+
)
|
|
60
|
+
op.create_index(op.f("contact_profile_contact_id_idx"), "contact_profile", ["contact_id"], unique=False)
|
|
61
|
+
op.create_index(op.f("contact_profile_id_idx"), "contact_profile", ["id"], unique=False)
|
|
62
|
+
op.create_index(op.f("contact_profile_profile_id_idx"), "contact_profile", ["profile_id"], unique=False)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def downgrade() -> None:
|
|
66
|
+
"""Downgrade schema."""
|
|
67
|
+
op.drop_index(op.f("contact_profile_profile_id_idx"), table_name="contact_profile")
|
|
68
|
+
op.drop_index(op.f("contact_profile_id_idx"), table_name="contact_profile")
|
|
69
|
+
op.drop_index(op.f("contact_profile_contact_id_idx"), table_name="contact_profile")
|
|
70
|
+
op.drop_index(op.f("contact_profile_assigned_by_contact_id_idx"), table_name="contact_profile")
|
|
71
|
+
op.drop_table("contact_profile")
|
|
@@ -70,4 +70,6 @@ prism_models/migration/versions/2025_11_24_1124_dc57fb290621_added_conversation_
|
|
|
70
70
|
prism_models/migration/versions/2025_11_25_1847_c6c36663acd5_added_user_preferences_table.py
|
|
71
71
|
prism_models/migration/versions/2025_12_07_2236_88f01df468f2_added_sparse_embeddings_field_in_vector_.py
|
|
72
72
|
prism_models/migration/versions/2025_12_09_1146_6abdd3f001ab_adding_orchestrator_model_to_profile_.py
|
|
73
|
-
prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py
|
|
73
|
+
prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py
|
|
74
|
+
prism_models/migration/versions/2026_01_14_1742_147509a82af8_changed_user_role_enums.py
|
|
75
|
+
prism_models/migration/versions/2026_01_15_1010_3b7d0b2e9f5a_add_contact_profile_table.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "prism-models"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.7.3"
|
|
8
8
|
requires-python = ">=3.12"
|
|
9
9
|
dependencies = [
|
|
10
10
|
"sqlalchemy[asyncio]>=2.0.0",
|
|
@@ -20,3 +20,14 @@ packages = ["prism_models"]
|
|
|
20
20
|
|
|
21
21
|
[tool.setuptools.package-data]
|
|
22
22
|
prism_models = ["migration/*", "migration/versions/*"]
|
|
23
|
+
|
|
24
|
+
[[tool.uv.index]]
|
|
25
|
+
name = "private"
|
|
26
|
+
url = "https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/simple/"
|
|
27
|
+
publish-url = "https://globalrescue-687144405948.d.codeartifact.us-east-2.amazonaws.com/pypi/pypi/"
|
|
28
|
+
default = true
|
|
29
|
+
|
|
30
|
+
[[tool.uv.index]]
|
|
31
|
+
name = "pypi"
|
|
32
|
+
url = "https://pypi.org/simple"
|
|
33
|
+
|
prism_models-0.6.6/README.md
DELETED
|
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
|
|
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
|