From ac3e97d129e8978fff1b69d51967b05fea19f334 Mon Sep 17 00:00:00 2001 From: Amy Ni Date: Fri, 6 Feb 2026 15:08:09 -0500 Subject: [PATCH] feat: allow is private flag --- src/cvec/cvec.py | 11 +++++++++++ src/cvec/models/agent_post.py | 1 + 2 files changed, 12 insertions(+) diff --git a/src/cvec/cvec.py b/src/cvec/cvec.py index 19a6ef4..d4df873 100644 --- a/src/cvec/cvec.py +++ b/src/cvec/cvec.py @@ -435,6 +435,7 @@ def add_agent_post( content: Optional[str] = None, recommendations: Optional[List[AgentPostRecommendation]] = None, tags: Optional[List[AgentPostTag]] = None, + is_private: bool = True, ) -> None: """ Add an agent post. @@ -442,6 +443,15 @@ def add_agent_post( Note: If image_id is provided, the image must be uploaded to S3 beforehand. The image_id should be the UUID used as the filename (without .png extension) in the S3 bucket at the tenant's path. + + Args: + title: Post title + author: Post author + image_id: Optional UUID of the uploaded image + content: Optional post content + recommendations: Optional list of recommendations + tags: Optional list of tags + is_private: Whether the post is private (only visible to superadmins). Defaults to True. """ post = AgentPost( @@ -451,6 +461,7 @@ def add_agent_post( content=content, recommendations=recommendations, tags=tags, + is_private=is_private, ) payload = post.model_dump(mode="json", exclude_none=True) diff --git a/src/cvec/models/agent_post.py b/src/cvec/models/agent_post.py index 6d3eccc..6d10fe4 100644 --- a/src/cvec/models/agent_post.py +++ b/src/cvec/models/agent_post.py @@ -41,3 +41,4 @@ class AgentPost(BaseModel): image_id: Optional[str] = None recommendations: Optional[List[AgentPostRecommendation]] = None tags: Optional[List[AgentPostTag]] = None + is_private: bool = False