From 2ae52510a31249d8585cddfd167bb96623b091e4 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Wed, 16 Apr 2025 15:16:59 -0400 Subject: [PATCH 01/10] chore: Fix fact ratings table --- examples/chat_history/memory.py | 15 ++- examples/graph_example/entity_types.py | 17 +-- examples/graph_example/tickets_example.py | 156 ++++++++++++++++++++++ 3 files changed, 171 insertions(+), 17 deletions(-) create mode 100644 examples/graph_example/tickets_example.py diff --git a/examples/chat_history/memory.py b/examples/chat_history/memory.py index 362b4c20..d5c3f54f 100644 --- a/examples/chat_history/memory.py +++ b/examples/chat_history/memory.py @@ -20,7 +20,7 @@ from chat_history_shoe_purchase import history from zep_cloud.client import AsyncZep -from zep_cloud.types import Message +from zep_cloud.types import Message, FactRatingInstruction, FactRatingExamples load_dotenv( dotenv_path=find_dotenv() @@ -36,7 +36,15 @@ async def main() -> None: # Create a user user_id = uuid.uuid4().hex # unique user id. can be any alphanum string - + fact_rating_instruction = """Rate the facts by poignancy. Highly poignant + facts have a significant emotional impact or relevance to the user. + Facts with low poignancy are minimally relevant or of little emotional + significance.""" + fact_rating_examples = FactRatingExamples( + high="The user received news of a family member's serious illness.", + medium="The user completed a challenging marathon.", + low="The user bought a new brand of toothpaste.", + ) await client.user.add( user_id=user_id, email="user@example.com", @@ -44,9 +52,10 @@ async def main() -> None: last_name="Smith", metadata={"vip": "true"}, ) + # await asyncio.sleep(1) print(f"User added: {user_id}") - + return session_id = uuid.uuid4().hex # unique session id. can be any alphanum string # Create session associated with the above user diff --git a/examples/graph_example/entity_types.py b/examples/graph_example/entity_types.py index 58aa41b0..9aa89e94 100644 --- a/examples/graph_example/entity_types.py +++ b/examples/graph_example/entity_types.py @@ -39,21 +39,10 @@ class Purchase(EntityModel): default=None ) await client.graph.set_entity_types( - entities={ - "Purchase": Purchase, - } + entities={} ) - search_results = await client.graph.search( - user_id="", - query="tickets for the concert", - scope="nodes", - search_filters=SearchFilters( - node_labels=["Purchase"] - ) - ) - print("search_results", search_results) - purchases = [Purchase(**purchase_node.attributes) for purchase_node in search_results.nodes] - print(purchases) + enntl = await client.graph.list_entity_types() + print(enntl) if __name__ == "__main__": diff --git a/examples/graph_example/tickets_example.py b/examples/graph_example/tickets_example.py new file mode 100644 index 00000000..2839f04c --- /dev/null +++ b/examples/graph_example/tickets_example.py @@ -0,0 +1,156 @@ +""" +Example of using Zep Graph API to create a concert ticket purchasing scenario. +This playground demonstrates user interactions with a ticket sales system, +mixing chat messages and purchase events to build a knowledge graph. +""" + +import asyncio +import os +import uuid +import json +from dotenv import find_dotenv, load_dotenv + +from zep_cloud.client import AsyncZep +from zep_cloud.types import Message + +load_dotenv(dotenv_path=find_dotenv()) + +API_KEY = os.environ.get("ZEP_API_KEY") or "YOUR_API_KEY" + +async def create_ticket_playground() -> None: + client = AsyncZep(api_key=API_KEY) + + # Create a user for the playground + user_id = uuid.uuid4().hex + await client.user.add(user_id=user_id, first_name="Sarah", last_name="Smith", email="sarah.smith@example.com") + print(f"Created playground user: {user_id}") + + + # Sample user interactions and system events + episodes = [ + { + "type": "message", + "data": "Sarah (user): Hi, I'm looking for Taylor Swift concert tickets in New York, I am a huge fan!" + }, + { + "type": "json", + "data": { + "event_type": "search_performed", + "user_id": user_id, + "artist": "Taylor Swift", + "location": "New York", + "date_range": "2024-07", + "timestamp": "2024-01-15T10:30:00Z" + } + }, + { + "type": "message", + "data": "TickerSalesBot (assistant): Hi Sarah, welcome to the TicketSales. I found 2 Taylor Swift concerts at Madison Square Garden on July 15 and 16, 2024. Tickets start at $199." + }, + { + "type": "message", + "data": "Sarah (user): Great! I'd like 2 tickets for July 15th please." + }, + { + "type": "json", + "data": { + "event_type": "ticket_purchase", + "user_id": user_id, + "email": "sarah.smith@example.com", + "concert_id": "TS-MSG-0715", + "artist": "Taylor Swift", + "venue": "Madison Square Garden", + "date": "2024-07-15", + "quantity": 2, + "seat_type": "Floor", + "price_per_ticket": 199, + "total_amount": 398, + "transaction_id": "TRX-12345", + "purchase_timestamp": "2024-01-15T10:35:00Z" + } + }, + { + "type": "message", + "data": "Sarah (user): Are there any upcoming Arctic Monkeys concerts?" + }, + { + "type": "json", + "data": { + "event_type": "search_performed", + "user_id": user_id, + "artist": "Arctic Monkeys", + "timestamp": "2024-01-15T10:40:00Z" + } + }, + { + "type": "message", + "data": "TickerSalesBot (assistant): Yes! Arctic Monkeys are playing at Barclays Center on August 5th, 2024." + }, + { + "type": "message", + "data": "Sarah (user): Can you add me to the waitlist for that concert?" + }, + { + "type": "json", + "data": { + "event_type": "waitlist_addition", + "user_id": user_id, + "concert_id": "AM-BC-0805", + "artist": "Arctic Monkeys", + "venue": "Barclays Center", + "date": "2024-08-05", + "timestamp": "2024-01-15T10:42:00Z" + } + }, + { + "type": "message", + "data": "System Notification - Arctic Monkeys tickets are now available for waitlist members!" + }, + { + "type": "json", + "data": { + "event_type": "ticket_purchase", + "user_id": user_id, + "concert_id": "AM-BC-0805", + "artist": "Arctic Monkeys", + "venue": "Barclays Center", + "date": "2024-08-05", + "quantity": 1, + "seat_type": "General Admission", + "price_per_ticket": 150, + "total_amount": 150, + "transaction_id": "TRX-12346", + "purchase_timestamp": "2024-01-15T14:20:00Z" + } + } + ] + + # Add all episodes to the graph + for episode in episodes: + if episode["type"] == "json": + await client.graph.add( + user_id=user_id, + type="json", + data=json.dumps(episode["data"]), + ) + else: # message type + await client.graph.add( + user_id=user_id, + type="message", + data=episode["data"], + ) + + print("Added all ticket purchase episodes to the graph") + print("Waiting for graph processing...") + await asyncio.sleep(30) + + episodes = await client.graph.episode.get_by_user_id(user_id=user_id) + print(episodes) + + + return user_id + +if __name__ == "__main__": + user_id = asyncio.run(create_ticket_playground()) + print(f"\nPlayground ready! User ID: {user_id}") + print("You can now explore the ticket purchase graph and add new episodes!") \ No newline at end of file From 15959651f4d03615159758aff98a6de076e181ef Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 13:59:01 +0000 Subject: [PATCH 02/10] SDK regeneration --- reference.md | 547 ++++++++ src/zep_cloud/__init__.py | 28 +- src/zep_cloud/base_client.py | 3 + src/zep_cloud/batch/__init__.py | 4 + src/zep_cloud/batch/client.py | 650 +++++++++ src/zep_cloud/batch/raw_client.py | 1242 +++++++++++++++++ src/zep_cloud/context/raw_client.py | 40 +- src/zep_cloud/errors/__init__.py | 3 +- src/zep_cloud/errors/bad_request_error.py | 7 +- src/zep_cloud/errors/conflict_error.py | 11 + src/zep_cloud/graph/edge/raw_client.py | 40 +- src/zep_cloud/graph/episode/raw_client.py | 48 +- src/zep_cloud/graph/node/raw_client.py | 56 +- src/zep_cloud/graph/observation/raw_client.py | 24 +- src/zep_cloud/graph/raw_client.py | 120 +- .../graph/thread_summary/raw_client.py | 16 +- src/zep_cloud/project/raw_client.py | 8 +- src/zep_cloud/thread/raw_client.py | 16 +- src/zep_cloud/types/__init__.py | 22 + src/zep_cloud/types/apidata_batch_add_item.py | 33 + .../types/apidata_batch_add_item_role.py | 7 + .../types/apidata_batch_add_item_type.py | 5 + .../types/apidata_batch_item_detail.py | 33 + .../types/apidata_batch_item_list_response.py | 21 + .../types/apidata_batch_list_response.py | 21 + src/zep_cloud/types/apidata_batch_progress.py | 25 + src/zep_cloud/types/apidata_batch_summary.py | 30 + src/zep_cloud/types/models_batch_item_kind.py | 5 + .../types/models_batch_item_status.py | 7 + src/zep_cloud/types/models_batch_status.py | 7 + src/zep_cloud/user/raw_client.py | 48 +- 31 files changed, 2912 insertions(+), 215 deletions(-) create mode 100644 src/zep_cloud/batch/__init__.py create mode 100644 src/zep_cloud/batch/client.py create mode 100644 src/zep_cloud/batch/raw_client.py create mode 100644 src/zep_cloud/errors/conflict_error.py create mode 100644 src/zep_cloud/types/apidata_batch_add_item.py create mode 100644 src/zep_cloud/types/apidata_batch_add_item_role.py create mode 100644 src/zep_cloud/types/apidata_batch_add_item_type.py create mode 100644 src/zep_cloud/types/apidata_batch_item_detail.py create mode 100644 src/zep_cloud/types/apidata_batch_item_list_response.py create mode 100644 src/zep_cloud/types/apidata_batch_list_response.py create mode 100644 src/zep_cloud/types/apidata_batch_progress.py create mode 100644 src/zep_cloud/types/apidata_batch_summary.py create mode 100644 src/zep_cloud/types/models_batch_item_kind.py create mode 100644 src/zep_cloud/types/models_batch_item_status.py create mode 100644 src/zep_cloud/types/models_batch_status.py diff --git a/reference.md b/reference.md index a3b9b3eb..246f0a08 100644 --- a/reference.md +++ b/reference.md @@ -1,4 +1,551 @@ # Reference +## Batch +
client.batch.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List batches for the current project, optionally filtered by batch status. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.list( + limit=1, + cursor=1, + status="status", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Maximum number of batches to return. + +
+
+ +
+
+ +**cursor:** `typing.Optional[int]` — Pagination cursor from a previous response. + +
+
+ +
+
+ +**status:** `typing.Optional[str]` — Batch status filter. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.batch.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a draft batch that can be filled with graph episodes and thread messages. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.create() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.batch.get(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a batch summary, including runtime progress when the batch has been processed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.get( + batch_id="batchId", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**batch_id:** `str` — The batch ID. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.batch.delete(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a draft or invalid unprocessed batch. Processed batches cannot be deleted. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.delete( + batch_id="batchId", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**batch_id:** `str` — The batch ID. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.batch.list_items(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List items in a batch, including derived runtime status when the batch has been processed. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.list_items( + batch_id="batchId", + limit=1, + cursor=1, + status="status", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**batch_id:** `str` — The batch ID. + +
+
+ +
+
+ +**limit:** `typing.Optional[int]` — Maximum number of batch items to return. + +
+
+ +
+
+ +**cursor:** `typing.Optional[int]` — Pagination cursor from a previous response. + +
+
+ +
+
+ +**status:** `typing.Optional[str]` — Batch item status filter. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.batch.add(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Add graph episodes and thread messages to a draft batch. Items are appended in request order. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import ApidataBatchAddItem, Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.add( + batch_id="batchId", + items=[ + ApidataBatchAddItem( + type="graph_episode", + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**batch_id:** `str` — The batch ID. + +
+
+ +
+
+ +**items:** `typing.Sequence[ApidataBatchAddItem]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.batch.process(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Start processing a filled batch. Repeated calls return the existing batch run. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from zep_cloud import Zep + +client = Zep( + api_key="YOUR_API_KEY", +) +client.batch.process( + batch_id="batchId", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**batch_id:** `str` — The batch ID. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ ## Context
client.context.list_context_templates()
diff --git a/src/zep_cloud/__init__.py b/src/zep_cloud/__init__.py index b69f9ad4..b3383f05 100644 --- a/src/zep_cloud/__init__.py +++ b/src/zep_cloud/__init__.py @@ -7,6 +7,14 @@ AddThreadMessagesResponse, AddTripleResponse, ApiError, + ApidataBatchAddItem, + ApidataBatchAddItemRole, + ApidataBatchAddItemType, + ApidataBatchItemDetail, + ApidataBatchItemListResponse, + ApidataBatchListResponse, + ApidataBatchProgress, + ApidataBatchSummary, CloneGraphResponse, ClusterDetectConfig, CoOccurrenceDetectConfig, @@ -49,6 +57,9 @@ Message, MessageListResponse, MetadataFilterGroup, + ModelsBatchItemKind, + ModelsBatchItemStatus, + ModelsBatchStatus, PathDetectConfig, PatternMetadata, PatternResult, @@ -73,8 +84,8 @@ UserListResponse, UserNodeResponse, ) -from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError -from . import context, graph, project, task, thread, user +from .errors import BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError +from . import batch, context, graph, project, task, thread, user from .client import AsyncZep, Zep from .environment import ZepEnvironment from .version import __version__ @@ -84,12 +95,21 @@ "AddThreadMessagesResponse", "AddTripleResponse", "ApiError", + "ApidataBatchAddItem", + "ApidataBatchAddItemRole", + "ApidataBatchAddItemType", + "ApidataBatchItemDetail", + "ApidataBatchItemListResponse", + "ApidataBatchListResponse", + "ApidataBatchProgress", + "ApidataBatchSummary", "AsyncZep", "BadRequestError", "CloneGraphResponse", "ClusterDetectConfig", "CoOccurrenceDetectConfig", "ComparisonOperator", + "ConflictError", "ContextTemplateResponse", "CustomInstruction", "DateFilter", @@ -130,6 +150,9 @@ "Message", "MessageListResponse", "MetadataFilterGroup", + "ModelsBatchItemKind", + "ModelsBatchItemStatus", + "ModelsBatchStatus", "NotFoundError", "PathDetectConfig", "PatternMetadata", @@ -157,6 +180,7 @@ "Zep", "ZepEnvironment", "__version__", + "batch", "context", "graph", "project", diff --git a/src/zep_cloud/base_client.py b/src/zep_cloud/base_client.py index ae0b8c9d..e59bb3cd 100644 --- a/src/zep_cloud/base_client.py +++ b/src/zep_cloud/base_client.py @@ -4,6 +4,7 @@ import typing import httpx +from .batch.client import AsyncBatchClient, BatchClient from .context.client import AsyncContextClient, ContextClient from .core.api_error import ApiError from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper @@ -82,6 +83,7 @@ def __init__( else httpx.Client(timeout=_defaulted_timeout), timeout=_defaulted_timeout, ) + self.batch = BatchClient(client_wrapper=self._client_wrapper) self.context = ContextClient(client_wrapper=self._client_wrapper) self.graph = GraphClient(client_wrapper=self._client_wrapper) self.project = ProjectClient(client_wrapper=self._client_wrapper) @@ -157,6 +159,7 @@ def __init__( else httpx.AsyncClient(timeout=_defaulted_timeout), timeout=_defaulted_timeout, ) + self.batch = AsyncBatchClient(client_wrapper=self._client_wrapper) self.context = AsyncContextClient(client_wrapper=self._client_wrapper) self.graph = AsyncGraphClient(client_wrapper=self._client_wrapper) self.project = AsyncProjectClient(client_wrapper=self._client_wrapper) diff --git a/src/zep_cloud/batch/__init__.py b/src/zep_cloud/batch/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/zep_cloud/batch/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/zep_cloud/batch/client.py b/src/zep_cloud/batch/client.py new file mode 100644 index 00000000..dee64d2b --- /dev/null +++ b/src/zep_cloud/batch/client.py @@ -0,0 +1,650 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.apidata_batch_add_item import ApidataBatchAddItem +from ..types.apidata_batch_item_detail import ApidataBatchItemDetail +from ..types.apidata_batch_item_list_response import ApidataBatchItemListResponse +from ..types.apidata_batch_list_response import ApidataBatchListResponse +from ..types.apidata_batch_summary import ApidataBatchSummary +from ..types.success_response import SuccessResponse +from .raw_client import AsyncRawBatchClient, RawBatchClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class BatchClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawBatchClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawBatchClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawBatchClient + """ + return self._raw_client + + def list( + self, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ApidataBatchListResponse: + """ + List batches for the current project, optionally filtered by batch status. + + Parameters + ---------- + limit : typing.Optional[int] + Maximum number of batches to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchListResponse + Batch list + + Examples + -------- + from zep_cloud import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.list( + limit=1, + cursor=1, + status="status", + ) + """ + _response = self._raw_client.list(limit=limit, cursor=cursor, status=status, request_options=request_options) + return _response.data + + def create( + self, + *, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ApidataBatchSummary: + """ + Create a draft batch that can be filled with graph episodes and thread messages. + + Parameters + ---------- + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchSummary + Created batch + + Examples + -------- + from zep_cloud import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.create() + """ + _response = self._raw_client.create(metadata=metadata, request_options=request_options) + return _response.data + + def get(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ApidataBatchSummary: + """ + Get a batch summary, including runtime progress when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchSummary + Batch summary + + Examples + -------- + from zep_cloud import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.get( + batch_id="batchId", + ) + """ + _response = self._raw_client.get(batch_id, request_options=request_options) + return _response.data + + def delete(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SuccessResponse: + """ + Delete a draft or invalid unprocessed batch. Processed batches cannot be deleted. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SuccessResponse + Deleted batch + + Examples + -------- + from zep_cloud import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.delete( + batch_id="batchId", + ) + """ + _response = self._raw_client.delete(batch_id, request_options=request_options) + return _response.data + + def list_items( + self, + batch_id: str, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ApidataBatchItemListResponse: + """ + List items in a batch, including derived runtime status when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + limit : typing.Optional[int] + Maximum number of batch items to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch item status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchItemListResponse + Batch item list + + Examples + -------- + from zep_cloud import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.list_items( + batch_id="batchId", + limit=1, + cursor=1, + status="status", + ) + """ + _response = self._raw_client.list_items( + batch_id, limit=limit, cursor=cursor, status=status, request_options=request_options + ) + return _response.data + + def add( + self, + batch_id: str, + *, + items: typing.Sequence[ApidataBatchAddItem], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ApidataBatchItemDetail]: + """ + Add graph episodes and thread messages to a draft batch. Items are appended in request order. + + Parameters + ---------- + batch_id : str + The batch ID. + + items : typing.Sequence[ApidataBatchAddItem] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ApidataBatchItemDetail] + Added batch items + + Examples + -------- + from zep_cloud import ApidataBatchAddItem, Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.add( + batch_id="batchId", + items=[ + ApidataBatchAddItem( + type="graph_episode", + ) + ], + ) + """ + _response = self._raw_client.add(batch_id, items=items, request_options=request_options) + return _response.data + + def process(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ApidataBatchSummary: + """ + Start processing a filled batch. Repeated calls return the existing batch run. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchSummary + Batch processing state + + Examples + -------- + from zep_cloud import Zep + + client = Zep( + api_key="YOUR_API_KEY", + ) + client.batch.process( + batch_id="batchId", + ) + """ + _response = self._raw_client.process(batch_id, request_options=request_options) + return _response.data + + +class AsyncBatchClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawBatchClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawBatchClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawBatchClient + """ + return self._raw_client + + async def list( + self, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ApidataBatchListResponse: + """ + List batches for the current project, optionally filtered by batch status. + + Parameters + ---------- + limit : typing.Optional[int] + Maximum number of batches to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchListResponse + Batch list + + Examples + -------- + import asyncio + + from zep_cloud import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.list( + limit=1, + cursor=1, + status="status", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + limit=limit, cursor=cursor, status=status, request_options=request_options + ) + return _response.data + + async def create( + self, + *, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ApidataBatchSummary: + """ + Create a draft batch that can be filled with graph episodes and thread messages. + + Parameters + ---------- + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchSummary + Created batch + + Examples + -------- + import asyncio + + from zep_cloud import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.create() + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(metadata=metadata, request_options=request_options) + return _response.data + + async def get( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ApidataBatchSummary: + """ + Get a batch summary, including runtime progress when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchSummary + Batch summary + + Examples + -------- + import asyncio + + from zep_cloud import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.get( + batch_id="batchId", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get(batch_id, request_options=request_options) + return _response.data + + async def delete( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> SuccessResponse: + """ + Delete a draft or invalid unprocessed batch. Processed batches cannot be deleted. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SuccessResponse + Deleted batch + + Examples + -------- + import asyncio + + from zep_cloud import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.delete( + batch_id="batchId", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(batch_id, request_options=request_options) + return _response.data + + async def list_items( + self, + batch_id: str, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ApidataBatchItemListResponse: + """ + List items in a batch, including derived runtime status when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + limit : typing.Optional[int] + Maximum number of batch items to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch item status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchItemListResponse + Batch item list + + Examples + -------- + import asyncio + + from zep_cloud import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.list_items( + batch_id="batchId", + limit=1, + cursor=1, + status="status", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list_items( + batch_id, limit=limit, cursor=cursor, status=status, request_options=request_options + ) + return _response.data + + async def add( + self, + batch_id: str, + *, + items: typing.Sequence[ApidataBatchAddItem], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ApidataBatchItemDetail]: + """ + Add graph episodes and thread messages to a draft batch. Items are appended in request order. + + Parameters + ---------- + batch_id : str + The batch ID. + + items : typing.Sequence[ApidataBatchAddItem] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ApidataBatchItemDetail] + Added batch items + + Examples + -------- + import asyncio + + from zep_cloud import ApidataBatchAddItem, AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.add( + batch_id="batchId", + items=[ + ApidataBatchAddItem( + type="graph_episode", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.add(batch_id, items=items, request_options=request_options) + return _response.data + + async def process( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ApidataBatchSummary: + """ + Start processing a filled batch. Repeated calls return the existing batch run. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ApidataBatchSummary + Batch processing state + + Examples + -------- + import asyncio + + from zep_cloud import AsyncZep + + client = AsyncZep( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.batch.process( + batch_id="batchId", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.process(batch_id, request_options=request_options) + return _response.data diff --git a/src/zep_cloud/batch/raw_client.py b/src/zep_cloud/batch/raw_client.py new file mode 100644 index 00000000..e4bdbd27 --- /dev/null +++ b/src/zep_cloud/batch/raw_client.py @@ -0,0 +1,1242 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata +from ..errors.bad_request_error import BadRequestError +from ..errors.conflict_error import ConflictError +from ..errors.internal_server_error import InternalServerError +from ..errors.not_found_error import NotFoundError +from ..types.api_error import ApiError as types_api_error_ApiError +from ..types.apidata_batch_add_item import ApidataBatchAddItem +from ..types.apidata_batch_item_detail import ApidataBatchItemDetail +from ..types.apidata_batch_item_list_response import ApidataBatchItemListResponse +from ..types.apidata_batch_list_response import ApidataBatchListResponse +from ..types.apidata_batch_summary import ApidataBatchSummary +from ..types.success_response import SuccessResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawBatchClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ApidataBatchListResponse]: + """ + List batches for the current project, optionally filtered by batch status. + + Parameters + ---------- + limit : typing.Optional[int] + Maximum number of batches to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ApidataBatchListResponse] + Batch list + """ + _response = self._client_wrapper.httpx_client.request( + "batches", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchListResponse, + parse_obj_as( + type_=ApidataBatchListResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def create( + self, + *, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ApidataBatchSummary]: + """ + Create a draft batch that can be filled with graph episodes and thread messages. + + Parameters + ---------- + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ApidataBatchSummary] + Created batch + """ + _response = self._client_wrapper.httpx_client.request( + "batches", + method="POST", + json={ + "metadata": metadata, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchSummary, + parse_obj_as( + type_=ApidataBatchSummary, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def get( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ApidataBatchSummary]: + """ + Get a batch summary, including runtime progress when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ApidataBatchSummary] + Batch summary + """ + _response = self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchSummary, + parse_obj_as( + type_=ApidataBatchSummary, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def delete( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[SuccessResponse]: + """ + Delete a draft or invalid unprocessed batch. Processed batches cannot be deleted. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SuccessResponse] + Deleted batch + """ + _response = self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SuccessResponse, + parse_obj_as( + type_=SuccessResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def list_items( + self, + batch_id: str, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ApidataBatchItemListResponse]: + """ + List items in a batch, including derived runtime status when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + limit : typing.Optional[int] + Maximum number of batch items to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch item status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ApidataBatchItemListResponse] + Batch item list + """ + _response = self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}/items", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchItemListResponse, + parse_obj_as( + type_=ApidataBatchItemListResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def add( + self, + batch_id: str, + *, + items: typing.Sequence[ApidataBatchAddItem], + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[typing.List[ApidataBatchItemDetail]]: + """ + Add graph episodes and thread messages to a draft batch. Items are appended in request order. + + Parameters + ---------- + batch_id : str + The batch ID. + + items : typing.Sequence[ApidataBatchAddItem] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[typing.List[ApidataBatchItemDetail]] + Added batch items + """ + _response = self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}/items", + method="POST", + json={ + "items": convert_and_respect_annotation_metadata( + object_=items, annotation=typing.Sequence[ApidataBatchAddItem], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[ApidataBatchItemDetail], + parse_obj_as( + type_=typing.List[ApidataBatchItemDetail], # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + def process( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ApidataBatchSummary]: + """ + Start processing a filled batch. Repeated calls return the existing batch run. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ApidataBatchSummary] + Batch processing state + """ + _response = self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}/process", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchSummary, + parse_obj_as( + type_=ApidataBatchSummary, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + +class AsyncRawBatchClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ApidataBatchListResponse]: + """ + List batches for the current project, optionally filtered by batch status. + + Parameters + ---------- + limit : typing.Optional[int] + Maximum number of batches to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ApidataBatchListResponse] + Batch list + """ + _response = await self._client_wrapper.httpx_client.request( + "batches", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchListResponse, + parse_obj_as( + type_=ApidataBatchListResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def create( + self, + *, + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ApidataBatchSummary]: + """ + Create a draft batch that can be filled with graph episodes and thread messages. + + Parameters + ---------- + metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ApidataBatchSummary] + Created batch + """ + _response = await self._client_wrapper.httpx_client.request( + "batches", + method="POST", + json={ + "metadata": metadata, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchSummary, + parse_obj_as( + type_=ApidataBatchSummary, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def get( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ApidataBatchSummary]: + """ + Get a batch summary, including runtime progress when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ApidataBatchSummary] + Batch summary + """ + _response = await self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchSummary, + parse_obj_as( + type_=ApidataBatchSummary, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def delete( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[SuccessResponse]: + """ + Delete a draft or invalid unprocessed batch. Processed batches cannot be deleted. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SuccessResponse] + Deleted batch + """ + _response = await self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SuccessResponse, + parse_obj_as( + type_=SuccessResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def list_items( + self, + batch_id: str, + *, + limit: typing.Optional[int] = None, + cursor: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ApidataBatchItemListResponse]: + """ + List items in a batch, including derived runtime status when the batch has been processed. + + Parameters + ---------- + batch_id : str + The batch ID. + + limit : typing.Optional[int] + Maximum number of batch items to return. + + cursor : typing.Optional[int] + Pagination cursor from a previous response. + + status : typing.Optional[str] + Batch item status filter. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ApidataBatchItemListResponse] + Batch item list + """ + _response = await self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}/items", + method="GET", + params={ + "limit": limit, + "cursor": cursor, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchItemListResponse, + parse_obj_as( + type_=ApidataBatchItemListResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def add( + self, + batch_id: str, + *, + items: typing.Sequence[ApidataBatchAddItem], + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[typing.List[ApidataBatchItemDetail]]: + """ + Add graph episodes and thread messages to a draft batch. Items are appended in request order. + + Parameters + ---------- + batch_id : str + The batch ID. + + items : typing.Sequence[ApidataBatchAddItem] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[typing.List[ApidataBatchItemDetail]] + Added batch items + """ + _response = await self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}/items", + method="POST", + json={ + "items": convert_and_respect_annotation_metadata( + object_=items, annotation=typing.Sequence[ApidataBatchAddItem], direction="write" + ), + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[ApidataBatchItemDetail], + parse_obj_as( + type_=typing.List[ApidataBatchItemDetail], # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) + + async def process( + self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ApidataBatchSummary]: + """ + Start processing a filled batch. Repeated calls return the existing batch run. + + Parameters + ---------- + batch_id : str + The batch ID. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ApidataBatchSummary] + Batch processing state + """ + _response = await self._client_wrapper.httpx_client.request( + f"batches/{jsonable_encoder(batch_id)}/process", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ApidataBatchSummary, + parse_obj_as( + type_=ApidataBatchSummary, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 400: + raise BadRequestError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + parse_obj_as( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 409: + raise ConflictError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + if _response.status_code == 500: + raise InternalServerError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response.text + ) + raise core_api_error_ApiError( + status_code=_response.status_code, headers=dict(_response.headers), body=_response_json + ) diff --git a/src/zep_cloud/context/raw_client.py b/src/zep_cloud/context/raw_client.py index 800f0ac6..4fe59872 100644 --- a/src/zep_cloud/context/raw_client.py +++ b/src/zep_cloud/context/raw_client.py @@ -60,9 +60,9 @@ def list_context_templates( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -136,9 +136,9 @@ def create_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -201,9 +201,9 @@ def get_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -287,9 +287,9 @@ def update_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -363,9 +363,9 @@ def delete_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -441,9 +441,9 @@ async def list_context_templates( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -517,9 +517,9 @@ async def create_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -582,9 +582,9 @@ async def get_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -668,9 +668,9 @@ async def update_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -744,9 +744,9 @@ async def delete_context_template( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/errors/__init__.py b/src/zep_cloud/errors/__init__.py index 3455a818..28fad1dd 100644 --- a/src/zep_cloud/errors/__init__.py +++ b/src/zep_cloud/errors/__init__.py @@ -3,8 +3,9 @@ # isort: skip_file from .bad_request_error import BadRequestError +from .conflict_error import ConflictError from .forbidden_error import ForbiddenError from .internal_server_error import InternalServerError from .not_found_error import NotFoundError -__all__ = ["BadRequestError", "ForbiddenError", "InternalServerError", "NotFoundError"] +__all__ = ["BadRequestError", "ConflictError", "ForbiddenError", "InternalServerError", "NotFoundError"] diff --git a/src/zep_cloud/errors/bad_request_error.py b/src/zep_cloud/errors/bad_request_error.py index 3cf1d9ca..baf5be4f 100644 --- a/src/zep_cloud/errors/bad_request_error.py +++ b/src/zep_cloud/errors/bad_request_error.py @@ -2,10 +2,9 @@ import typing -from ..core.api_error import ApiError as core_api_error_ApiError -from ..types.api_error import ApiError as types_api_error_ApiError +from ..core.api_error import ApiError -class BadRequestError(core_api_error_ApiError): - def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None): +class BadRequestError(ApiError): + def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None): super().__init__(status_code=400, headers=headers, body=body) diff --git a/src/zep_cloud/errors/conflict_error.py b/src/zep_cloud/errors/conflict_error.py new file mode 100644 index 00000000..a1954586 --- /dev/null +++ b/src/zep_cloud/errors/conflict_error.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.api_error import ApiError as core_api_error_ApiError +from ..types.api_error import ApiError as types_api_error_ApiError + + +class ConflictError(core_api_error_ApiError): + def __init__(self, body: types_api_error_ApiError, headers: typing.Optional[typing.Dict[str, str]] = None): + super().__init__(status_code=409, headers=headers, body=body) diff --git a/src/zep_cloud/graph/edge/raw_client.py b/src/zep_cloud/graph/edge/raw_client.py index 2fc8e42a..fe651c3c 100644 --- a/src/zep_cloud/graph/edge/raw_client.py +++ b/src/zep_cloud/graph/edge/raw_client.py @@ -81,9 +81,9 @@ def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -165,9 +165,9 @@ def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -228,9 +228,9 @@ def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -304,9 +304,9 @@ def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -419,9 +419,9 @@ def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -519,9 +519,9 @@ async def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -603,9 +603,9 @@ async def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -668,9 +668,9 @@ async def get( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -744,9 +744,9 @@ async def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -859,9 +859,9 @@ async def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/graph/episode/raw_client.py b/src/zep_cloud/graph/episode/raw_client.py index 20c871bc..eba044f8 100644 --- a/src/zep_cloud/graph/episode/raw_client.py +++ b/src/zep_cloud/graph/episode/raw_client.py @@ -75,9 +75,9 @@ def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -150,9 +150,9 @@ def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -213,9 +213,9 @@ def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -278,9 +278,9 @@ def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -368,9 +368,9 @@ def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -455,9 +455,9 @@ def get_nodes_and_edges( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -535,9 +535,9 @@ async def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -610,9 +610,9 @@ async def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -675,9 +675,9 @@ async def get( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -740,9 +740,9 @@ async def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -830,9 +830,9 @@ async def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -917,9 +917,9 @@ async def get_nodes_and_edges( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/graph/node/raw_client.py b/src/zep_cloud/graph/node/raw_client.py index 5467a088..6e524024 100644 --- a/src/zep_cloud/graph/node/raw_client.py +++ b/src/zep_cloud/graph/node/raw_client.py @@ -83,9 +83,9 @@ def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -167,9 +167,9 @@ def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -232,9 +232,9 @@ def get_edges( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -297,9 +297,9 @@ def get_episodes( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -360,9 +360,9 @@ def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -436,9 +436,9 @@ def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -541,9 +541,9 @@ def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -641,9 +641,9 @@ async def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -725,9 +725,9 @@ async def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -790,9 +790,9 @@ async def get_edges( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -855,9 +855,9 @@ async def get_episodes( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -920,9 +920,9 @@ async def get( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -996,9 +996,9 @@ async def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1101,9 +1101,9 @@ async def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/graph/observation/raw_client.py b/src/zep_cloud/graph/observation/raw_client.py index 247868b9..11a9b68d 100644 --- a/src/zep_cloud/graph/observation/raw_client.py +++ b/src/zep_cloud/graph/observation/raw_client.py @@ -80,9 +80,9 @@ def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -175,9 +175,9 @@ def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -249,9 +249,9 @@ def get(self, uuid_: str, *, request_options: typing.Optional[RequestOptions] = raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -349,9 +349,9 @@ async def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -444,9 +444,9 @@ async def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -520,9 +520,9 @@ async def get( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/graph/raw_client.py b/src/zep_cloud/graph/raw_client.py index 276af35c..40c81f34 100644 --- a/src/zep_cloud/graph/raw_client.py +++ b/src/zep_cloud/graph/raw_client.py @@ -94,9 +94,9 @@ def list_custom_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -192,9 +192,9 @@ def add_custom_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -288,9 +288,9 @@ def delete_custom_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -375,9 +375,9 @@ def list_entity_types( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -476,9 +476,9 @@ def set_entity_types_internal( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -588,9 +588,9 @@ def add( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -674,9 +674,9 @@ def add_batch( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -851,9 +851,9 @@ def add_fact_triple( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -941,9 +941,9 @@ def clone( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1023,9 +1023,9 @@ def create( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1114,9 +1114,9 @@ def list_all( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1253,9 +1253,9 @@ def detect_patterns( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1407,9 +1407,9 @@ def search( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1535,9 +1535,9 @@ def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1628,9 +1628,9 @@ def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1720,9 +1720,9 @@ async def list_custom_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1818,9 +1818,9 @@ async def add_custom_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1914,9 +1914,9 @@ async def delete_custom_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2001,9 +2001,9 @@ async def list_entity_types( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2102,9 +2102,9 @@ async def set_entity_types_internal( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2214,9 +2214,9 @@ async def add( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2300,9 +2300,9 @@ async def add_batch( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2477,9 +2477,9 @@ async def add_fact_triple( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2567,9 +2567,9 @@ async def clone( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2649,9 +2649,9 @@ async def create( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2740,9 +2740,9 @@ async def list_all( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -2879,9 +2879,9 @@ async def detect_patterns( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -3033,9 +3033,9 @@ async def search( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -3163,9 +3163,9 @@ async def delete( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -3256,9 +3256,9 @@ async def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/graph/thread_summary/raw_client.py b/src/zep_cloud/graph/thread_summary/raw_client.py index 9e30f8a6..af0483f4 100644 --- a/src/zep_cloud/graph/thread_summary/raw_client.py +++ b/src/zep_cloud/graph/thread_summary/raw_client.py @@ -80,9 +80,9 @@ def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -175,9 +175,9 @@ def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -275,9 +275,9 @@ async def get_by_graph_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -370,9 +370,9 @@ async def get_by_user_id( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/project/raw_client.py b/src/zep_cloud/project/raw_client.py index 4b74c71b..bd2e85b6 100644 --- a/src/zep_cloud/project/raw_client.py +++ b/src/zep_cloud/project/raw_client.py @@ -52,9 +52,9 @@ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> Htt raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -130,9 +130,9 @@ async def get( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/thread/raw_client.py b/src/zep_cloud/thread/raw_client.py index ac1b34bb..35b17a9d 100644 --- a/src/zep_cloud/thread/raw_client.py +++ b/src/zep_cloud/thread/raw_client.py @@ -92,9 +92,9 @@ def list_all( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -168,9 +168,9 @@ def create( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -724,9 +724,9 @@ async def list_all( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -800,9 +800,9 @@ async def create( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), diff --git a/src/zep_cloud/types/__init__.py b/src/zep_cloud/types/__init__.py index be720e31..77c31ed4 100644 --- a/src/zep_cloud/types/__init__.py +++ b/src/zep_cloud/types/__init__.py @@ -6,6 +6,14 @@ from .add_thread_messages_response import AddThreadMessagesResponse from .add_triple_response import AddTripleResponse from .api_error import ApiError +from .apidata_batch_add_item import ApidataBatchAddItem +from .apidata_batch_add_item_role import ApidataBatchAddItemRole +from .apidata_batch_add_item_type import ApidataBatchAddItemType +from .apidata_batch_item_detail import ApidataBatchItemDetail +from .apidata_batch_item_list_response import ApidataBatchItemListResponse +from .apidata_batch_list_response import ApidataBatchListResponse +from .apidata_batch_progress import ApidataBatchProgress +from .apidata_batch_summary import ApidataBatchSummary from .clone_graph_response import CloneGraphResponse from .cluster_detect_config import ClusterDetectConfig from .co_occurrence_detect_config import CoOccurrenceDetectConfig @@ -48,6 +56,9 @@ from .message import Message from .message_list_response import MessageListResponse from .metadata_filter_group import MetadataFilterGroup +from .models_batch_item_kind import ModelsBatchItemKind +from .models_batch_item_status import ModelsBatchItemStatus +from .models_batch_status import ModelsBatchStatus from .path_detect_config import PathDetectConfig from .pattern_metadata import PatternMetadata from .pattern_result import PatternResult @@ -77,6 +88,14 @@ "AddThreadMessagesResponse", "AddTripleResponse", "ApiError", + "ApidataBatchAddItem", + "ApidataBatchAddItemRole", + "ApidataBatchAddItemType", + "ApidataBatchItemDetail", + "ApidataBatchItemListResponse", + "ApidataBatchListResponse", + "ApidataBatchProgress", + "ApidataBatchSummary", "CloneGraphResponse", "ClusterDetectConfig", "CoOccurrenceDetectConfig", @@ -119,6 +138,9 @@ "Message", "MessageListResponse", "MetadataFilterGroup", + "ModelsBatchItemKind", + "ModelsBatchItemStatus", + "ModelsBatchStatus", "PathDetectConfig", "PatternMetadata", "PatternResult", diff --git a/src/zep_cloud/types/apidata_batch_add_item.py b/src/zep_cloud/types/apidata_batch_add_item.py new file mode 100644 index 00000000..3a139c9f --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_add_item.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .apidata_batch_add_item_role import ApidataBatchAddItemRole +from .apidata_batch_add_item_type import ApidataBatchAddItemType +from .graph_data_type import GraphDataType + + +class ApidataBatchAddItem(UniversalBaseModel): + content: typing.Optional[str] = None + created_at: typing.Optional[str] = None + data: typing.Optional[str] = None + data_type: typing.Optional[GraphDataType] = None + graph_id: typing.Optional[str] = None + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + name: typing.Optional[str] = None + role: typing.Optional[ApidataBatchAddItemRole] = None + source_description: typing.Optional[str] = None + thread_id: typing.Optional[str] = None + type: ApidataBatchAddItemType + user_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/zep_cloud/types/apidata_batch_add_item_role.py b/src/zep_cloud/types/apidata_batch_add_item_role.py new file mode 100644 index 00000000..4f51bde1 --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_add_item_role.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ApidataBatchAddItemRole = typing.Union[ + typing.Literal["norole", "system", "assistant", "user", "function", "tool"], typing.Any +] diff --git a/src/zep_cloud/types/apidata_batch_add_item_type.py b/src/zep_cloud/types/apidata_batch_add_item_type.py new file mode 100644 index 00000000..f659edea --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_add_item_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ApidataBatchAddItemType = typing.Union[typing.Literal["graph_episode", "thread_message"], typing.Any] diff --git a/src/zep_cloud/types/apidata_batch_item_detail.py b/src/zep_cloud/types/apidata_batch_item_detail.py new file mode 100644 index 00000000..a9b86a6a --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_item_detail.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .models_batch_item_kind import ModelsBatchItemKind +from .models_batch_item_status import ModelsBatchItemStatus + + +class ApidataBatchItemDetail(UniversalBaseModel): + created_at: typing.Optional[str] = None + episode_uuid: typing.Optional[str] = None + error: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + graph_id: typing.Optional[str] = None + item_id: typing.Optional[str] = None + kind: typing.Optional[ModelsBatchItemKind] = None + sequence_index: typing.Optional[int] = None + source_uuid: typing.Optional[str] = None + stage: typing.Optional[str] = None + status: typing.Optional[ModelsBatchItemStatus] = None + thread_id: typing.Optional[str] = None + updated_at: typing.Optional[str] = None + user_id: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/zep_cloud/types/apidata_batch_item_list_response.py b/src/zep_cloud/types/apidata_batch_item_list_response.py new file mode 100644 index 00000000..61ff6cc9 --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_item_list_response.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .apidata_batch_item_detail import ApidataBatchItemDetail + + +class ApidataBatchItemListResponse(UniversalBaseModel): + items: typing.Optional[typing.List[ApidataBatchItemDetail]] = None + next_cursor: typing.Optional[int] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/zep_cloud/types/apidata_batch_list_response.py b/src/zep_cloud/types/apidata_batch_list_response.py new file mode 100644 index 00000000..91ec2243 --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_list_response.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .apidata_batch_summary import ApidataBatchSummary + + +class ApidataBatchListResponse(UniversalBaseModel): + batches: typing.Optional[typing.List[ApidataBatchSummary]] = None + next_cursor: typing.Optional[int] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/zep_cloud/types/apidata_batch_progress.py b/src/zep_cloud/types/apidata_batch_progress.py new file mode 100644 index 00000000..7f92a910 --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_progress.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class ApidataBatchProgress(UniversalBaseModel): + failed_items: typing.Optional[int] = None + percent_complete: typing.Optional[float] = None + processing_items: typing.Optional[int] = None + queued_items: typing.Optional[int] = None + skipped_items: typing.Optional[int] = None + succeeded_items: typing.Optional[int] = None + total_items: typing.Optional[int] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/zep_cloud/types/apidata_batch_summary.py b/src/zep_cloud/types/apidata_batch_summary.py new file mode 100644 index 00000000..9dba7180 --- /dev/null +++ b/src/zep_cloud/types/apidata_batch_summary.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .apidata_batch_progress import ApidataBatchProgress +from .models_batch_status import ModelsBatchStatus + + +class ApidataBatchSummary(UniversalBaseModel): + batch_id: typing.Optional[str] = None + completed_at: typing.Optional[str] = None + created_at: typing.Optional[str] = None + current_stage: typing.Optional[str] = None + item_count: typing.Optional[int] = None + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + processed_at: typing.Optional[str] = None + progress: typing.Optional[ApidataBatchProgress] = None + status: typing.Optional[ModelsBatchStatus] = None + updated_at: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/zep_cloud/types/models_batch_item_kind.py b/src/zep_cloud/types/models_batch_item_kind.py new file mode 100644 index 00000000..ad690c61 --- /dev/null +++ b/src/zep_cloud/types/models_batch_item_kind.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ModelsBatchItemKind = typing.Union[typing.Literal["graph_episode", "thread_message"], typing.Any] diff --git a/src/zep_cloud/types/models_batch_item_status.py b/src/zep_cloud/types/models_batch_item_status.py new file mode 100644 index 00000000..2ff473a8 --- /dev/null +++ b/src/zep_cloud/types/models_batch_item_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ModelsBatchItemStatus = typing.Union[ + typing.Literal["pending", "queued", "processing", "succeeded", "failed", "skipped"], typing.Any +] diff --git a/src/zep_cloud/types/models_batch_status.py b/src/zep_cloud/types/models_batch_status.py new file mode 100644 index 00000000..173113a3 --- /dev/null +++ b/src/zep_cloud/types/models_batch_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ModelsBatchStatus = typing.Union[ + typing.Literal["draft", "invalid", "queued", "processing", "succeeded", "partial", "failed"], typing.Any +] diff --git a/src/zep_cloud/user/raw_client.py b/src/zep_cloud/user/raw_client.py index f9ba4182..5eec6c94 100644 --- a/src/zep_cloud/user/raw_client.py +++ b/src/zep_cloud/user/raw_client.py @@ -71,9 +71,9 @@ def list_user_summary_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -164,9 +164,9 @@ def add_user_summary_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -255,9 +255,9 @@ def delete_user_summary_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -366,9 +366,9 @@ def add( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -457,9 +457,9 @@ def list_ordered( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -684,9 +684,9 @@ def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -952,9 +952,9 @@ async def list_user_summary_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1045,9 +1045,9 @@ async def add_user_summary_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1136,9 +1136,9 @@ async def delete_user_summary_instructions( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1247,9 +1247,9 @@ async def add( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1338,9 +1338,9 @@ async def list_ordered( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), @@ -1567,9 +1567,9 @@ async def update( raise BadRequestError( headers=dict(_response.headers), body=typing.cast( - types_api_error_ApiError, + typing.Optional[typing.Any], parse_obj_as( - type_=types_api_error_ApiError, # type: ignore + type_=typing.Optional[typing.Any], # type: ignore object_=_response.json(), ), ), From ab09c31bd8040f3f455e86807000169e5f054fbb Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 1 May 2026 10:43:39 -0400 Subject: [PATCH 03/10] chore: Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5e508c6c..0595e687 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "3.19.0" [tool.poetry] name = "zep-cloud" -version = "3.20.0" +version = "3.21.0" description = "" readme = "README.md" authors = [] From ef4ee07c30f995007fc56ec38c000ad7c070d15d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 14:47:40 +0000 Subject: [PATCH 04/10] SDK regeneration --- reference.md | 6 +- src/zep_cloud/__init__.py | 20 ++-- src/zep_cloud/batch/client.py | 68 ++++++------ src/zep_cloud/batch/raw_client.py | 100 +++++++++--------- src/zep_cloud/types/__init__.py | 20 ++-- .../types/apidata_batch_list_response.py | 4 +- ...ta_batch_add_item.py => batch_add_item.py} | 2 +- ...ch_item_detail.py => batch_item_detail.py} | 3 +- ...esponse.py => batch_item_list_response.py} | 6 +- ...ta_batch_progress.py => batch_progress.py} | 2 +- ...data_batch_summary.py => batch_summary.py} | 7 +- 11 files changed, 116 insertions(+), 122 deletions(-) rename src/zep_cloud/types/{apidata_batch_add_item.py => batch_add_item.py} (96%) rename src/zep_cloud/types/{apidata_batch_item_detail.py => batch_item_detail.py} (92%) rename src/zep_cloud/types/{apidata_batch_item_list_response.py => batch_item_list_response.py} (72%) rename src/zep_cloud/types/{apidata_batch_progress.py => batch_progress.py} (94%) rename src/zep_cloud/types/{apidata_batch_summary.py => batch_summary.py} (81%) diff --git a/reference.md b/reference.md index 246f0a08..7049b239 100644 --- a/reference.md +++ b/reference.md @@ -420,7 +420,7 @@ Add graph episodes and thread messages to a draft batch. Items are appended in r
```python -from zep_cloud import ApidataBatchAddItem, Zep +from zep_cloud import BatchAddItem, Zep client = Zep( api_key="YOUR_API_KEY", @@ -428,7 +428,7 @@ client = Zep( client.batch.add( batch_id="batchId", items=[ - ApidataBatchAddItem( + BatchAddItem( type="graph_episode", ) ], @@ -456,7 +456,7 @@ client.batch.add(
-**items:** `typing.Sequence[ApidataBatchAddItem]` +**items:** `typing.Sequence[BatchAddItem]`
diff --git a/src/zep_cloud/__init__.py b/src/zep_cloud/__init__.py index b3383f05..789cf9ea 100644 --- a/src/zep_cloud/__init__.py +++ b/src/zep_cloud/__init__.py @@ -7,14 +7,14 @@ AddThreadMessagesResponse, AddTripleResponse, ApiError, - ApidataBatchAddItem, ApidataBatchAddItemRole, ApidataBatchAddItemType, - ApidataBatchItemDetail, - ApidataBatchItemListResponse, ApidataBatchListResponse, - ApidataBatchProgress, - ApidataBatchSummary, + BatchAddItem, + BatchItemDetail, + BatchItemListResponse, + BatchProgress, + BatchSummary, CloneGraphResponse, ClusterDetectConfig, CoOccurrenceDetectConfig, @@ -95,16 +95,16 @@ "AddThreadMessagesResponse", "AddTripleResponse", "ApiError", - "ApidataBatchAddItem", "ApidataBatchAddItemRole", "ApidataBatchAddItemType", - "ApidataBatchItemDetail", - "ApidataBatchItemListResponse", "ApidataBatchListResponse", - "ApidataBatchProgress", - "ApidataBatchSummary", "AsyncZep", "BadRequestError", + "BatchAddItem", + "BatchItemDetail", + "BatchItemListResponse", + "BatchProgress", + "BatchSummary", "CloneGraphResponse", "ClusterDetectConfig", "CoOccurrenceDetectConfig", diff --git a/src/zep_cloud/batch/client.py b/src/zep_cloud/batch/client.py index dee64d2b..7c2b6cfb 100644 --- a/src/zep_cloud/batch/client.py +++ b/src/zep_cloud/batch/client.py @@ -4,11 +4,11 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions -from ..types.apidata_batch_add_item import ApidataBatchAddItem -from ..types.apidata_batch_item_detail import ApidataBatchItemDetail -from ..types.apidata_batch_item_list_response import ApidataBatchItemListResponse from ..types.apidata_batch_list_response import ApidataBatchListResponse -from ..types.apidata_batch_summary import ApidataBatchSummary +from ..types.batch_add_item import BatchAddItem +from ..types.batch_item_detail import BatchItemDetail +from ..types.batch_item_list_response import BatchItemListResponse +from ..types.batch_summary import BatchSummary from ..types.success_response import SuccessResponse from .raw_client import AsyncRawBatchClient, RawBatchClient @@ -82,7 +82,7 @@ def create( *, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ApidataBatchSummary: + ) -> BatchSummary: """ Create a draft batch that can be filled with graph episodes and thread messages. @@ -95,7 +95,7 @@ def create( Returns ------- - ApidataBatchSummary + BatchSummary Created batch Examples @@ -110,7 +110,7 @@ def create( _response = self._raw_client.create(metadata=metadata, request_options=request_options) return _response.data - def get(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ApidataBatchSummary: + def get(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BatchSummary: """ Get a batch summary, including runtime progress when the batch has been processed. @@ -124,7 +124,7 @@ def get(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] Returns ------- - ApidataBatchSummary + BatchSummary Batch summary Examples @@ -180,7 +180,7 @@ def list_items( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> ApidataBatchItemListResponse: + ) -> BatchItemListResponse: """ List items in a batch, including derived runtime status when the batch has been processed. @@ -203,7 +203,7 @@ def list_items( Returns ------- - ApidataBatchItemListResponse + BatchItemListResponse Batch item list Examples @@ -229,9 +229,9 @@ def add( self, batch_id: str, *, - items: typing.Sequence[ApidataBatchAddItem], + items: typing.Sequence[BatchAddItem], request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[ApidataBatchItemDetail]: + ) -> typing.List[BatchItemDetail]: """ Add graph episodes and thread messages to a draft batch. Items are appended in request order. @@ -240,19 +240,19 @@ def add( batch_id : str The batch ID. - items : typing.Sequence[ApidataBatchAddItem] + items : typing.Sequence[BatchAddItem] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.List[ApidataBatchItemDetail] + typing.List[BatchItemDetail] Added batch items Examples -------- - from zep_cloud import ApidataBatchAddItem, Zep + from zep_cloud import BatchAddItem, Zep client = Zep( api_key="YOUR_API_KEY", @@ -260,7 +260,7 @@ def add( client.batch.add( batch_id="batchId", items=[ - ApidataBatchAddItem( + BatchAddItem( type="graph_episode", ) ], @@ -269,7 +269,7 @@ def add( _response = self._raw_client.add(batch_id, items=items, request_options=request_options) return _response.data - def process(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ApidataBatchSummary: + def process(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BatchSummary: """ Start processing a filled batch. Repeated calls return the existing batch run. @@ -283,7 +283,7 @@ def process(self, batch_id: str, *, request_options: typing.Optional[RequestOpti Returns ------- - ApidataBatchSummary + BatchSummary Batch processing state Examples @@ -377,7 +377,7 @@ async def create( *, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> ApidataBatchSummary: + ) -> BatchSummary: """ Create a draft batch that can be filled with graph episodes and thread messages. @@ -390,7 +390,7 @@ async def create( Returns ------- - ApidataBatchSummary + BatchSummary Created batch Examples @@ -413,9 +413,7 @@ async def main() -> None: _response = await self._raw_client.create(metadata=metadata, request_options=request_options) return _response.data - async def get( - self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> ApidataBatchSummary: + async def get(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BatchSummary: """ Get a batch summary, including runtime progress when the batch has been processed. @@ -429,7 +427,7 @@ async def get( Returns ------- - ApidataBatchSummary + BatchSummary Batch summary Examples @@ -503,7 +501,7 @@ async def list_items( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> ApidataBatchItemListResponse: + ) -> BatchItemListResponse: """ List items in a batch, including derived runtime status when the batch has been processed. @@ -526,7 +524,7 @@ async def list_items( Returns ------- - ApidataBatchItemListResponse + BatchItemListResponse Batch item list Examples @@ -560,9 +558,9 @@ async def add( self, batch_id: str, *, - items: typing.Sequence[ApidataBatchAddItem], + items: typing.Sequence[BatchAddItem], request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[ApidataBatchItemDetail]: + ) -> typing.List[BatchItemDetail]: """ Add graph episodes and thread messages to a draft batch. Items are appended in request order. @@ -571,21 +569,21 @@ async def add( batch_id : str The batch ID. - items : typing.Sequence[ApidataBatchAddItem] + items : typing.Sequence[BatchAddItem] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - typing.List[ApidataBatchItemDetail] + typing.List[BatchItemDetail] Added batch items Examples -------- import asyncio - from zep_cloud import ApidataBatchAddItem, AsyncZep + from zep_cloud import AsyncZep, BatchAddItem client = AsyncZep( api_key="YOUR_API_KEY", @@ -596,7 +594,7 @@ async def main() -> None: await client.batch.add( batch_id="batchId", items=[ - ApidataBatchAddItem( + BatchAddItem( type="graph_episode", ) ], @@ -608,9 +606,7 @@ async def main() -> None: _response = await self._raw_client.add(batch_id, items=items, request_options=request_options) return _response.data - async def process( - self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> ApidataBatchSummary: + async def process(self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> BatchSummary: """ Start processing a filled batch. Repeated calls return the existing batch run. @@ -624,7 +620,7 @@ async def process( Returns ------- - ApidataBatchSummary + BatchSummary Batch processing state Examples diff --git a/src/zep_cloud/batch/raw_client.py b/src/zep_cloud/batch/raw_client.py index e4bdbd27..4f8181d5 100644 --- a/src/zep_cloud/batch/raw_client.py +++ b/src/zep_cloud/batch/raw_client.py @@ -15,11 +15,11 @@ from ..errors.internal_server_error import InternalServerError from ..errors.not_found_error import NotFoundError from ..types.api_error import ApiError as types_api_error_ApiError -from ..types.apidata_batch_add_item import ApidataBatchAddItem -from ..types.apidata_batch_item_detail import ApidataBatchItemDetail -from ..types.apidata_batch_item_list_response import ApidataBatchItemListResponse from ..types.apidata_batch_list_response import ApidataBatchListResponse -from ..types.apidata_batch_summary import ApidataBatchSummary +from ..types.batch_add_item import BatchAddItem +from ..types.batch_item_detail import BatchItemDetail +from ..types.batch_item_list_response import BatchItemListResponse +from ..types.batch_summary import BatchSummary from ..types.success_response import SuccessResponse # this is used as the default value for optional parameters @@ -116,7 +116,7 @@ def create( *, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ApidataBatchSummary]: + ) -> HttpResponse[BatchSummary]: """ Create a draft batch that can be filled with graph episodes and thread messages. @@ -129,7 +129,7 @@ def create( Returns ------- - HttpResponse[ApidataBatchSummary] + HttpResponse[BatchSummary] Created batch """ _response = self._client_wrapper.httpx_client.request( @@ -147,9 +147,9 @@ def create( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchSummary, + BatchSummary, parse_obj_as( - type_=ApidataBatchSummary, # type: ignore + type_=BatchSummary, # type: ignore object_=_response.json(), ), ) @@ -187,7 +187,7 @@ def create( def get( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[ApidataBatchSummary]: + ) -> HttpResponse[BatchSummary]: """ Get a batch summary, including runtime progress when the batch has been processed. @@ -201,7 +201,7 @@ def get( Returns ------- - HttpResponse[ApidataBatchSummary] + HttpResponse[BatchSummary] Batch summary """ _response = self._client_wrapper.httpx_client.request( @@ -212,9 +212,9 @@ def get( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchSummary, + BatchSummary, parse_obj_as( - type_=ApidataBatchSummary, # type: ignore + type_=BatchSummary, # type: ignore object_=_response.json(), ), ) @@ -356,7 +356,7 @@ def list_items( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ApidataBatchItemListResponse]: + ) -> HttpResponse[BatchItemListResponse]: """ List items in a batch, including derived runtime status when the batch has been processed. @@ -379,7 +379,7 @@ def list_items( Returns ------- - HttpResponse[ApidataBatchItemListResponse] + HttpResponse[BatchItemListResponse] Batch item list """ _response = self._client_wrapper.httpx_client.request( @@ -395,9 +395,9 @@ def list_items( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchItemListResponse, + BatchItemListResponse, parse_obj_as( - type_=ApidataBatchItemListResponse, # type: ignore + type_=BatchItemListResponse, # type: ignore object_=_response.json(), ), ) @@ -448,9 +448,9 @@ def add( self, batch_id: str, *, - items: typing.Sequence[ApidataBatchAddItem], + items: typing.Sequence[BatchAddItem], request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[typing.List[ApidataBatchItemDetail]]: + ) -> HttpResponse[typing.List[BatchItemDetail]]: """ Add graph episodes and thread messages to a draft batch. Items are appended in request order. @@ -459,14 +459,14 @@ def add( batch_id : str The batch ID. - items : typing.Sequence[ApidataBatchAddItem] + items : typing.Sequence[BatchAddItem] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[typing.List[ApidataBatchItemDetail]] + HttpResponse[typing.List[BatchItemDetail]] Added batch items """ _response = self._client_wrapper.httpx_client.request( @@ -474,7 +474,7 @@ def add( method="POST", json={ "items": convert_and_respect_annotation_metadata( - object_=items, annotation=typing.Sequence[ApidataBatchAddItem], direction="write" + object_=items, annotation=typing.Sequence[BatchAddItem], direction="write" ), }, headers={ @@ -486,9 +486,9 @@ def add( try: if 200 <= _response.status_code < 300: _data = typing.cast( - typing.List[ApidataBatchItemDetail], + typing.List[BatchItemDetail], parse_obj_as( - type_=typing.List[ApidataBatchItemDetail], # type: ignore + type_=typing.List[BatchItemDetail], # type: ignore object_=_response.json(), ), ) @@ -548,7 +548,7 @@ def add( def process( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[ApidataBatchSummary]: + ) -> HttpResponse[BatchSummary]: """ Start processing a filled batch. Repeated calls return the existing batch run. @@ -562,7 +562,7 @@ def process( Returns ------- - HttpResponse[ApidataBatchSummary] + HttpResponse[BatchSummary] Batch processing state """ _response = self._client_wrapper.httpx_client.request( @@ -573,9 +573,9 @@ def process( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchSummary, + BatchSummary, parse_obj_as( - type_=ApidataBatchSummary, # type: ignore + type_=BatchSummary, # type: ignore object_=_response.json(), ), ) @@ -724,7 +724,7 @@ async def create( *, metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ApidataBatchSummary]: + ) -> AsyncHttpResponse[BatchSummary]: """ Create a draft batch that can be filled with graph episodes and thread messages. @@ -737,7 +737,7 @@ async def create( Returns ------- - AsyncHttpResponse[ApidataBatchSummary] + AsyncHttpResponse[BatchSummary] Created batch """ _response = await self._client_wrapper.httpx_client.request( @@ -755,9 +755,9 @@ async def create( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchSummary, + BatchSummary, parse_obj_as( - type_=ApidataBatchSummary, # type: ignore + type_=BatchSummary, # type: ignore object_=_response.json(), ), ) @@ -795,7 +795,7 @@ async def create( async def get( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[ApidataBatchSummary]: + ) -> AsyncHttpResponse[BatchSummary]: """ Get a batch summary, including runtime progress when the batch has been processed. @@ -809,7 +809,7 @@ async def get( Returns ------- - AsyncHttpResponse[ApidataBatchSummary] + AsyncHttpResponse[BatchSummary] Batch summary """ _response = await self._client_wrapper.httpx_client.request( @@ -820,9 +820,9 @@ async def get( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchSummary, + BatchSummary, parse_obj_as( - type_=ApidataBatchSummary, # type: ignore + type_=BatchSummary, # type: ignore object_=_response.json(), ), ) @@ -964,7 +964,7 @@ async def list_items( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ApidataBatchItemListResponse]: + ) -> AsyncHttpResponse[BatchItemListResponse]: """ List items in a batch, including derived runtime status when the batch has been processed. @@ -987,7 +987,7 @@ async def list_items( Returns ------- - AsyncHttpResponse[ApidataBatchItemListResponse] + AsyncHttpResponse[BatchItemListResponse] Batch item list """ _response = await self._client_wrapper.httpx_client.request( @@ -1003,9 +1003,9 @@ async def list_items( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchItemListResponse, + BatchItemListResponse, parse_obj_as( - type_=ApidataBatchItemListResponse, # type: ignore + type_=BatchItemListResponse, # type: ignore object_=_response.json(), ), ) @@ -1056,9 +1056,9 @@ async def add( self, batch_id: str, *, - items: typing.Sequence[ApidataBatchAddItem], + items: typing.Sequence[BatchAddItem], request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[typing.List[ApidataBatchItemDetail]]: + ) -> AsyncHttpResponse[typing.List[BatchItemDetail]]: """ Add graph episodes and thread messages to a draft batch. Items are appended in request order. @@ -1067,14 +1067,14 @@ async def add( batch_id : str The batch ID. - items : typing.Sequence[ApidataBatchAddItem] + items : typing.Sequence[BatchAddItem] request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[typing.List[ApidataBatchItemDetail]] + AsyncHttpResponse[typing.List[BatchItemDetail]] Added batch items """ _response = await self._client_wrapper.httpx_client.request( @@ -1082,7 +1082,7 @@ async def add( method="POST", json={ "items": convert_and_respect_annotation_metadata( - object_=items, annotation=typing.Sequence[ApidataBatchAddItem], direction="write" + object_=items, annotation=typing.Sequence[BatchAddItem], direction="write" ), }, headers={ @@ -1094,9 +1094,9 @@ async def add( try: if 200 <= _response.status_code < 300: _data = typing.cast( - typing.List[ApidataBatchItemDetail], + typing.List[BatchItemDetail], parse_obj_as( - type_=typing.List[ApidataBatchItemDetail], # type: ignore + type_=typing.List[BatchItemDetail], # type: ignore object_=_response.json(), ), ) @@ -1156,7 +1156,7 @@ async def add( async def process( self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[ApidataBatchSummary]: + ) -> AsyncHttpResponse[BatchSummary]: """ Start processing a filled batch. Repeated calls return the existing batch run. @@ -1170,7 +1170,7 @@ async def process( Returns ------- - AsyncHttpResponse[ApidataBatchSummary] + AsyncHttpResponse[BatchSummary] Batch processing state """ _response = await self._client_wrapper.httpx_client.request( @@ -1181,9 +1181,9 @@ async def process( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchSummary, + BatchSummary, parse_obj_as( - type_=ApidataBatchSummary, # type: ignore + type_=BatchSummary, # type: ignore object_=_response.json(), ), ) diff --git a/src/zep_cloud/types/__init__.py b/src/zep_cloud/types/__init__.py index 77c31ed4..baeda0cd 100644 --- a/src/zep_cloud/types/__init__.py +++ b/src/zep_cloud/types/__init__.py @@ -6,14 +6,14 @@ from .add_thread_messages_response import AddThreadMessagesResponse from .add_triple_response import AddTripleResponse from .api_error import ApiError -from .apidata_batch_add_item import ApidataBatchAddItem from .apidata_batch_add_item_role import ApidataBatchAddItemRole from .apidata_batch_add_item_type import ApidataBatchAddItemType -from .apidata_batch_item_detail import ApidataBatchItemDetail -from .apidata_batch_item_list_response import ApidataBatchItemListResponse from .apidata_batch_list_response import ApidataBatchListResponse -from .apidata_batch_progress import ApidataBatchProgress -from .apidata_batch_summary import ApidataBatchSummary +from .batch_add_item import BatchAddItem +from .batch_item_detail import BatchItemDetail +from .batch_item_list_response import BatchItemListResponse +from .batch_progress import BatchProgress +from .batch_summary import BatchSummary from .clone_graph_response import CloneGraphResponse from .cluster_detect_config import ClusterDetectConfig from .co_occurrence_detect_config import CoOccurrenceDetectConfig @@ -88,14 +88,14 @@ "AddThreadMessagesResponse", "AddTripleResponse", "ApiError", - "ApidataBatchAddItem", "ApidataBatchAddItemRole", "ApidataBatchAddItemType", - "ApidataBatchItemDetail", - "ApidataBatchItemListResponse", "ApidataBatchListResponse", - "ApidataBatchProgress", - "ApidataBatchSummary", + "BatchAddItem", + "BatchItemDetail", + "BatchItemListResponse", + "BatchProgress", + "BatchSummary", "CloneGraphResponse", "ClusterDetectConfig", "CoOccurrenceDetectConfig", diff --git a/src/zep_cloud/types/apidata_batch_list_response.py b/src/zep_cloud/types/apidata_batch_list_response.py index 91ec2243..876cfad8 100644 --- a/src/zep_cloud/types/apidata_batch_list_response.py +++ b/src/zep_cloud/types/apidata_batch_list_response.py @@ -4,11 +4,11 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .apidata_batch_summary import ApidataBatchSummary +from .batch_summary import BatchSummary class ApidataBatchListResponse(UniversalBaseModel): - batches: typing.Optional[typing.List[ApidataBatchSummary]] = None + batches: typing.Optional[typing.List[BatchSummary]] = None next_cursor: typing.Optional[int] = None if IS_PYDANTIC_V2: diff --git a/src/zep_cloud/types/apidata_batch_add_item.py b/src/zep_cloud/types/batch_add_item.py similarity index 96% rename from src/zep_cloud/types/apidata_batch_add_item.py rename to src/zep_cloud/types/batch_add_item.py index 3a139c9f..a95cb4ab 100644 --- a/src/zep_cloud/types/apidata_batch_add_item.py +++ b/src/zep_cloud/types/batch_add_item.py @@ -9,7 +9,7 @@ from .graph_data_type import GraphDataType -class ApidataBatchAddItem(UniversalBaseModel): +class BatchAddItem(UniversalBaseModel): content: typing.Optional[str] = None created_at: typing.Optional[str] = None data: typing.Optional[str] = None diff --git a/src/zep_cloud/types/apidata_batch_item_detail.py b/src/zep_cloud/types/batch_item_detail.py similarity index 92% rename from src/zep_cloud/types/apidata_batch_item_detail.py rename to src/zep_cloud/types/batch_item_detail.py index a9b86a6a..ea8e3dc8 100644 --- a/src/zep_cloud/types/apidata_batch_item_detail.py +++ b/src/zep_cloud/types/batch_item_detail.py @@ -8,7 +8,7 @@ from .models_batch_item_status import ModelsBatchItemStatus -class ApidataBatchItemDetail(UniversalBaseModel): +class BatchItemDetail(UniversalBaseModel): created_at: typing.Optional[str] = None episode_uuid: typing.Optional[str] = None error: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None @@ -17,7 +17,6 @@ class ApidataBatchItemDetail(UniversalBaseModel): kind: typing.Optional[ModelsBatchItemKind] = None sequence_index: typing.Optional[int] = None source_uuid: typing.Optional[str] = None - stage: typing.Optional[str] = None status: typing.Optional[ModelsBatchItemStatus] = None thread_id: typing.Optional[str] = None updated_at: typing.Optional[str] = None diff --git a/src/zep_cloud/types/apidata_batch_item_list_response.py b/src/zep_cloud/types/batch_item_list_response.py similarity index 72% rename from src/zep_cloud/types/apidata_batch_item_list_response.py rename to src/zep_cloud/types/batch_item_list_response.py index 61ff6cc9..b082dcea 100644 --- a/src/zep_cloud/types/apidata_batch_item_list_response.py +++ b/src/zep_cloud/types/batch_item_list_response.py @@ -4,11 +4,11 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .apidata_batch_item_detail import ApidataBatchItemDetail +from .batch_item_detail import BatchItemDetail -class ApidataBatchItemListResponse(UniversalBaseModel): - items: typing.Optional[typing.List[ApidataBatchItemDetail]] = None +class BatchItemListResponse(UniversalBaseModel): + items: typing.Optional[typing.List[BatchItemDetail]] = None next_cursor: typing.Optional[int] = None if IS_PYDANTIC_V2: diff --git a/src/zep_cloud/types/apidata_batch_progress.py b/src/zep_cloud/types/batch_progress.py similarity index 94% rename from src/zep_cloud/types/apidata_batch_progress.py rename to src/zep_cloud/types/batch_progress.py index 7f92a910..477331e2 100644 --- a/src/zep_cloud/types/apidata_batch_progress.py +++ b/src/zep_cloud/types/batch_progress.py @@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -class ApidataBatchProgress(UniversalBaseModel): +class BatchProgress(UniversalBaseModel): failed_items: typing.Optional[int] = None percent_complete: typing.Optional[float] = None processing_items: typing.Optional[int] = None diff --git a/src/zep_cloud/types/apidata_batch_summary.py b/src/zep_cloud/types/batch_summary.py similarity index 81% rename from src/zep_cloud/types/apidata_batch_summary.py rename to src/zep_cloud/types/batch_summary.py index 9dba7180..e500a5b4 100644 --- a/src/zep_cloud/types/apidata_batch_summary.py +++ b/src/zep_cloud/types/batch_summary.py @@ -4,19 +4,18 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .apidata_batch_progress import ApidataBatchProgress +from .batch_progress import BatchProgress from .models_batch_status import ModelsBatchStatus -class ApidataBatchSummary(UniversalBaseModel): +class BatchSummary(UniversalBaseModel): batch_id: typing.Optional[str] = None completed_at: typing.Optional[str] = None created_at: typing.Optional[str] = None - current_stage: typing.Optional[str] = None item_count: typing.Optional[int] = None metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None processed_at: typing.Optional[str] = None - progress: typing.Optional[ApidataBatchProgress] = None + progress: typing.Optional[BatchProgress] = None status: typing.Optional[ModelsBatchStatus] = None updated_at: typing.Optional[str] = None From 2f45c2f6628bde7af127284d2a3024b89c2f496e Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 15:55:01 +0000 Subject: [PATCH 05/10] SDK regeneration --- reference.md | 14 +- src/zep_cloud/__init__.py | 4 +- src/zep_cloud/batch/client.py | 10 +- src/zep_cloud/batch/raw_client.py | 173 +++++++++++++++++- src/zep_cloud/graph/client.py | 16 +- src/zep_cloud/graph/raw_client.py | 16 +- src/zep_cloud/types/__init__.py | 4 +- ...ist_response.py => batch_list_response.py} | 2 +- 8 files changed, 209 insertions(+), 30 deletions(-) rename src/zep_cloud/types/{apidata_batch_list_response.py => batch_list_response.py} (92%) diff --git a/reference.md b/reference.md index 7049b239..ddd0baa3 100644 --- a/reference.md +++ b/reference.md @@ -2322,7 +2322,7 @@ client.graph.search(
-**max_characters:** `typing.Optional[int]` — Maximum total characters across all selected results when scope=auto. Defaults to 2000. Limited to 50000. +**max_characters:** `typing.Optional[int]` — Maximum total characters across all selected results when scope=auto. Defaults to 2500. Limited to 50000.
@@ -2338,7 +2338,11 @@ client.graph.search(
-**reranker:** `typing.Optional[Reranker]` — Defaults to RRF +**reranker:** `typing.Optional[Reranker]` + +Defaults to RRF. When scope=auto, this only affects graph-service retrieval +shape for graph facts, observations, and thread summaries; source-episode +retrieval uses RRF, and auto search applies its own internal rerank after retrieval.
@@ -2346,7 +2350,11 @@ client.graph.search(
-**return_raw_results:** `typing.Optional[bool]` — When scope=auto, include the selected raw graph results alongside the materialized context block. +**return_raw_results:** `typing.Optional[bool]` + +When scope=auto, include the selected raw graph results alongside the materialized context block. +For graph-service-backed auto mode, selected raw results may include episodes, +edges, nodes, observations, and thread_summaries.
diff --git a/src/zep_cloud/__init__.py b/src/zep_cloud/__init__.py index 789cf9ea..ca467623 100644 --- a/src/zep_cloud/__init__.py +++ b/src/zep_cloud/__init__.py @@ -9,10 +9,10 @@ ApiError, ApidataBatchAddItemRole, ApidataBatchAddItemType, - ApidataBatchListResponse, BatchAddItem, BatchItemDetail, BatchItemListResponse, + BatchListResponse, BatchProgress, BatchSummary, CloneGraphResponse, @@ -97,12 +97,12 @@ "ApiError", "ApidataBatchAddItemRole", "ApidataBatchAddItemType", - "ApidataBatchListResponse", "AsyncZep", "BadRequestError", "BatchAddItem", "BatchItemDetail", "BatchItemListResponse", + "BatchListResponse", "BatchProgress", "BatchSummary", "CloneGraphResponse", diff --git a/src/zep_cloud/batch/client.py b/src/zep_cloud/batch/client.py index 7c2b6cfb..6a810052 100644 --- a/src/zep_cloud/batch/client.py +++ b/src/zep_cloud/batch/client.py @@ -4,10 +4,10 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions -from ..types.apidata_batch_list_response import ApidataBatchListResponse from ..types.batch_add_item import BatchAddItem from ..types.batch_item_detail import BatchItemDetail from ..types.batch_item_list_response import BatchItemListResponse +from ..types.batch_list_response import BatchListResponse from ..types.batch_summary import BatchSummary from ..types.success_response import SuccessResponse from .raw_client import AsyncRawBatchClient, RawBatchClient @@ -38,7 +38,7 @@ def list( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> ApidataBatchListResponse: + ) -> BatchListResponse: """ List batches for the current project, optionally filtered by batch status. @@ -58,7 +58,7 @@ def list( Returns ------- - ApidataBatchListResponse + BatchListResponse Batch list Examples @@ -323,7 +323,7 @@ async def list( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> ApidataBatchListResponse: + ) -> BatchListResponse: """ List batches for the current project, optionally filtered by batch status. @@ -343,7 +343,7 @@ async def list( Returns ------- - ApidataBatchListResponse + BatchListResponse Batch list Examples diff --git a/src/zep_cloud/batch/raw_client.py b/src/zep_cloud/batch/raw_client.py index 4f8181d5..e13a90df 100644 --- a/src/zep_cloud/batch/raw_client.py +++ b/src/zep_cloud/batch/raw_client.py @@ -12,13 +12,14 @@ from ..core.serialization import convert_and_respect_annotation_metadata from ..errors.bad_request_error import BadRequestError from ..errors.conflict_error import ConflictError +from ..errors.forbidden_error import ForbiddenError from ..errors.internal_server_error import InternalServerError from ..errors.not_found_error import NotFoundError from ..types.api_error import ApiError as types_api_error_ApiError -from ..types.apidata_batch_list_response import ApidataBatchListResponse from ..types.batch_add_item import BatchAddItem from ..types.batch_item_detail import BatchItemDetail from ..types.batch_item_list_response import BatchItemListResponse +from ..types.batch_list_response import BatchListResponse from ..types.batch_summary import BatchSummary from ..types.success_response import SuccessResponse @@ -37,7 +38,7 @@ def list( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[ApidataBatchListResponse]: + ) -> HttpResponse[BatchListResponse]: """ List batches for the current project, optionally filtered by batch status. @@ -57,7 +58,7 @@ def list( Returns ------- - HttpResponse[ApidataBatchListResponse] + HttpResponse[BatchListResponse] Batch list """ _response = self._client_wrapper.httpx_client.request( @@ -73,9 +74,9 @@ def list( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchListResponse, + BatchListResponse, parse_obj_as( - type_=ApidataBatchListResponse, # type: ignore + type_=BatchListResponse, # type: ignore object_=_response.json(), ), ) @@ -91,6 +92,17 @@ def list( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 500: raise InternalServerError( headers=dict(_response.headers), @@ -165,6 +177,17 @@ def create( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 500: raise InternalServerError( headers=dict(_response.headers), @@ -230,6 +253,17 @@ def get( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -306,6 +340,17 @@ def delete( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -413,6 +458,17 @@ def list_items( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -504,6 +560,17 @@ def add( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -591,6 +658,17 @@ def process( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -645,7 +723,7 @@ async def list( cursor: typing.Optional[int] = None, status: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[ApidataBatchListResponse]: + ) -> AsyncHttpResponse[BatchListResponse]: """ List batches for the current project, optionally filtered by batch status. @@ -665,7 +743,7 @@ async def list( Returns ------- - AsyncHttpResponse[ApidataBatchListResponse] + AsyncHttpResponse[BatchListResponse] Batch list """ _response = await self._client_wrapper.httpx_client.request( @@ -681,9 +759,9 @@ async def list( try: if 200 <= _response.status_code < 300: _data = typing.cast( - ApidataBatchListResponse, + BatchListResponse, parse_obj_as( - type_=ApidataBatchListResponse, # type: ignore + type_=BatchListResponse, # type: ignore object_=_response.json(), ), ) @@ -699,6 +777,17 @@ async def list( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 500: raise InternalServerError( headers=dict(_response.headers), @@ -773,6 +862,17 @@ async def create( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 500: raise InternalServerError( headers=dict(_response.headers), @@ -838,6 +938,17 @@ async def get( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -914,6 +1025,17 @@ async def delete( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -1021,6 +1143,17 @@ async def list_items( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -1112,6 +1245,17 @@ async def add( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), @@ -1199,6 +1343,17 @@ async def process( ), ), ) + if _response.status_code == 403: + raise ForbiddenError( + headers=dict(_response.headers), + body=typing.cast( + types_api_error_ApiError, + parse_obj_as( + type_=types_api_error_ApiError, # type: ignore + object_=_response.json(), + ), + ), + ) if _response.status_code == 404: raise NotFoundError( headers=dict(_response.headers), diff --git a/src/zep_cloud/graph/client.py b/src/zep_cloud/graph/client.py index 3a169c45..6c7c25d5 100644 --- a/src/zep_cloud/graph/client.py +++ b/src/zep_cloud/graph/client.py @@ -838,16 +838,20 @@ def search( The maximum number of facts to retrieve. Defaults to 10. Limited to 50. max_characters : typing.Optional[int] - Maximum total characters across all selected results when scope=auto. Defaults to 2000. Limited to 50000. + Maximum total characters across all selected results when scope=auto. Defaults to 2500. Limited to 50000. mmr_lambda : typing.Optional[float] weighting for maximal marginal relevance reranker : typing.Optional[Reranker] - Defaults to RRF + Defaults to RRF. When scope=auto, this only affects graph-service retrieval + shape for graph facts, observations, and thread summaries; source-episode + retrieval uses RRF, and auto search applies its own internal rerank after retrieval. return_raw_results : typing.Optional[bool] When scope=auto, include the selected raw graph results alongside the materialized context block. + For graph-service-backed auto mode, selected raw results may include episodes, + edges, nodes, observations, and thread_summaries. scope : typing.Optional[GraphSearchScope] Defaults to Edges. @@ -1899,16 +1903,20 @@ async def search( The maximum number of facts to retrieve. Defaults to 10. Limited to 50. max_characters : typing.Optional[int] - Maximum total characters across all selected results when scope=auto. Defaults to 2000. Limited to 50000. + Maximum total characters across all selected results when scope=auto. Defaults to 2500. Limited to 50000. mmr_lambda : typing.Optional[float] weighting for maximal marginal relevance reranker : typing.Optional[Reranker] - Defaults to RRF + Defaults to RRF. When scope=auto, this only affects graph-service retrieval + shape for graph facts, observations, and thread summaries; source-episode + retrieval uses RRF, and auto search applies its own internal rerank after retrieval. return_raw_results : typing.Optional[bool] When scope=auto, include the selected raw graph results alongside the materialized context block. + For graph-service-backed auto mode, selected raw results may include episodes, + edges, nodes, observations, and thread_summaries. scope : typing.Optional[GraphSearchScope] Defaults to Edges. diff --git a/src/zep_cloud/graph/raw_client.py b/src/zep_cloud/graph/raw_client.py index 40c81f34..7dc1f0f6 100644 --- a/src/zep_cloud/graph/raw_client.py +++ b/src/zep_cloud/graph/raw_client.py @@ -1340,16 +1340,20 @@ def search( The maximum number of facts to retrieve. Defaults to 10. Limited to 50. max_characters : typing.Optional[int] - Maximum total characters across all selected results when scope=auto. Defaults to 2000. Limited to 50000. + Maximum total characters across all selected results when scope=auto. Defaults to 2500. Limited to 50000. mmr_lambda : typing.Optional[float] weighting for maximal marginal relevance reranker : typing.Optional[Reranker] - Defaults to RRF + Defaults to RRF. When scope=auto, this only affects graph-service retrieval + shape for graph facts, observations, and thread summaries; source-episode + retrieval uses RRF, and auto search applies its own internal rerank after retrieval. return_raw_results : typing.Optional[bool] When scope=auto, include the selected raw graph results alongside the materialized context block. + For graph-service-backed auto mode, selected raw results may include episodes, + edges, nodes, observations, and thread_summaries. scope : typing.Optional[GraphSearchScope] Defaults to Edges. @@ -2966,16 +2970,20 @@ async def search( The maximum number of facts to retrieve. Defaults to 10. Limited to 50. max_characters : typing.Optional[int] - Maximum total characters across all selected results when scope=auto. Defaults to 2000. Limited to 50000. + Maximum total characters across all selected results when scope=auto. Defaults to 2500. Limited to 50000. mmr_lambda : typing.Optional[float] weighting for maximal marginal relevance reranker : typing.Optional[Reranker] - Defaults to RRF + Defaults to RRF. When scope=auto, this only affects graph-service retrieval + shape for graph facts, observations, and thread summaries; source-episode + retrieval uses RRF, and auto search applies its own internal rerank after retrieval. return_raw_results : typing.Optional[bool] When scope=auto, include the selected raw graph results alongside the materialized context block. + For graph-service-backed auto mode, selected raw results may include episodes, + edges, nodes, observations, and thread_summaries. scope : typing.Optional[GraphSearchScope] Defaults to Edges. diff --git a/src/zep_cloud/types/__init__.py b/src/zep_cloud/types/__init__.py index baeda0cd..c2334e34 100644 --- a/src/zep_cloud/types/__init__.py +++ b/src/zep_cloud/types/__init__.py @@ -8,10 +8,10 @@ from .api_error import ApiError from .apidata_batch_add_item_role import ApidataBatchAddItemRole from .apidata_batch_add_item_type import ApidataBatchAddItemType -from .apidata_batch_list_response import ApidataBatchListResponse from .batch_add_item import BatchAddItem from .batch_item_detail import BatchItemDetail from .batch_item_list_response import BatchItemListResponse +from .batch_list_response import BatchListResponse from .batch_progress import BatchProgress from .batch_summary import BatchSummary from .clone_graph_response import CloneGraphResponse @@ -90,10 +90,10 @@ "ApiError", "ApidataBatchAddItemRole", "ApidataBatchAddItemType", - "ApidataBatchListResponse", "BatchAddItem", "BatchItemDetail", "BatchItemListResponse", + "BatchListResponse", "BatchProgress", "BatchSummary", "CloneGraphResponse", diff --git a/src/zep_cloud/types/apidata_batch_list_response.py b/src/zep_cloud/types/batch_list_response.py similarity index 92% rename from src/zep_cloud/types/apidata_batch_list_response.py rename to src/zep_cloud/types/batch_list_response.py index 876cfad8..0400a33f 100644 --- a/src/zep_cloud/types/apidata_batch_list_response.py +++ b/src/zep_cloud/types/batch_list_response.py @@ -7,7 +7,7 @@ from .batch_summary import BatchSummary -class ApidataBatchListResponse(UniversalBaseModel): +class BatchListResponse(UniversalBaseModel): batches: typing.Optional[typing.List[BatchSummary]] = None next_cursor: typing.Optional[int] = None From cf142c7b9ada98edec7a2ec1d8194c02edd9ac35 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 1 May 2026 16:22:06 -0400 Subject: [PATCH 06/10] chore: Bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0595e687..c0b760b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "zep-cloud" -version = "3.19.0" +version = "3.21.0" [tool.poetry] name = "zep-cloud" From 0ce738e4830ba351efbb785d8fe8826782e5cd02 Mon Sep 17 00:00:00 2001 From: paulpaliychuk Date: Fri, 1 May 2026 16:23:19 -0400 Subject: [PATCH 07/10] chore: Bump version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0b760b8..346c47cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "zep-cloud" -version = "3.21.0" +version = "3.22.0" [tool.poetry] name = "zep-cloud" -version = "3.21.0" +version = "3.22.0" description = "" readme = "README.md" authors = [] From ad149aed1f52c86a9050242d81f5d33e5e0a5288 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 20:30:26 +0000 Subject: [PATCH 08/10] SDK regeneration --- src/zep_cloud/core/client_wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zep_cloud/core/client_wrapper.py b/src/zep_cloud/core/client_wrapper.py index b75a27ce..55159b5c 100644 --- a/src/zep_cloud/core/client_wrapper.py +++ b/src/zep_cloud/core/client_wrapper.py @@ -22,10 +22,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "zep-cloud/3.21.0", + "User-Agent": "zep-cloud/3.22.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "zep-cloud", - "X-Fern-SDK-Version": "3.21.0", + "X-Fern-SDK-Version": "3.22.0", **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Api-Key {self.api_key}" From bee973861e20dcbd0e73d6b2c438509264d15661 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 18:26:26 +0000 Subject: [PATCH 09/10] SDK regeneration From b07c278e4ff788308f9da1f0b41258e120cd8000 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 18:39:45 +0000 Subject: [PATCH 10/10] SDK regeneration --- src/zep_cloud/__init__.py | 12 ++++++------ src/zep_cloud/types/__init__.py | 12 ++++++------ src/zep_cloud/types/batch_item_detail.py | 8 ++++---- src/zep_cloud/types/batch_item_kind.py | 5 +++++ ...els_batch_item_status.py => batch_item_status.py} | 2 +- .../{models_batch_status.py => batch_status.py} | 2 +- src/zep_cloud/types/batch_summary.py | 4 ++-- src/zep_cloud/types/models_batch_item_kind.py | 5 ----- 8 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 src/zep_cloud/types/batch_item_kind.py rename src/zep_cloud/types/{models_batch_item_status.py => batch_item_status.py} (82%) rename src/zep_cloud/types/{models_batch_status.py => batch_status.py} (84%) delete mode 100644 src/zep_cloud/types/models_batch_item_kind.py diff --git a/src/zep_cloud/__init__.py b/src/zep_cloud/__init__.py index ca467623..81b1e881 100644 --- a/src/zep_cloud/__init__.py +++ b/src/zep_cloud/__init__.py @@ -11,9 +11,12 @@ ApidataBatchAddItemType, BatchAddItem, BatchItemDetail, + BatchItemKind, BatchItemListResponse, + BatchItemStatus, BatchListResponse, BatchProgress, + BatchStatus, BatchSummary, CloneGraphResponse, ClusterDetectConfig, @@ -57,9 +60,6 @@ Message, MessageListResponse, MetadataFilterGroup, - ModelsBatchItemKind, - ModelsBatchItemStatus, - ModelsBatchStatus, PathDetectConfig, PatternMetadata, PatternResult, @@ -101,9 +101,12 @@ "BadRequestError", "BatchAddItem", "BatchItemDetail", + "BatchItemKind", "BatchItemListResponse", + "BatchItemStatus", "BatchListResponse", "BatchProgress", + "BatchStatus", "BatchSummary", "CloneGraphResponse", "ClusterDetectConfig", @@ -150,9 +153,6 @@ "Message", "MessageListResponse", "MetadataFilterGroup", - "ModelsBatchItemKind", - "ModelsBatchItemStatus", - "ModelsBatchStatus", "NotFoundError", "PathDetectConfig", "PatternMetadata", diff --git a/src/zep_cloud/types/__init__.py b/src/zep_cloud/types/__init__.py index c2334e34..d6ea2404 100644 --- a/src/zep_cloud/types/__init__.py +++ b/src/zep_cloud/types/__init__.py @@ -10,9 +10,12 @@ from .apidata_batch_add_item_type import ApidataBatchAddItemType from .batch_add_item import BatchAddItem from .batch_item_detail import BatchItemDetail +from .batch_item_kind import BatchItemKind from .batch_item_list_response import BatchItemListResponse +from .batch_item_status import BatchItemStatus from .batch_list_response import BatchListResponse from .batch_progress import BatchProgress +from .batch_status import BatchStatus from .batch_summary import BatchSummary from .clone_graph_response import CloneGraphResponse from .cluster_detect_config import ClusterDetectConfig @@ -56,9 +59,6 @@ from .message import Message from .message_list_response import MessageListResponse from .metadata_filter_group import MetadataFilterGroup -from .models_batch_item_kind import ModelsBatchItemKind -from .models_batch_item_status import ModelsBatchItemStatus -from .models_batch_status import ModelsBatchStatus from .path_detect_config import PathDetectConfig from .pattern_metadata import PatternMetadata from .pattern_result import PatternResult @@ -92,9 +92,12 @@ "ApidataBatchAddItemType", "BatchAddItem", "BatchItemDetail", + "BatchItemKind", "BatchItemListResponse", + "BatchItemStatus", "BatchListResponse", "BatchProgress", + "BatchStatus", "BatchSummary", "CloneGraphResponse", "ClusterDetectConfig", @@ -138,9 +141,6 @@ "Message", "MessageListResponse", "MetadataFilterGroup", - "ModelsBatchItemKind", - "ModelsBatchItemStatus", - "ModelsBatchStatus", "PathDetectConfig", "PatternMetadata", "PatternResult", diff --git a/src/zep_cloud/types/batch_item_detail.py b/src/zep_cloud/types/batch_item_detail.py index ea8e3dc8..5bc0831e 100644 --- a/src/zep_cloud/types/batch_item_detail.py +++ b/src/zep_cloud/types/batch_item_detail.py @@ -4,8 +4,8 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .models_batch_item_kind import ModelsBatchItemKind -from .models_batch_item_status import ModelsBatchItemStatus +from .batch_item_kind import BatchItemKind +from .batch_item_status import BatchItemStatus class BatchItemDetail(UniversalBaseModel): @@ -14,10 +14,10 @@ class BatchItemDetail(UniversalBaseModel): error: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None graph_id: typing.Optional[str] = None item_id: typing.Optional[str] = None - kind: typing.Optional[ModelsBatchItemKind] = None + kind: typing.Optional[BatchItemKind] = None sequence_index: typing.Optional[int] = None source_uuid: typing.Optional[str] = None - status: typing.Optional[ModelsBatchItemStatus] = None + status: typing.Optional[BatchItemStatus] = None thread_id: typing.Optional[str] = None updated_at: typing.Optional[str] = None user_id: typing.Optional[str] = None diff --git a/src/zep_cloud/types/batch_item_kind.py b/src/zep_cloud/types/batch_item_kind.py new file mode 100644 index 00000000..5d08ec0a --- /dev/null +++ b/src/zep_cloud/types/batch_item_kind.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +BatchItemKind = typing.Union[typing.Literal["graph_episode", "thread_message"], typing.Any] diff --git a/src/zep_cloud/types/models_batch_item_status.py b/src/zep_cloud/types/batch_item_status.py similarity index 82% rename from src/zep_cloud/types/models_batch_item_status.py rename to src/zep_cloud/types/batch_item_status.py index 2ff473a8..4247df0a 100644 --- a/src/zep_cloud/types/models_batch_item_status.py +++ b/src/zep_cloud/types/batch_item_status.py @@ -2,6 +2,6 @@ import typing -ModelsBatchItemStatus = typing.Union[ +BatchItemStatus = typing.Union[ typing.Literal["pending", "queued", "processing", "succeeded", "failed", "skipped"], typing.Any ] diff --git a/src/zep_cloud/types/models_batch_status.py b/src/zep_cloud/types/batch_status.py similarity index 84% rename from src/zep_cloud/types/models_batch_status.py rename to src/zep_cloud/types/batch_status.py index 173113a3..400d3d56 100644 --- a/src/zep_cloud/types/models_batch_status.py +++ b/src/zep_cloud/types/batch_status.py @@ -2,6 +2,6 @@ import typing -ModelsBatchStatus = typing.Union[ +BatchStatus = typing.Union[ typing.Literal["draft", "invalid", "queued", "processing", "succeeded", "partial", "failed"], typing.Any ] diff --git a/src/zep_cloud/types/batch_summary.py b/src/zep_cloud/types/batch_summary.py index e500a5b4..f0857745 100644 --- a/src/zep_cloud/types/batch_summary.py +++ b/src/zep_cloud/types/batch_summary.py @@ -5,7 +5,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .batch_progress import BatchProgress -from .models_batch_status import ModelsBatchStatus +from .batch_status import BatchStatus class BatchSummary(UniversalBaseModel): @@ -16,7 +16,7 @@ class BatchSummary(UniversalBaseModel): metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None processed_at: typing.Optional[str] = None progress: typing.Optional[BatchProgress] = None - status: typing.Optional[ModelsBatchStatus] = None + status: typing.Optional[BatchStatus] = None updated_at: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/zep_cloud/types/models_batch_item_kind.py b/src/zep_cloud/types/models_batch_item_kind.py deleted file mode 100644 index ad690c61..00000000 --- a/src/zep_cloud/types/models_batch_item_kind.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -ModelsBatchItemKind = typing.Union[typing.Literal["graph_episode", "thread_message"], typing.Any]