From 3f65c5b20132dbc771ffbd65387e20934456c3a6 Mon Sep 17 00:00:00 2001 From: Joshua Napoli Date: Thu, 15 Oct 2026 23:39:06 -0400 Subject: [PATCH] Remove CVec.add_agent_post and the agent post models The backend is removing POST /agent_posts/add, which has had no prod traffic since 2026-06-11. Removing public API is a breaking change, so bump to 2.0.0. Co-Authored-By: Claude Opus 5.5 --- examples/add_agent_post_example.py | 52 ------------------------------ pyproject.toml | 2 +- src/cvec/cvec.py | 41 ----------------------- src/cvec/models/__init__.py | 10 ------ src/cvec/models/agent_post.py | 44 ------------------------- uv.lock | 2 +- 6 files changed, 2 insertions(+), 149 deletions(-) delete mode 100644 examples/add_agent_post_example.py delete mode 100644 src/cvec/models/agent_post.py diff --git a/examples/add_agent_post_example.py b/examples/add_agent_post_example.py deleted file mode 100644 index 186f87a..0000000 --- a/examples/add_agent_post_example.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -import uuid - -from cvec import CVec -from cvec.models.agent_post import AgentPostRecommendation, AgentPostTag, Severity - - -def main() -> None: - # Initialize CVec client - cvec = CVec( - host=os.environ.get("CVEC_HOST", "https://your-subdomain.cvector.dev"), - api_key=os.environ.get("CVEC_API_KEY", "your-api-key"), - ) - - recommendations = [ - AgentPostRecommendation( - content="Critical recommendation", - severity=Severity.CRITICAL, - ), - AgentPostRecommendation( - content="Warning recommendation", - severity=Severity.WARNING, - ), - AgentPostRecommendation( - content="Info recommendation", - severity=Severity.INFO, - ), - ] - - tags = [ - AgentPostTag( - content="urgent", - severity=Severity.CRITICAL, - ), - AgentPostTag( - content="monitoring", - severity=Severity.INFO, - ), - ] - - cvec.add_agent_post( - title="Test post", - author="Operational Agent", - image_id=str(uuid.uuid4()), # Replace with actual image UUID uploaded to S3 - content="SDK add post test.", - recommendations=recommendations, - tags=tags, - ) - - -if __name__ == "__main__": - main() diff --git a/pyproject.toml b/pyproject.toml index 4df82e7..9fbff08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cvec" -version = "1.5.3" +version = "2.0.0" description = "SDK for CVector Energy" authors = [{ name = "CVector", email = "support@cvector.energy" }] readme = "README.md" diff --git a/src/cvec/cvec.py b/src/cvec/cvec.py index 4ecf2cf..db66c61 100644 --- a/src/cvec/cvec.py +++ b/src/cvec/cvec.py @@ -14,7 +14,6 @@ from cvec.http_cache import MAX_CACHE_ENTRIES, CacheEntry, parse_max_age -from cvec.models.agent_post import AgentPost, AgentPostRecommendation, AgentPostTag from cvec.models.eav_column import EAVColumn from cvec.models.eav_filter import EAVFilter from cvec.models.eav_table import EAVTable @@ -496,46 +495,6 @@ def get_modeling_metrics_data_arrow( assert isinstance(result, bytes) return result - def add_agent_post( - self, - title: str, - author: str, - image_id: Optional[str] = None, - content: Optional[str] = None, - recommendations: Optional[List[AgentPostRecommendation]] = None, - tags: Optional[List[AgentPostTag]] = None, - is_private: bool = True, - ) -> None: - """ - Add an 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( - title=title, - author=author, - image_id=image_id, - content=content, - recommendations=recommendations, - tags=tags, - is_private=is_private, - ) - payload = post.model_dump(mode="json", exclude_none=True) - - self._make_request("POST", "/api/agent_posts/add", json_data=payload) - def _login_with_supabase(self, email: str, password: str) -> None: """ Login to Supabase and get access/refresh tokens. diff --git a/src/cvec/models/__init__.py b/src/cvec/models/__init__.py index 5986c12..dd1a3b0 100644 --- a/src/cvec/models/__init__.py +++ b/src/cvec/models/__init__.py @@ -1,9 +1,3 @@ -from .agent_post import ( - AgentPost, - AgentPostRecommendation, - AgentPostTag, - Severity, -) from .eav_column import EAVColumn from .eav_filter import EAVFilter from .eav_table import EAVTable @@ -11,14 +5,10 @@ from .span import Span __all__ = [ - "AgentPost", - "AgentPostRecommendation", - "AgentPostTag", "EAVColumn", "EAVFilter", "EAVTable", "Metric", "MetricDataPoint", - "Severity", "Span", ] diff --git a/src/cvec/models/agent_post.py b/src/cvec/models/agent_post.py deleted file mode 100644 index 6d10fe4..0000000 --- a/src/cvec/models/agent_post.py +++ /dev/null @@ -1,44 +0,0 @@ -from enum import Enum -from typing import List, Optional - -from pydantic import BaseModel, Field - - -class Severity(str, Enum): - """Severity level for recommendations and tags.""" - - CRITICAL = "critical" - WARNING = "warning" - INFO = "info" - - -class AgentPostRecommendation(BaseModel): - """ - Represents a recommendation for creating an agent post. - """ - - content: str = Field(..., min_length=1) - severity: Severity - - -class AgentPostTag(BaseModel): - """ - Represents a tag for creating an agent post. - """ - - content: str = Field(..., min_length=1) - severity: Severity - - -class AgentPost(BaseModel): - """ - Represents an agent post with optional recommendations and tags. - """ - - author: str - title: str - content: Optional[str] = None - image_id: Optional[str] = None - recommendations: Optional[List[AgentPostRecommendation]] = None - tags: Optional[List[AgentPostTag]] = None - is_private: bool = False diff --git a/uv.lock b/uv.lock index 68b5f4e..d317de3 100644 --- a/uv.lock +++ b/uv.lock @@ -80,7 +80,7 @@ wheels = [ [[package]] name = "cvec" -version = "1.5.3" +version = "2.0.0" source = { editable = "." } dependencies = [ { name = "brotli" },