Skip to content

Commit bcb0b51

Browse files
authored
Merge pull request #21 from CVector-Energy/amy/auto-post
[PD1-852] Allow generated posts to be private
2 parents fd07385 + ac3e97d commit bcb0b51

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/cvec/cvec.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,23 @@ def add_agent_post(
435435
content: Optional[str] = None,
436436
recommendations: Optional[List[AgentPostRecommendation]] = None,
437437
tags: Optional[List[AgentPostTag]] = None,
438+
is_private: bool = True,
438439
) -> None:
439440
"""
440441
Add an agent post.
441442
442443
Note: If image_id is provided, the image must be uploaded to S3 beforehand.
443444
The image_id should be the UUID used as the filename (without .png extension)
444445
in the S3 bucket at the tenant's path.
446+
447+
Args:
448+
title: Post title
449+
author: Post author
450+
image_id: Optional UUID of the uploaded image
451+
content: Optional post content
452+
recommendations: Optional list of recommendations
453+
tags: Optional list of tags
454+
is_private: Whether the post is private (only visible to superadmins). Defaults to True.
445455
"""
446456

447457
post = AgentPost(
@@ -451,6 +461,7 @@ def add_agent_post(
451461
content=content,
452462
recommendations=recommendations,
453463
tags=tags,
464+
is_private=is_private,
454465
)
455466
payload = post.model_dump(mode="json", exclude_none=True)
456467

src/cvec/models/agent_post.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ class AgentPost(BaseModel):
4141
image_id: Optional[str] = None
4242
recommendations: Optional[List[AgentPostRecommendation]] = None
4343
tags: Optional[List[AgentPostTag]] = None
44+
is_private: bool = False

0 commit comments

Comments
 (0)