Skip to content

Commit

Permalink
Add new optional field
Browse files Browse the repository at this point in the history
  • Loading branch information
cdpierse committed Oct 7, 2024
1 parent f857d44 commit 71af641
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/3_add_items_and_interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ response = client.user.add_interaction(
user_id=user_id,
item_id=item_id,
interaction_property_name=interaction_type,
weight=weight
weight=weight,
remove_previous_interactions=False
)
print(response)
```
Expand All @@ -130,8 +131,8 @@ For bulk addition of user interactions:
from weaviate_recommend.models.data import UserInteraction

interactions = [
UserInteraction(user_id="user1", item_id="1", interaction_property_name="purchase", weight=1.0),
UserInteraction(user_id="user1", item_id="4", interaction_property_name="purchase", weight=0.5),
UserInteraction(user_id="user1", item_id="1", interaction_property_name="purchase", weight=1.0, remove_previous_interactions=False),
UserInteraction(user_id="user1", item_id="4", interaction_property_name="purchase", weight=0.5, remove_previous_interactions=False),
# add more interactions as needed
]

Expand Down

0 comments on commit 71af641

Please sign in to comment.