@@ -55,9 +55,11 @@ def create(
55
55
reference_collection: The name of the collection to personalize
56
56
user_properties: Optional dictionary of user properties and their data types
57
57
agents_host: Optional host URL for the agents service
58
+ vector_name: Optional name of the vector field to use
58
59
timeout: Optional timeout for the request
60
+
59
61
Returns:
60
- PersonalizationAgent: A new instance of the Personalization Agent
62
+ A new instance of the Personalization Agent
61
63
"""
62
64
agent = cls (
63
65
client = client ,
@@ -89,9 +91,11 @@ def connect(
89
91
client: The Weaviate client
90
92
reference_collection: The name of the collection to connect to
91
93
agents_host: Optional host URL for the agents service
94
+ vector_name: Optional name of the vector field to use
92
95
timeout: Optional timeout for the request
96
+
93
97
Returns:
94
- PersonalizationAgent: An instance of the Personalization Agent
98
+ An instance of the Personalization Agent
95
99
"""
96
100
agent = cls (
97
101
client = client ,
@@ -116,8 +120,10 @@ def _initialize(
116
120
117
121
Args:
118
122
reference_collection: The name of the collection to personalize
123
+ create: Whether to create a new personalization agent
119
124
user_properties: Optional dictionary of user properties and their data types
120
125
vector_name: Optional name of the vector field to use
126
+ timeout: Optional timeout for the request
121
127
"""
122
128
request_data = {
123
129
"collection_name" : reference_collection ,
@@ -146,7 +152,6 @@ def add_persona(self, persona: Persona) -> None:
146
152
persona: The persona to add. The persona must have a persona_id and properties that match the user properties
147
153
defined when the Personalization Agent was created.
148
154
"""
149
-
150
155
request_data = {
151
156
"persona" : persona .model_dump (mode = "json" ),
152
157
"personalization_request" : {
@@ -198,7 +203,7 @@ def get_persona(self, persona_id: UUID) -> Persona:
198
203
persona_id: The ID of the persona to retrieve
199
204
200
205
Returns:
201
- Persona: The retrieved persona
206
+ The retrieved persona
202
207
"""
203
208
request_data = {
204
209
"collection_name" : self ._reference_collection ,
@@ -249,7 +254,7 @@ def has_persona(self, persona_id: UUID) -> bool:
249
254
persona_id: The ID of the persona to check
250
255
251
256
Returns:
252
- bool: True if the persona exists, False otherwise
257
+ True if the persona exists, False otherwise
253
258
"""
254
259
request_data = {
255
260
"collection_name" : self ._reference_collection ,
@@ -325,7 +330,7 @@ def get_interactions(
325
330
interaction_type: The type of interaction to filter by (e.g. "positive", "negative")
326
331
327
332
Returns:
328
- list[PersonaInteractionResponse]: List of matching interactions for the persona
333
+ List of matching interactions for the persona
329
334
"""
330
335
request_data = {
331
336
"interaction_request" : {
@@ -372,6 +377,12 @@ def get_objects(
372
377
persona_id: The ID of the persona to get objects for
373
378
limit: The maximum number of objects to return
374
379
recent_interactions_count: The number of recent interactions to consider
380
+ exclude_interacted_items: Whether to exclude items that have been interacted with
381
+ decay_rate: The decay rate for the personalization algorithm
382
+ exclude_items: List of items to exclude from the results
383
+ use_agent_ranking: Whether to use agent ranking for the results
384
+ explain_results: Whether to explain the results
385
+ instruction: Optional instruction to guide the personalization process
375
386
"""
376
387
request_data = {
377
388
"objects_request" : {
@@ -422,7 +433,7 @@ def exists(
422
433
timeout: Optional timeout for the request
423
434
424
435
Returns:
425
- bool: True if the persona collection exists, False otherwise
436
+ True if the persona collection exists, False otherwise
426
437
"""
427
438
# Initialize base values from client
428
439
base_agent = cls (client , reference_collection , agents_host = agents_host )
0 commit comments