memmachine-common 0.3.4__tar.gz → 0.3.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memmachine-common
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary: MemMachine Common - Shared API models for MemMachine client and server
5
5
  Author-email: MemMachine <noreply@memmachine.ai>
6
6
  License-Expression: Apache-2.0
@@ -51,103 +51,55 @@ class ContentType(Enum):
51
51
  class EpisodeEntry(BaseModel):
52
52
  """Payload used when creating a new episode entry."""
53
53
 
54
- content: Annotated[
55
- str,
56
- Field(..., description=SpecDoc.EPISODE_CONTENT),
57
- ]
58
- producer_id: Annotated[
59
- str,
60
- Field(..., description=SpecDoc.EPISODE_PRODUCER_ID),
61
- ]
62
- producer_role: Annotated[
63
- str,
64
- Field(..., description=SpecDoc.EPISODE_PRODUCER_ROLE),
65
- ]
66
- produced_for_id: Annotated[
67
- str | None,
68
- Field(default=None, description=SpecDoc.EPISODE_PRODUCED_FOR_ID),
69
- ]
70
- episode_type: Annotated[
71
- EpisodeType | None,
72
- Field(default=None, description=SpecDoc.EPISODE_TYPE),
73
- ]
74
- metadata: Annotated[
75
- dict[str, JsonValue] | None,
76
- Field(default=None, description=SpecDoc.EPISODE_METADATA),
77
- ]
78
- created_at: Annotated[
79
- AwareDatetime | None,
80
- Field(default=None, description=SpecDoc.EPISODE_CREATED_AT),
81
- ]
54
+ content: str = Field(..., description=SpecDoc.EPISODE_CONTENT)
55
+ producer_id: str = Field(..., description=SpecDoc.EPISODE_PRODUCER_ID)
56
+ producer_role: str = Field(..., description=SpecDoc.EPISODE_PRODUCER_ROLE)
57
+ produced_for_id: str | None = Field(
58
+ default=None, description=SpecDoc.EPISODE_PRODUCED_FOR_ID
59
+ )
60
+ episode_type: EpisodeType | None = Field(
61
+ default=None, description=SpecDoc.EPISODE_TYPE
62
+ )
63
+ metadata: dict[str, JsonValue] | None = Field(
64
+ default=None, description=SpecDoc.EPISODE_METADATA
65
+ )
66
+ created_at: AwareDatetime | None = Field(
67
+ default=None, description=SpecDoc.EPISODE_CREATED_AT
68
+ )
82
69
 
83
70
 
84
71
  class EpisodeResponse(EpisodeEntry):
85
72
  """Episode data returned in search responses."""
86
73
 
87
- uid: Annotated[
88
- EpisodeIdT,
89
- Field(..., description=SpecDoc.EPISODE_UID),
90
- ]
91
- score: Annotated[
92
- float | None,
93
- Field(default=None, description=SpecDoc.EPISODE_SCORE),
94
- ]
74
+ uid: EpisodeIdT = Field(..., description=SpecDoc.EPISODE_UID)
75
+ score: float | None = Field(default=None, description=SpecDoc.EPISODE_SCORE)
95
76
 
96
77
 
97
78
  class Episode(BaseModel):
98
79
  """Episode data returned in list responses."""
99
80
 
100
- uid: Annotated[
101
- EpisodeIdT,
102
- Field(..., description=SpecDoc.EPISODE_UID),
103
- ]
104
- content: Annotated[
105
- str,
106
- Field(..., description=SpecDoc.EPISODE_CONTENT),
107
- ]
108
- session_key: Annotated[
109
- str,
110
- Field(..., description=SpecDoc.EPISODE_SESSION_KEY),
111
- ]
112
- created_at: Annotated[
113
- AwareDatetime,
114
- Field(..., description=SpecDoc.EPISODE_CREATED_AT),
115
- ]
116
-
117
- producer_id: Annotated[
118
- str,
119
- Field(..., description=SpecDoc.EPISODE_PRODUCER_ID),
120
- ]
121
- producer_role: Annotated[
122
- str,
123
- Field(..., description=SpecDoc.EPISODE_PRODUCER_ROLE),
124
- ]
125
- produced_for_id: Annotated[
126
- str | None,
127
- Field(default=None, description=SpecDoc.EPISODE_PRODUCED_FOR_ID),
128
- ]
129
-
130
- sequence_num: Annotated[
131
- int,
132
- Field(default=0, description=SpecDoc.EPISODE_SEQUENCE_NUM),
133
- ]
134
-
135
- episode_type: Annotated[
136
- EpisodeType,
137
- Field(default=EpisodeType.MESSAGE, description=SpecDoc.EPISODE_TYPE),
138
- ]
139
- content_type: Annotated[
140
- ContentType,
141
- Field(default=ContentType.STRING, description=SpecDoc.EPISODE_CONTENT_TYPE),
142
- ]
143
- filterable_metadata: Annotated[
144
- dict[str, PropertyValue] | None,
145
- Field(default=None, description=SpecDoc.EPISODE_FILTERABLE_METADATA),
146
- ]
147
- metadata: Annotated[
148
- dict[str, JsonValue] | None,
149
- Field(default=None, description=SpecDoc.EPISODE_METADATA),
150
- ]
81
+ uid: EpisodeIdT = Field(..., description=SpecDoc.EPISODE_UID)
82
+ content: str = Field(..., description=SpecDoc.EPISODE_CONTENT)
83
+ session_key: str = Field(..., description=SpecDoc.EPISODE_SESSION_KEY)
84
+ created_at: AwareDatetime = Field(..., description=SpecDoc.EPISODE_CREATED_AT)
85
+ producer_id: str = Field(..., description=SpecDoc.EPISODE_PRODUCER_ID)
86
+ producer_role: str = Field(..., description=SpecDoc.EPISODE_PRODUCER_ROLE)
87
+ produced_for_id: str | None = Field(
88
+ default=None, description=SpecDoc.EPISODE_PRODUCED_FOR_ID
89
+ )
90
+ sequence_num: int = Field(default=0, description=SpecDoc.EPISODE_SEQUENCE_NUM)
91
+ episode_type: EpisodeType = Field(
92
+ default=EpisodeType.MESSAGE, description=SpecDoc.EPISODE_TYPE
93
+ )
94
+ content_type: ContentType = Field(
95
+ default=ContentType.STRING, description=SpecDoc.EPISODE_CONTENT_TYPE
96
+ )
97
+ filterable_metadata: dict[str, PropertyValue] | None = Field(
98
+ default=None, description=SpecDoc.EPISODE_FILTERABLE_METADATA
99
+ )
100
+ metadata: dict[str, JsonValue] | None = Field(
101
+ default=None, description=SpecDoc.EPISODE_METADATA
102
+ )
151
103
 
152
104
  def __hash__(self) -> int:
153
105
  """Hash an episode by its UID."""
@@ -164,43 +116,24 @@ class SemanticFeature(BaseModel):
164
116
  class Metadata(BaseModel):
165
117
  """Storage metadata for a semantic feature, including id and citations."""
166
118
 
167
- citations: Annotated[
168
- list[EpisodeIdT] | None,
169
- Field(default=None, description=SpecDoc.SEMANTIC_METADATA_CITATIONS),
170
- ]
171
- id: Annotated[
172
- FeatureIdT | None,
173
- Field(default=None, description=SpecDoc.SEMANTIC_METADATA_ID),
174
- ]
175
- other: Annotated[
176
- dict[str, Any] | None,
177
- Field(default=None, description=SpecDoc.SEMANTIC_METADATA_OTHER),
178
- ]
119
+ citations: list[EpisodeIdT] | None = Field(
120
+ default=None, description=SpecDoc.SEMANTIC_METADATA_CITATIONS
121
+ )
122
+ id: FeatureIdT | None = Field(
123
+ default=None, description=SpecDoc.SEMANTIC_METADATA_ID
124
+ )
125
+ other: dict[str, Any] | None = Field(
126
+ default=None, description=SpecDoc.SEMANTIC_METADATA_OTHER
127
+ )
179
128
 
180
- set_id: Annotated[
181
- SetIdT | None,
182
- Field(default=None, description=SpecDoc.SEMANTIC_SET_ID),
183
- ]
184
- category: Annotated[
185
- str,
186
- Field(..., description=SpecDoc.SEMANTIC_CATEGORY),
187
- ]
188
- tag: Annotated[
189
- str,
190
- Field(..., description=SpecDoc.SEMANTIC_TAG),
191
- ]
192
- feature_name: Annotated[
193
- str,
194
- Field(..., description=SpecDoc.SEMANTIC_FEATURE_NAME),
195
- ]
196
- value: Annotated[
197
- str,
198
- Field(..., description=SpecDoc.SEMANTIC_VALUE),
199
- ]
200
- metadata: Annotated[
201
- Metadata,
202
- Field(default_factory=Metadata, description=SpecDoc.SEMANTIC_METADATA),
203
- ]
129
+ set_id: SetIdT | None = Field(default=None, description=SpecDoc.SEMANTIC_SET_ID)
130
+ category: str = Field(..., description=SpecDoc.SEMANTIC_CATEGORY)
131
+ tag: str = Field(..., description=SpecDoc.SEMANTIC_TAG)
132
+ feature_name: str = Field(..., description=SpecDoc.SEMANTIC_FEATURE_NAME)
133
+ value: str = Field(..., description=SpecDoc.SEMANTIC_VALUE)
134
+ metadata: Metadata = Field(
135
+ default_factory=Metadata, description=SpecDoc.SEMANTIC_METADATA
136
+ )
204
137
 
205
138
 
206
139
  class InvalidNameError(ValueError):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memmachine-common
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary: MemMachine Common - Shared API models for MemMachine client and server
5
5
  Author-email: MemMachine <noreply@memmachine.ai>
6
6
  License-Expression: Apache-2.0