From 3c2c08e95955d0f8101de68a848dec9898683b83 Mon Sep 17 00:00:00 2001 From: everos-sdk-factory Date: Fri, 20 Nov 2026 19:58:26 +0000 Subject: [PATCH] chore(sdk): generate 1.3.0-rc4 from contract 2.0.0 Sources: memory-engine@release-20261102_v11 multimodal-storage@release-20260729_v1 gateway-tasks@evermemos-gateway_release-20260901_v1 --- .openapi-generator/FILES | 21 + docs/DeleteByIdsData.md | 4 +- docs/DeleteByIdsInput.md | 4 +- docs/DeleteData.md | 6 +- docs/MemoryApi.md | 168 +++++- docs/ProfileItem.md | 1 + docs/RebuildData.md | 32 + docs/RebuildInput.md | 35 ++ docs/RebuildProgress.md | 32 + docs/RebuildStatusData.md | 35 ++ docs/RebuildStatusInput.md | 29 + docs/SearchData.md | 1 + docs/SearchProfileItem.md | 1 + docs/SuccessEnvelopeRebuildData.md | 30 + docs/SuccessEnvelopeRebuildStatusData.md | 30 + docs/UpdateInput.md | 2 + everos_cloud/__init__.py | 9 +- everos_cloud/api/memory_api.py | 567 +++++++++++++++++- everos_cloud/api_client.py | 2 +- everos_cloud/configuration.py | 2 +- everos_cloud/models/__init__.py | 7 + everos_cloud/models/delete_by_ids_data.py | 25 +- everos_cloud/models/delete_by_ids_input.py | 20 +- everos_cloud/models/delete_data.py | 25 +- everos_cloud/models/profile_item.py | 8 +- everos_cloud/models/rebuild_data.py | 130 ++++ everos_cloud/models/rebuild_input.py | 140 +++++ everos_cloud/models/rebuild_progress.py | 107 ++++ everos_cloud/models/rebuild_status_data.py | 151 +++++ everos_cloud/models/rebuild_status_input.py | 102 ++++ everos_cloud/models/search_data.py | 13 +- everos_cloud/models/search_profile_item.py | 6 +- .../models/success_envelope_rebuild_data.py | 107 ++++ .../success_envelope_rebuild_status_data.py | 107 ++++ everos_cloud/models/update_input.py | 18 +- openapi.json | 506 +++++++++++++++- pyproject.toml | 2 +- setup.py | 2 +- test/test_delete_by_ids_data.py | 6 +- test/test_delete_by_ids_input.py | 4 +- test/test_delete_data.py | 6 +- test/test_get_data.py | 3 +- test/test_memory_api.py | 16 +- test/test_profile_item.py | 3 +- test/test_rebuild_data.py | 58 ++ test/test_rebuild_input.py | 60 ++ test/test_rebuild_progress.py | 57 ++ test/test_rebuild_status_data.py | 71 +++ test/test_rebuild_status_input.py | 53 ++ test/test_search_data.py | 4 +- test/test_search_profile_item.py | 1 + ...est_success_envelope_delete_by_ids_data.py | 12 +- test/test_success_envelope_delete_data.py | 12 +- test/test_success_envelope_get_data.py | 6 +- test/test_success_envelope_rebuild_data.py | 67 +++ ...st_success_envelope_rebuild_status_data.py | 81 +++ test/test_success_envelope_search_data.py | 8 +- test/test_update_input.py | 4 +- 58 files changed, 2955 insertions(+), 64 deletions(-) create mode 100644 docs/RebuildData.md create mode 100644 docs/RebuildInput.md create mode 100644 docs/RebuildProgress.md create mode 100644 docs/RebuildStatusData.md create mode 100644 docs/RebuildStatusInput.md create mode 100644 docs/SuccessEnvelopeRebuildData.md create mode 100644 docs/SuccessEnvelopeRebuildStatusData.md create mode 100644 everos_cloud/models/rebuild_data.py create mode 100644 everos_cloud/models/rebuild_input.py create mode 100644 everos_cloud/models/rebuild_progress.py create mode 100644 everos_cloud/models/rebuild_status_data.py create mode 100644 everos_cloud/models/rebuild_status_input.py create mode 100644 everos_cloud/models/success_envelope_rebuild_data.py create mode 100644 everos_cloud/models/success_envelope_rebuild_status_data.py create mode 100644 test/test_rebuild_data.py create mode 100644 test/test_rebuild_input.py create mode 100644 test/test_rebuild_progress.py create mode 100644 test/test_rebuild_status_data.py create mode 100644 test/test_rebuild_status_input.py create mode 100644 test/test_success_envelope_rebuild_data.py create mode 100644 test/test_success_envelope_rebuild_status_data.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 74c44ce..96f3e27 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -70,6 +70,11 @@ docs/PurgeRequestInput.md docs/PurgeStepData.md docs/PurgeSummary.md docs/Reason.md +docs/RebuildData.md +docs/RebuildInput.md +docs/RebuildProgress.md +docs/RebuildStatusData.md +docs/RebuildStatusInput.md docs/RelatedTagUsageBody.md docs/RelatedTagUsageItem.md docs/RelatedTagUsageListData.md @@ -112,6 +117,8 @@ docs/SuccessEnvelopeKbListData.md docs/SuccessEnvelopeKbSearchData.md docs/SuccessEnvelopePurgeJobData.md docs/SuccessEnvelopePurgeRequestData.md +docs/SuccessEnvelopeRebuildData.md +docs/SuccessEnvelopeRebuildStatusData.md docs/SuccessEnvelopeRelatedTagUsageListData.md docs/SuccessEnvelopeSearchData.md docs/SuccessEnvelopeTagBindData.md @@ -233,6 +240,11 @@ everos_cloud/models/purge_request_input.py everos_cloud/models/purge_step_data.py everos_cloud/models/purge_summary.py everos_cloud/models/reason.py +everos_cloud/models/rebuild_data.py +everos_cloud/models/rebuild_input.py +everos_cloud/models/rebuild_progress.py +everos_cloud/models/rebuild_status_data.py +everos_cloud/models/rebuild_status_input.py everos_cloud/models/related_tag_usage_body.py everos_cloud/models/related_tag_usage_item.py everos_cloud/models/related_tag_usage_list_data.py @@ -274,6 +286,8 @@ everos_cloud/models/success_envelope_kb_list_data.py everos_cloud/models/success_envelope_kb_search_data.py everos_cloud/models/success_envelope_purge_job_data.py everos_cloud/models/success_envelope_purge_request_data.py +everos_cloud/models/success_envelope_rebuild_data.py +everos_cloud/models/success_envelope_rebuild_status_data.py everos_cloud/models/success_envelope_related_tag_usage_list_data.py everos_cloud/models/success_envelope_search_data.py everos_cloud/models/success_envelope_tag_bind_data.py @@ -393,6 +407,11 @@ test/test_purge_request_input.py test/test_purge_step_data.py test/test_purge_summary.py test/test_reason.py +test/test_rebuild_data.py +test/test_rebuild_input.py +test/test_rebuild_progress.py +test/test_rebuild_status_data.py +test/test_rebuild_status_input.py test/test_related_tag_usage_body.py test/test_related_tag_usage_item.py test/test_related_tag_usage_list_data.py @@ -435,6 +454,8 @@ test/test_success_envelope_kb_list_data.py test/test_success_envelope_kb_search_data.py test/test_success_envelope_purge_job_data.py test/test_success_envelope_purge_request_data.py +test/test_success_envelope_rebuild_data.py +test/test_success_envelope_rebuild_status_data.py test/test_success_envelope_related_tag_usage_list_data.py test/test_success_envelope_search_data.py test/test_success_envelope_tag_bind_data.py diff --git a/docs/DeleteByIdsData.md b/docs/DeleteByIdsData.md index 7cbf66f..ec48e08 100644 --- a/docs/DeleteByIdsData.md +++ b/docs/DeleteByIdsData.md @@ -1,6 +1,6 @@ # DeleteByIdsData -Result of a by-ids soft delete. A 200 means the request was applied; ids that were already gone are a no-op, not a failure, so a re-sent batch is safe. +Result of a by-ids delete. A 200 means the request was applied; ids that were already gone are a no-op, not a failure, so a re-sent batch is safe. ## Properties @@ -9,6 +9,8 @@ Name | Type | Description | Notes **memory_type** | **str** | The memory type the request named. | **success** | **bool** | Always true on a 200 — the batch was applied. Failures use the error envelope instead. | **deleted** | **int** | Records this request removed. Ids that were absent, already deleted, another tenant's or (with `user_id`) another user's are skipped and count 0 alike. | +**rebuild_required** | **bool** | True when derived memories built from the deleted ones were kept and may still contain their content; call /memory/rebuild to regenerate them. | [optional] [default to False] +**targets** | **List[str]** | What /memory/rebuild would regenerate; empty when nothing. | [optional] ## Example diff --git a/docs/DeleteByIdsInput.md b/docs/DeleteByIdsInput.md index 783b684..7a2d6b6 100644 --- a/docs/DeleteByIdsInput.md +++ b/docs/DeleteByIdsInput.md @@ -1,6 +1,6 @@ # DeleteByIdsInput -Soft-delete the named memory records [Cloud-only]. +Permanently delete the named memory records [Cloud-only]. ## Properties @@ -10,6 +10,8 @@ Name | Type | Description | Notes **memory_ids** | **List[str]** | 1 to 50 memory ids. Every one must be well-formed; duplicates are collapsed. | **reason** | [**Reason**](Reason.md) | | [optional] **user_id** | **str** | | [optional] +**app_id** | **str** | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/docs/DeleteData.md b/docs/DeleteData.md index 5096deb..130e2ae 100644 --- a/docs/DeleteData.md +++ b/docs/DeleteData.md @@ -1,13 +1,15 @@ # DeleteData -Delete result (mirrors v1 ``DeleteMemoriesResult``): which scope filters were applied + how many mongo records were soft-deleted across all memory types. +Delete result (mirrors v1 ``DeleteMemoriesResult``): which scope filters were applied + how many mongo records were deleted across all memory types. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **filters** | **List[str]** | Scope filters used, e.g. ['user_id'] or ['user_id', 'session_id'] | [optional] -**count** | **int** | Total memory records soft-deleted | [optional] [default to 0] +**count** | **int** | Total memory records deleted | [optional] [default to 0] +**rebuild_required** | **bool** | True when derived memories built from the deleted ones were kept and may still contain their content; call /memory/rebuild to regenerate them. | [optional] [default to False] +**targets** | **List[str]** | What /memory/rebuild would regenerate; empty when nothing. | [optional] ## Example diff --git a/docs/MemoryApi.md b/docs/MemoryApi.md index e638c6f..2dda06b 100644 --- a/docs/MemoryApi.md +++ b/docs/MemoryApi.md @@ -7,12 +7,14 @@ Method | HTTP request | Description [**add_memory**](MemoryApi.md#add_memory) | **POST** /api/v2/memory/add | Add messages [OSS + Cloud] [**bind_tags**](MemoryApi.md#bind_tags) | **POST** /api/v2/memory/tag/bind | Bind tags to memories [Cloud] [**confirm_purge**](MemoryApi.md#confirm_purge) | **POST** /api/v2/memory/purge/confirm | Confirm a memory-space purge (step 2 of 2) [Cloud-only] -[**delete_memories_by_ids**](MemoryApi.md#delete_memories_by_ids) | **POST** /api/v2/memory/delete_by_ids | Soft-delete memory records by id [Cloud-only] +[**delete_memories_by_ids**](MemoryApi.md#delete_memories_by_ids) | **POST** /api/v2/memory/delete_by_ids | Delete memory records by id [Cloud-only] [**delete_memory**](MemoryApi.md#delete_memory) | **POST** /api/v2/memory/delete | Delete memories [Cloud-only] [**edit_profile**](MemoryApi.md#edit_profile) | **POST** /api/v2/memory/edit | Edit profile items [Cloud-only] [**flush_memory**](MemoryApi.md#flush_memory) | **POST** /api/v2/memory/flush | Force memory extraction [OSS + Cloud] [**get_memory**](MemoryApi.md#get_memory) | **POST** /api/v2/memory/get | Get memories [OSS + Cloud] [**get_purge_job**](MemoryApi.md#get_purge_job) | **GET** /api/v2/memory/purge/{job_id} | Get a memory-space purge job [Cloud-only] +[**get_rebuild_status**](MemoryApi.md#get_rebuild_status) | **POST** /api/v2/memory/rebuild/status | Status of a rebuild job [Cloud-only] +[**rebuild_memory**](MemoryApi.md#rebuild_memory) | **POST** /api/v2/memory/rebuild | Rebuild derived memories a delete left stale [Cloud-only] [**replace_tags**](MemoryApi.md#replace_tags) | **POST** /api/v2/memory/tag/replace | Replace tags on memories [Cloud] [**request_purge**](MemoryApi.md#request_purge) | **POST** /api/v2/memory/purge | Request a memory-space purge (step 1 of 2) [Cloud-only] [**retrieve_context**](MemoryApi.md#retrieve_context) | **POST** /api/v2/memory/context | Context Retrieval [Cloud-only] @@ -278,7 +280,7 @@ Name | Type | Description | Notes # **delete_memories_by_ids** > SuccessEnvelopeDeleteByIdsData delete_memories_by_ids(delete_by_ids_input) -Soft-delete memory records by id [Cloud-only] +Delete memory records by id [Cloud-only] Soft-delete up to 50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership and search-index copies). Only \"episode\" is supported today. - Every id must be well-formed; one malformed id rejects the whole request with 422 and nothing is deleted. - Ids that do not exist, are already deleted, or belong to another tenant are skipped — the rest of the batch is still deleted, so re-sending a batch is safe. Duplicates are collapsed. - `deleted` in the response counts the records this request removed. Every skipped id counts 0 alike, so the count does not reveal which ids exist. Pass `user_id` to delete only that user's memories: an id owned by anyone else is skipped like a missing one. Set it from your own session (the signed-in user), never from model output, so that an agent tool cannot touch another user's memory with a wrong or invented id. To remove memories by owner or session rather than by id, use /api/v2/memory/delete. @@ -316,7 +318,7 @@ with everos_cloud.ApiClient(configuration) as api_client: delete_by_ids_input = everos_cloud.DeleteByIdsInput() # DeleteByIdsInput | try: - # Soft-delete memory records by id [Cloud-only] + # Delete memory records by id [Cloud-only] api_response = api_instance.delete_memories_by_ids(delete_by_ids_input) print("The response of MemoryApi->delete_memories_by_ids:\n") pprint(api_response) @@ -778,6 +780,164 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_rebuild_status** +> SuccessEnvelopeRebuildStatusData get_rebuild_status(rebuild_status_input) + +Status of a rebuild job [Cloud-only] + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import everos_cloud +from everos_cloud.models.rebuild_status_input import RebuildStatusInput +from everos_cloud.models.success_envelope_rebuild_status_data import SuccessEnvelopeRebuildStatusData +from everos_cloud.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.evermind.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = everos_cloud.Configuration( + host = "https://api.evermind.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = everos_cloud.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with everos_cloud.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = everos_cloud.MemoryApi(api_client) + rebuild_status_input = everos_cloud.RebuildStatusInput() # RebuildStatusInput | + + try: + # Status of a rebuild job [Cloud-only] + api_response = api_instance.get_rebuild_status(rebuild_status_input) + print("The response of MemoryApi->get_rebuild_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MemoryApi->get_rebuild_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rebuild_status_input** | [**RebuildStatusInput**](RebuildStatusInput.md)| | + +### Return type + +[**SuccessEnvelopeRebuildStatusData**](SuccessEnvelopeRebuildStatusData.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **rebuild_memory** +> SuccessEnvelopeRebuildData rebuild_memory(rebuild_input) + +Rebuild derived memories a delete left stale [Cloud-only] + +Deletes never spend LLM calls: a derived memory that can only be regenerated by an LLM (the profile, session summaries, agent skills) is kept and marked stale (`rebuild_required` / `targets` on the delete response, `stale` on the profile). This call starts one background job that regenerates the marked ones from the remaining memories. Free; the extraction it runs is metered like any extraction, so like `add` it is refused with 429 once the account's mcu balance is exhausted. One active job per owner: a second call returns the running job. Poll `/memory/rebuild/status` with the returned `job_id`. While a profile rebuild runs, the profile holds only its manually edited items plus what has been re-extracted so far: the LLM-generated items are cleared when the job starts and come back batch by batch. `stale` stays `true` until the job finishes. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import everos_cloud +from everos_cloud.models.rebuild_input import RebuildInput +from everos_cloud.models.success_envelope_rebuild_data import SuccessEnvelopeRebuildData +from everos_cloud.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.evermind.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = everos_cloud.Configuration( + host = "https://api.evermind.ai" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = everos_cloud.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with everos_cloud.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = everos_cloud.MemoryApi(api_client) + rebuild_input = everos_cloud.RebuildInput() # RebuildInput | + + try: + # Rebuild derived memories a delete left stale [Cloud-only] + api_response = api_instance.rebuild_memory(rebuild_input) + print("The response of MemoryApi->rebuild_memory:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MemoryApi->rebuild_memory: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **rebuild_input** | [**RebuildInput**](RebuildInput.md)| | + +### Return type + +[**SuccessEnvelopeRebuildData**](SuccessEnvelopeRebuildData.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful Response | - | +**422** | Validation Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **replace_tags** > SuccessEnvelopeTagReplaceData replace_tags(tag_replace_input) @@ -951,7 +1111,7 @@ Name | Type | Description | Notes Context Retrieval [Cloud-only] -Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **The response contains memories, not an answer**: the model's own answer is discarded. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. +Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **By default the response contains memories, not an answer**: the model's own answer is discarded. A deployment can enable answer mode, which also returns that answer in `answer`. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. - In answer mode, `answer` holds the model's answer (\"\" if it gave none), cited memories come first **in the order the model cited them**, and each cited score is above every uncited one. Without answer mode, `answer` is absent. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. ### Example diff --git a/docs/ProfileItem.md b/docs/ProfileItem.md index 8f2aaa2..ef6c6d3 100644 --- a/docs/ProfileItem.md +++ b/docs/ProfileItem.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **profile_data** | **Dict[str, object]** | The profile itself — the explicit_info and implicit_traits items maintained by extraction and by /api/v2/memory/edit. Each item's id is what an edit operation targets. | [optional] **created_at** | **datetime** | | [optional] **updated_at** | **datetime** | | [optional] +**stale** | **bool** | True when memories this profile was built from have been deleted; it may still contain information from them until /memory/rebuild is called. During a rebuild it stays true, and the profile holds only its manually edited items plus what has been re-extracted so far. | [optional] [default to False] ## Example diff --git a/docs/RebuildData.md b/docs/RebuildData.md new file mode 100644 index 0000000..7814319 --- /dev/null +++ b/docs/RebuildData.md @@ -0,0 +1,32 @@ +# RebuildData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_id** | **str** | | [optional] +**status** | **str** | queued: a job was started. already_running: the owner's running job is returned instead of starting another. nothing_to_do: nothing is marked stale (and force is false). dry_run: what would be rebuilt. | +**targets** | **List[str]** | What the job rebuilds (or would) | [optional] +**estimated_episodes** | **int** | Episodes a profile rebuild re-reads (a cost hint; 0 without profile) | [optional] [default to 0] + +## Example + +```python +from everos_cloud.models.rebuild_data import RebuildData + +# TODO update the JSON string below +json = "{}" +# create an instance of RebuildData from a JSON string +rebuild_data_instance = RebuildData.from_json(json) +# print the JSON string representation of the object +print(RebuildData.to_json()) + +# convert the object into a dict +rebuild_data_dict = rebuild_data_instance.to_dict() +# create an instance of RebuildData from a dict +rebuild_data_from_dict = RebuildData.from_dict(rebuild_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RebuildInput.md b/docs/RebuildInput.md new file mode 100644 index 0000000..97361ad --- /dev/null +++ b/docs/RebuildInput.md @@ -0,0 +1,35 @@ +# RebuildInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | **str** | | [optional] [default to 'default'] +**project_id** | **str** | | [optional] [default to 'default'] +**user_id** | **str** | | [optional] +**agent_id** | **str** | | [optional] +**targets** | **List[str]** | | [optional] +**force** | **bool** | Rebuild the profile / every skill cluster even when nothing is marked stale. Session summaries are only rebuilt when marked. | [optional] [default to False] +**dry_run** | **bool** | Report what would be rebuilt; start no job and spend nothing. | [optional] [default to False] + +## Example + +```python +from everos_cloud.models.rebuild_input import RebuildInput + +# TODO update the JSON string below +json = "{}" +# create an instance of RebuildInput from a JSON string +rebuild_input_instance = RebuildInput.from_json(json) +# print the JSON string representation of the object +print(RebuildInput.to_json()) + +# convert the object into a dict +rebuild_input_dict = rebuild_input_instance.to_dict() +# create an instance of RebuildInput from a dict +rebuild_input_from_dict = RebuildInput.from_dict(rebuild_input_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RebuildProgress.md b/docs/RebuildProgress.md new file mode 100644 index 0000000..8ec2e12 --- /dev/null +++ b/docs/RebuildProgress.md @@ -0,0 +1,32 @@ +# RebuildProgress + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**units_total** | **int** | Work items the job fanned out | +**units_done** | **int** | Work items finished | +**episodes_fed** | **int** | Episodes the profile rebuild has read so far | [optional] [default to 0] +**estimated_episodes** | **int** | Episodes the profile rebuild reads in total (approx.) | [optional] [default to 0] + +## Example + +```python +from everos_cloud.models.rebuild_progress import RebuildProgress + +# TODO update the JSON string below +json = "{}" +# create an instance of RebuildProgress from a JSON string +rebuild_progress_instance = RebuildProgress.from_json(json) +# print the JSON string representation of the object +print(RebuildProgress.to_json()) + +# convert the object into a dict +rebuild_progress_dict = rebuild_progress_instance.to_dict() +# create an instance of RebuildProgress from a dict +rebuild_progress_from_dict = RebuildProgress.from_dict(rebuild_progress_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RebuildStatusData.md b/docs/RebuildStatusData.md new file mode 100644 index 0000000..30f4e02 --- /dev/null +++ b/docs/RebuildStatusData.md @@ -0,0 +1,35 @@ +# RebuildStatusData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_id** | **str** | | +**status** | **str** | | +**targets** | **List[str]** | | [optional] +**progress** | [**RebuildProgress**](RebuildProgress.md) | | +**error** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**finished_at** | **datetime** | | [optional] + +## Example + +```python +from everos_cloud.models.rebuild_status_data import RebuildStatusData + +# TODO update the JSON string below +json = "{}" +# create an instance of RebuildStatusData from a JSON string +rebuild_status_data_instance = RebuildStatusData.from_json(json) +# print the JSON string representation of the object +print(RebuildStatusData.to_json()) + +# convert the object into a dict +rebuild_status_data_dict = rebuild_status_data_instance.to_dict() +# create an instance of RebuildStatusData from a dict +rebuild_status_data_from_dict = RebuildStatusData.from_dict(rebuild_status_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RebuildStatusInput.md b/docs/RebuildStatusInput.md new file mode 100644 index 0000000..0b33edd --- /dev/null +++ b/docs/RebuildStatusInput.md @@ -0,0 +1,29 @@ +# RebuildStatusInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_id** | **str** | From /memory/rebuild | + +## Example + +```python +from everos_cloud.models.rebuild_status_input import RebuildStatusInput + +# TODO update the JSON string below +json = "{}" +# create an instance of RebuildStatusInput from a JSON string +rebuild_status_input_instance = RebuildStatusInput.from_json(json) +# print the JSON string representation of the object +print(RebuildStatusInput.to_json()) + +# convert the object into a dict +rebuild_status_input_dict = rebuild_status_input_instance.to_dict() +# create an instance of RebuildStatusInput from a dict +rebuild_status_input_from_dict = RebuildStatusInput.from_dict(rebuild_status_input_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SearchData.md b/docs/SearchData.md index 78afa52..8ae2d2b 100644 --- a/docs/SearchData.md +++ b/docs/SearchData.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **agent_cases** | [**List[SearchAgentCaseItem]**](SearchAgentCaseItem.md) | Matching agent cases, for an agent owner. | [optional] **agent_skills** | [**List[SearchAgentSkillItem]**](SearchAgentSkillItem.md) | Matching agent skills, for an agent owner. | [optional] **unprocessed_messages** | [**List[UnprocessedMessageDTO]**](UnprocessedMessageDTO.md) | Raw buffered messages not yet extracted. Returned only when the request filtered on a single `session_id`, so a caller can see what is still in flight. | [optional] +**answer** | **str** | | [optional] ## Example diff --git a/docs/SearchProfileItem.md b/docs/SearchProfileItem.md index 82c26c1..6317c8d 100644 --- a/docs/SearchProfileItem.md +++ b/docs/SearchProfileItem.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **profile_data** | **Dict[str, object]** | The profile itself — the explicit_info and implicit_traits items maintained by extraction and by /api/v2/memory/edit. Each item's id is what an edit operation targets. | [optional] **created_at** | **datetime** | | [optional] **updated_at** | **datetime** | | [optional] +**stale** | **bool** | True when memories this profile was built from have been deleted; it may still contain information from them until /memory/rebuild is called. During a rebuild it stays true, and the profile holds only its manually edited items plus what has been re-extracted so far. | [optional] [default to False] **score** | **float** | | [optional] ## Example diff --git a/docs/SuccessEnvelopeRebuildData.md b/docs/SuccessEnvelopeRebuildData.md new file mode 100644 index 0000000..6a679fe --- /dev/null +++ b/docs/SuccessEnvelopeRebuildData.md @@ -0,0 +1,30 @@ +# SuccessEnvelopeRebuildData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **str** | Request trace id (peer to data) | +**data** | [**RebuildData**](RebuildData.md) | Endpoint-defined business result | + +## Example + +```python +from everos_cloud.models.success_envelope_rebuild_data import SuccessEnvelopeRebuildData + +# TODO update the JSON string below +json = "{}" +# create an instance of SuccessEnvelopeRebuildData from a JSON string +success_envelope_rebuild_data_instance = SuccessEnvelopeRebuildData.from_json(json) +# print the JSON string representation of the object +print(SuccessEnvelopeRebuildData.to_json()) + +# convert the object into a dict +success_envelope_rebuild_data_dict = success_envelope_rebuild_data_instance.to_dict() +# create an instance of SuccessEnvelopeRebuildData from a dict +success_envelope_rebuild_data_from_dict = SuccessEnvelopeRebuildData.from_dict(success_envelope_rebuild_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SuccessEnvelopeRebuildStatusData.md b/docs/SuccessEnvelopeRebuildStatusData.md new file mode 100644 index 0000000..7fc5cfb --- /dev/null +++ b/docs/SuccessEnvelopeRebuildStatusData.md @@ -0,0 +1,30 @@ +# SuccessEnvelopeRebuildStatusData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request_id** | **str** | Request trace id (peer to data) | +**data** | [**RebuildStatusData**](RebuildStatusData.md) | Endpoint-defined business result | + +## Example + +```python +from everos_cloud.models.success_envelope_rebuild_status_data import SuccessEnvelopeRebuildStatusData + +# TODO update the JSON string below +json = "{}" +# create an instance of SuccessEnvelopeRebuildStatusData from a JSON string +success_envelope_rebuild_status_data_instance = SuccessEnvelopeRebuildStatusData.from_json(json) +# print the JSON string representation of the object +print(SuccessEnvelopeRebuildStatusData.to_json()) + +# convert the object into a dict +success_envelope_rebuild_status_data_dict = success_envelope_rebuild_status_data_instance.to_dict() +# create an instance of SuccessEnvelopeRebuildStatusData from a dict +success_envelope_rebuild_status_data_from_dict = SuccessEnvelopeRebuildStatusData.from_dict(success_envelope_rebuild_status_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateInput.md b/docs/UpdateInput.md index 7d1f751..2e96f0e 100644 --- a/docs/UpdateInput.md +++ b/docs/UpdateInput.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **patch** | [**EpisodePatch**](EpisodePatch.md) | The fields to rewrite — at least one. Fields left out keep their current value. | **reason** | [**Reason**](Reason.md) | | [optional] **user_id** | **str** | | [optional] +**app_id** | **str** | | [optional] +**project_id** | **str** | | [optional] ## Example diff --git a/everos_cloud/__init__.py b/everos_cloud/__init__.py index 747cc41..aab0114 100644 --- a/everos_cloud/__init__.py +++ b/everos_cloud/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "1.3.0-rc3" +__version__ = "1.3.0-rc4" # import apis into sdk package from everos_cloud.api.knowledge_api import KnowledgeApi @@ -103,6 +103,11 @@ from everos_cloud.models.purge_step_data import PurgeStepData from everos_cloud.models.purge_summary import PurgeSummary from everos_cloud.models.reason import Reason +from everos_cloud.models.rebuild_data import RebuildData +from everos_cloud.models.rebuild_input import RebuildInput +from everos_cloud.models.rebuild_progress import RebuildProgress +from everos_cloud.models.rebuild_status_data import RebuildStatusData +from everos_cloud.models.rebuild_status_input import RebuildStatusInput from everos_cloud.models.related_tag_usage_body import RelatedTagUsageBody from everos_cloud.models.related_tag_usage_item import RelatedTagUsageItem from everos_cloud.models.related_tag_usage_list_data import RelatedTagUsageListData @@ -144,6 +149,8 @@ from everos_cloud.models.success_envelope_kb_search_data import SuccessEnvelopeKbSearchData from everos_cloud.models.success_envelope_purge_job_data import SuccessEnvelopePurgeJobData from everos_cloud.models.success_envelope_purge_request_data import SuccessEnvelopePurgeRequestData +from everos_cloud.models.success_envelope_rebuild_data import SuccessEnvelopeRebuildData +from everos_cloud.models.success_envelope_rebuild_status_data import SuccessEnvelopeRebuildStatusData from everos_cloud.models.success_envelope_related_tag_usage_list_data import SuccessEnvelopeRelatedTagUsageListData from everos_cloud.models.success_envelope_search_data import SuccessEnvelopeSearchData from everos_cloud.models.success_envelope_tag_bind_data import SuccessEnvelopeTagBindData diff --git a/everos_cloud/api/memory_api.py b/everos_cloud/api/memory_api.py index f601ff4..55db503 100644 --- a/everos_cloud/api/memory_api.py +++ b/everos_cloud/api/memory_api.py @@ -28,6 +28,8 @@ from everos_cloud.models.get_input import GetInput from everos_cloud.models.purge_confirm_input import PurgeConfirmInput from everos_cloud.models.purge_request_input import PurgeRequestInput +from everos_cloud.models.rebuild_input import RebuildInput +from everos_cloud.models.rebuild_status_input import RebuildStatusInput from everos_cloud.models.search_input import SearchInput from everos_cloud.models.success_envelope_add_data import SuccessEnvelopeAddData from everos_cloud.models.success_envelope_delete_by_ids_data import SuccessEnvelopeDeleteByIdsData @@ -38,6 +40,8 @@ from everos_cloud.models.success_envelope_get_data import SuccessEnvelopeGetData from everos_cloud.models.success_envelope_purge_job_data import SuccessEnvelopePurgeJobData from everos_cloud.models.success_envelope_purge_request_data import SuccessEnvelopePurgeRequestData +from everos_cloud.models.success_envelope_rebuild_data import SuccessEnvelopeRebuildData +from everos_cloud.models.success_envelope_rebuild_status_data import SuccessEnvelopeRebuildStatusData from everos_cloud.models.success_envelope_search_data import SuccessEnvelopeSearchData from everos_cloud.models.success_envelope_tag_bind_data import SuccessEnvelopeTagBindData from everos_cloud.models.success_envelope_tag_replace_data import SuccessEnvelopeTagReplaceData @@ -953,7 +957,7 @@ def delete_memories_by_ids( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SuccessEnvelopeDeleteByIdsData: - """Soft-delete memory records by id [Cloud-only] + """Delete memory records by id [Cloud-only] Soft-delete up to 50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership and search-index copies). Only \"episode\" is supported today. - Every id must be well-formed; one malformed id rejects the whole request with 422 and nothing is deleted. - Ids that do not exist, are already deleted, or belong to another tenant are skipped — the rest of the batch is still deleted, so re-sending a batch is safe. Duplicates are collapsed. - `deleted` in the response counts the records this request removed. Every skipped id counts 0 alike, so the count does not reveal which ids exist. Pass `user_id` to delete only that user's memories: an id owned by anyone else is skipped like a missing one. Set it from your own session (the signed-in user), never from model output, so that an agent tool cannot touch another user's memory with a wrong or invented id. To remove memories by owner or session rather than by id, use /api/v2/memory/delete. @@ -1025,7 +1029,7 @@ def delete_memories_by_ids_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[SuccessEnvelopeDeleteByIdsData]: - """Soft-delete memory records by id [Cloud-only] + """Delete memory records by id [Cloud-only] Soft-delete up to 50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership and search-index copies). Only \"episode\" is supported today. - Every id must be well-formed; one malformed id rejects the whole request with 422 and nothing is deleted. - Ids that do not exist, are already deleted, or belong to another tenant are skipped — the rest of the batch is still deleted, so re-sending a batch is safe. Duplicates are collapsed. - `deleted` in the response counts the records this request removed. Every skipped id counts 0 alike, so the count does not reveal which ids exist. Pass `user_id` to delete only that user's memories: an id owned by anyone else is skipped like a missing one. Set it from your own session (the signed-in user), never from model output, so that an agent tool cannot touch another user's memory with a wrong or invented id. To remove memories by owner or session rather than by id, use /api/v2/memory/delete. @@ -1097,7 +1101,7 @@ def delete_memories_by_ids_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Soft-delete memory records by id [Cloud-only] + """Delete memory records by id [Cloud-only] Soft-delete up to 50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership and search-index copies). Only \"episode\" is supported today. - Every id must be well-formed; one malformed id rejects the whole request with 422 and nothing is deleted. - Ids that do not exist, are already deleted, or belong to another tenant are skipped — the rest of the batch is still deleted, so re-sending a batch is safe. Duplicates are collapsed. - `deleted` in the response counts the records this request removed. Every skipped id counts 0 alike, so the count does not reveal which ids exist. Pass `user_id` to delete only that user's memories: an id owned by anyone else is skipped like a missing one. Set it from your own session (the signed-in user), never from model output, so that an agent tool cannot touch another user's memory with a wrong or invented id. To remove memories by owner or session rather than by id, use /api/v2/memory/delete. @@ -2657,6 +2661,557 @@ def _get_purge_job_serialize( + @validate_call + def get_rebuild_status( + self, + rebuild_status_input: RebuildStatusInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessEnvelopeRebuildStatusData: + """Status of a rebuild job [Cloud-only] + + + :param rebuild_status_input: (required) + :type rebuild_status_input: RebuildStatusInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_rebuild_status_serialize( + rebuild_status_input=rebuild_status_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessEnvelopeRebuildStatusData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_rebuild_status_with_http_info( + self, + rebuild_status_input: RebuildStatusInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SuccessEnvelopeRebuildStatusData]: + """Status of a rebuild job [Cloud-only] + + + :param rebuild_status_input: (required) + :type rebuild_status_input: RebuildStatusInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_rebuild_status_serialize( + rebuild_status_input=rebuild_status_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessEnvelopeRebuildStatusData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_rebuild_status_without_preload_content( + self, + rebuild_status_input: RebuildStatusInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Status of a rebuild job [Cloud-only] + + + :param rebuild_status_input: (required) + :type rebuild_status_input: RebuildStatusInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_rebuild_status_serialize( + rebuild_status_input=rebuild_status_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessEnvelopeRebuildStatusData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_rebuild_status_serialize( + self, + rebuild_status_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if rebuild_status_input is not None: + _body_params = rebuild_status_input + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/memory/rebuild/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def rebuild_memory( + self, + rebuild_input: RebuildInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessEnvelopeRebuildData: + """Rebuild derived memories a delete left stale [Cloud-only] + + Deletes never spend LLM calls: a derived memory that can only be regenerated by an LLM (the profile, session summaries, agent skills) is kept and marked stale (`rebuild_required` / `targets` on the delete response, `stale` on the profile). This call starts one background job that regenerates the marked ones from the remaining memories. Free; the extraction it runs is metered like any extraction, so like `add` it is refused with 429 once the account's mcu balance is exhausted. One active job per owner: a second call returns the running job. Poll `/memory/rebuild/status` with the returned `job_id`. While a profile rebuild runs, the profile holds only its manually edited items plus what has been re-extracted so far: the LLM-generated items are cleared when the job starts and come back batch by batch. `stale` stays `true` until the job finishes. + + :param rebuild_input: (required) + :type rebuild_input: RebuildInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rebuild_memory_serialize( + rebuild_input=rebuild_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessEnvelopeRebuildData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def rebuild_memory_with_http_info( + self, + rebuild_input: RebuildInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SuccessEnvelopeRebuildData]: + """Rebuild derived memories a delete left stale [Cloud-only] + + Deletes never spend LLM calls: a derived memory that can only be regenerated by an LLM (the profile, session summaries, agent skills) is kept and marked stale (`rebuild_required` / `targets` on the delete response, `stale` on the profile). This call starts one background job that regenerates the marked ones from the remaining memories. Free; the extraction it runs is metered like any extraction, so like `add` it is refused with 429 once the account's mcu balance is exhausted. One active job per owner: a second call returns the running job. Poll `/memory/rebuild/status` with the returned `job_id`. While a profile rebuild runs, the profile holds only its manually edited items plus what has been re-extracted so far: the LLM-generated items are cleared when the job starts and come back batch by batch. `stale` stays `true` until the job finishes. + + :param rebuild_input: (required) + :type rebuild_input: RebuildInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rebuild_memory_serialize( + rebuild_input=rebuild_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessEnvelopeRebuildData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def rebuild_memory_without_preload_content( + self, + rebuild_input: RebuildInput, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Rebuild derived memories a delete left stale [Cloud-only] + + Deletes never spend LLM calls: a derived memory that can only be regenerated by an LLM (the profile, session summaries, agent skills) is kept and marked stale (`rebuild_required` / `targets` on the delete response, `stale` on the profile). This call starts one background job that regenerates the marked ones from the remaining memories. Free; the extraction it runs is metered like any extraction, so like `add` it is refused with 429 once the account's mcu balance is exhausted. One active job per owner: a second call returns the running job. Poll `/memory/rebuild/status` with the returned `job_id`. While a profile rebuild runs, the profile holds only its manually edited items plus what has been re-extracted so far: the LLM-generated items are cleared when the job starts and come back batch by batch. `stale` stays `true` until the job finishes. + + :param rebuild_input: (required) + :type rebuild_input: RebuildInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rebuild_memory_serialize( + rebuild_input=rebuild_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessEnvelopeRebuildData", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rebuild_memory_serialize( + self, + rebuild_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if rebuild_input is not None: + _body_params = rebuild_input + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v2/memory/rebuild', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def replace_tags( self, @@ -3254,7 +3809,7 @@ def retrieve_context( ) -> SuccessEnvelopeSearchData: """Context Retrieval [Cloud-only] - Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **The response contains memories, not an answer**: the model's own answer is discarded. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. + Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **By default the response contains memories, not an answer**: the model's own answer is discarded. A deployment can enable answer mode, which also returns that answer in `answer`. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. - In answer mode, `answer` holds the model's answer (\"\" if it gave none), cited memories come first **in the order the model cited them**, and each cited score is above every uncited one. Without answer mode, `answer` is absent. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. :param context_input: (required) :type context_input: ContextInput @@ -3326,7 +3881,7 @@ def retrieve_context_with_http_info( ) -> ApiResponse[SuccessEnvelopeSearchData]: """Context Retrieval [Cloud-only] - Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **The response contains memories, not an answer**: the model's own answer is discarded. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. + Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **By default the response contains memories, not an answer**: the model's own answer is discarded. A deployment can enable answer mode, which also returns that answer in `answer`. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. - In answer mode, `answer` holds the model's answer (\"\" if it gave none), cited memories come first **in the order the model cited them**, and each cited score is above every uncited one. Without answer mode, `answer` is absent. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. :param context_input: (required) :type context_input: ContextInput @@ -3398,7 +3953,7 @@ def retrieve_context_without_preload_content( ) -> RESTResponseType: """Context Retrieval [Cloud-only] - Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **The response contains memories, not an answer**: the model's own answer is discarded. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. + Retrieve memories with a multi-round, LLM-driven search loop. An LLM plans and runs several searches over the owner's memories — keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session — and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **By default the response contains memories, not an answer**: the model's own answer is discarded. A deployment can enable answer mode, which also returns that answer in `answer`. Use it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper. **Request** — the same body as `/search`, except: - `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories. - `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422. - `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score. - `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them. **Response** — the same `SearchData` shape as `/search`: - The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`. - `episodes[].cited` is `true` for memories the model named as the ones its answer rested on. - `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01–0.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores. - In answer mode, `answer` holds the model's answer (\"\" if it gave none), cited memories come first **in the order the model cited them**, and each cited score is above every uncited one. Without answer mode, `answer` is absent. **Limits** — by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned. **Latency** — several LLM calls per request, so noticeably slower than `/search`. :param context_input: (required) :type context_input: ContextInput diff --git a/everos_cloud/api_client.py b/everos_cloud/api_client.py index 269cc44..33ad561 100644 --- a/everos_cloud/api_client.py +++ b/everos_cloud/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.3.0-rc3/python' + self.user_agent = 'OpenAPI-Generator/1.3.0-rc4/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/everos_cloud/configuration.py b/everos_cloud/configuration.py index 3fc0045..730f888 100644 --- a/everos_cloud/configuration.py +++ b/everos_cloud/configuration.py @@ -504,7 +504,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 2.0.0\n"\ - "SDK Package Version: 1.3.0-rc3".\ + "SDK Package Version: 1.3.0-rc4".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/everos_cloud/models/__init__.py b/everos_cloud/models/__init__.py index c719839..2073bb9 100644 --- a/everos_cloud/models/__init__.py +++ b/everos_cloud/models/__init__.py @@ -83,6 +83,11 @@ from everos_cloud.models.purge_step_data import PurgeStepData from everos_cloud.models.purge_summary import PurgeSummary from everos_cloud.models.reason import Reason +from everos_cloud.models.rebuild_data import RebuildData +from everos_cloud.models.rebuild_input import RebuildInput +from everos_cloud.models.rebuild_progress import RebuildProgress +from everos_cloud.models.rebuild_status_data import RebuildStatusData +from everos_cloud.models.rebuild_status_input import RebuildStatusInput from everos_cloud.models.related_tag_usage_body import RelatedTagUsageBody from everos_cloud.models.related_tag_usage_item import RelatedTagUsageItem from everos_cloud.models.related_tag_usage_list_data import RelatedTagUsageListData @@ -124,6 +129,8 @@ from everos_cloud.models.success_envelope_kb_search_data import SuccessEnvelopeKbSearchData from everos_cloud.models.success_envelope_purge_job_data import SuccessEnvelopePurgeJobData from everos_cloud.models.success_envelope_purge_request_data import SuccessEnvelopePurgeRequestData +from everos_cloud.models.success_envelope_rebuild_data import SuccessEnvelopeRebuildData +from everos_cloud.models.success_envelope_rebuild_status_data import SuccessEnvelopeRebuildStatusData from everos_cloud.models.success_envelope_related_tag_usage_list_data import SuccessEnvelopeRelatedTagUsageListData from everos_cloud.models.success_envelope_search_data import SuccessEnvelopeSearchData from everos_cloud.models.success_envelope_tag_bind_data import SuccessEnvelopeTagBindData diff --git a/everos_cloud/models/delete_by_ids_data.py b/everos_cloud/models/delete_by_ids_data.py index 57bf9d3..1251bf9 100644 --- a/everos_cloud/models/delete_by_ids_data.py +++ b/everos_cloud/models/delete_by_ids_data.py @@ -18,20 +18,33 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self class DeleteByIdsData(BaseModel): """ - Result of a by-ids soft delete. A 200 means the request was applied; ids that were already gone are a no-op, not a failure, so a re-sent batch is safe. + Result of a by-ids delete. A 200 means the request was applied; ids that were already gone are a no-op, not a failure, so a re-sent batch is safe. """ # noqa: E501 memory_type: StrictStr = Field(description="The memory type the request named.") success: StrictBool = Field(description="Always true on a 200 — the batch was applied. Failures use the error envelope instead.") deleted: StrictInt = Field(description="Records this request removed. Ids that were absent, already deleted, another tenant's or (with `user_id`) another user's are skipped and count 0 alike.") + rebuild_required: Optional[StrictBool] = Field(default=False, description="True when derived memories built from the deleted ones were kept and may still contain their content; call /memory/rebuild to regenerate them.") + targets: Optional[List[StrictStr]] = Field(default=None, description="What /memory/rebuild would regenerate; empty when nothing.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["memory_type", "success", "deleted"] + __properties: ClassVar[List[str]] = ["memory_type", "success", "deleted", "rebuild_required", "targets"] + + @field_validator('targets') + def targets_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['profile', 'session_summary', 'skill']): + raise ValueError("each list item must be one of ('profile', 'session_summary', 'skill')") + return value model_config = ConfigDict( populate_by_name=True, @@ -93,7 +106,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "memory_type": obj.get("memory_type"), "success": obj.get("success"), - "deleted": obj.get("deleted") + "deleted": obj.get("deleted"), + "rebuild_required": obj.get("rebuild_required") if obj.get("rebuild_required") is not None else False, + "targets": obj.get("targets") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/everos_cloud/models/delete_by_ids_input.py b/everos_cloud/models/delete_by_ids_input.py index c8d4884..5aa9089 100644 --- a/everos_cloud/models/delete_by_ids_input.py +++ b/everos_cloud/models/delete_by_ids_input.py @@ -27,14 +27,16 @@ class DeleteByIdsInput(BaseModel): """ - Soft-delete the named memory records [Cloud-only]. + Permanently delete the named memory records [Cloud-only]. """ # noqa: E501 memory_type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Kind of the memories being deleted. Only \"episode\" is accepted today.") memory_ids: Annotated[List[StrictStr], Field(min_length=1, max_length=50)] = Field(description="1 to 50 memory ids. Every one must be well-formed; duplicates are collapsed.") reason: Optional[Reason] = None user_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=256)]] = None + app_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = None + project_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["memory_type", "memory_ids", "reason", "user_id"] + __properties: ClassVar[List[str]] = ["memory_type", "memory_ids", "reason", "user_id", "app_id", "project_id"] model_config = ConfigDict( populate_by_name=True, @@ -95,6 +97,16 @@ def to_dict(self) -> Dict[str, Any]: if self.user_id is None and "user_id" in self.model_fields_set: _dict['user_id'] = None + # set to None if app_id (nullable) is None + # and model_fields_set contains the field + if self.app_id is None and "app_id" in self.model_fields_set: + _dict['app_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + return _dict @classmethod @@ -110,7 +122,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "memory_type": obj.get("memory_type"), "memory_ids": obj.get("memory_ids"), "reason": Reason.from_dict(obj["reason"]) if obj.get("reason") is not None else None, - "user_id": obj.get("user_id") + "user_id": obj.get("user_id"), + "app_id": obj.get("app_id"), + "project_id": obj.get("project_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/everos_cloud/models/delete_data.py b/everos_cloud/models/delete_data.py index 0e4a0b8..697fb13 100644 --- a/everos_cloud/models/delete_data.py +++ b/everos_cloud/models/delete_data.py @@ -18,19 +18,32 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self class DeleteData(BaseModel): """ - Delete result (mirrors v1 ``DeleteMemoriesResult``): which scope filters were applied + how many mongo records were soft-deleted across all memory types. + Delete result (mirrors v1 ``DeleteMemoriesResult``): which scope filters were applied + how many mongo records were deleted across all memory types. """ # noqa: E501 filters: Optional[List[StrictStr]] = Field(default=None, description="Scope filters used, e.g. ['user_id'] or ['user_id', 'session_id']") - count: Optional[StrictInt] = Field(default=0, description="Total memory records soft-deleted") + count: Optional[StrictInt] = Field(default=0, description="Total memory records deleted") + rebuild_required: Optional[StrictBool] = Field(default=False, description="True when derived memories built from the deleted ones were kept and may still contain their content; call /memory/rebuild to regenerate them.") + targets: Optional[List[StrictStr]] = Field(default=None, description="What /memory/rebuild would regenerate; empty when nothing.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["filters", "count"] + __properties: ClassVar[List[str]] = ["filters", "count", "rebuild_required", "targets"] + + @field_validator('targets') + def targets_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['profile', 'session_summary', 'skill']): + raise ValueError("each list item must be one of ('profile', 'session_summary', 'skill')") + return value model_config = ConfigDict( populate_by_name=True, @@ -91,7 +104,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "filters": obj.get("filters"), - "count": obj.get("count") if obj.get("count") is not None else 0 + "count": obj.get("count") if obj.get("count") is not None else 0, + "rebuild_required": obj.get("rebuild_required") if obj.get("rebuild_required") is not None else False, + "targets": obj.get("targets") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/everos_cloud/models/profile_item.py b/everos_cloud/models/profile_item.py index 19c4a7d..76c3f6d 100644 --- a/everos_cloud/models/profile_item.py +++ b/everos_cloud/models/profile_item.py @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -35,8 +35,9 @@ class ProfileItem(BaseModel): profile_data: Optional[Dict[str, Any]] = Field(default=None, description="The profile itself — the explicit_info and implicit_traits items maintained by extraction and by /api/v2/memory/edit. Each item's id is what an edit operation targets.") created_at: Optional[datetime] = None updated_at: Optional[datetime] = None + stale: Optional[StrictBool] = Field(default=False, description="True when memories this profile was built from have been deleted; it may still contain information from them until /memory/rebuild is called. During a rebuild it stays true, and the profile holds only its manually edited items plus what has been re-extracted so far.") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "app_id", "project_id", "user_id", "profile_data", "created_at", "updated_at"] + __properties: ClassVar[List[str]] = ["id", "app_id", "project_id", "user_id", "profile_data", "created_at", "updated_at", "stale"] model_config = ConfigDict( populate_by_name=True, @@ -112,7 +113,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "user_id": obj.get("user_id"), "profile_data": obj.get("profile_data"), "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at") + "updated_at": obj.get("updated_at"), + "stale": obj.get("stale") if obj.get("stale") is not None else False }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/everos_cloud/models/rebuild_data.py b/everos_cloud/models/rebuild_data.py new file mode 100644 index 0000000..31ab491 --- /dev/null +++ b/everos_cloud/models/rebuild_data.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RebuildData(BaseModel): + """ + RebuildData + """ # noqa: E501 + job_id: Optional[StrictStr] = None + status: StrictStr = Field(description="queued: a job was started. already_running: the owner's running job is returned instead of starting another. nothing_to_do: nothing is marked stale (and force is false). dry_run: what would be rebuilt.") + targets: Optional[List[StrictStr]] = Field(default=None, description="What the job rebuilds (or would)") + estimated_episodes: Optional[StrictInt] = Field(default=0, description="Episodes a profile rebuild re-reads (a cost hint; 0 without profile)") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["job_id", "status", "targets", "estimated_episodes"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['queued', 'already_running', 'nothing_to_do', 'dry_run']): + raise ValueError("must be one of enum values ('queued', 'already_running', 'nothing_to_do', 'dry_run')") + return value + + @field_validator('targets') + def targets_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['profile', 'session_summary', 'skill']): + raise ValueError("each list item must be one of ('profile', 'session_summary', 'skill')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RebuildData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if job_id (nullable) is None + # and model_fields_set contains the field + if self.job_id is None and "job_id" in self.model_fields_set: + _dict['job_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RebuildData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "job_id": obj.get("job_id"), + "status": obj.get("status"), + "targets": obj.get("targets"), + "estimated_episodes": obj.get("estimated_episodes") if obj.get("estimated_episodes") is not None else 0 + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/rebuild_input.py b/everos_cloud/models/rebuild_input.py new file mode 100644 index 0000000..8829c06 --- /dev/null +++ b/everos_cloud/models/rebuild_input.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RebuildInput(BaseModel): + """ + RebuildInput + """ # noqa: E501 + app_id: Optional[Annotated[str, Field(strict=True, max_length=128)]] = 'default' + project_id: Optional[Annotated[str, Field(strict=True, max_length=128)]] = 'default' + user_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=256)]] = None + agent_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=256)]] = None + targets: Optional[List[StrictStr]] = None + force: Optional[StrictBool] = Field(default=False, description="Rebuild the profile / every skill cluster even when nothing is marked stale. Session summaries are only rebuilt when marked.") + dry_run: Optional[StrictBool] = Field(default=False, description="Report what would be rebuilt; start no job and spend nothing.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["app_id", "project_id", "user_id", "agent_id", "targets", "force", "dry_run"] + + @field_validator('targets') + def targets_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['profile', 'session_summary', 'skill']): + raise ValueError("each list item must be one of ('profile', 'session_summary', 'skill')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RebuildInput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if user_id (nullable) is None + # and model_fields_set contains the field + if self.user_id is None and "user_id" in self.model_fields_set: + _dict['user_id'] = None + + # set to None if agent_id (nullable) is None + # and model_fields_set contains the field + if self.agent_id is None and "agent_id" in self.model_fields_set: + _dict['agent_id'] = None + + # set to None if targets (nullable) is None + # and model_fields_set contains the field + if self.targets is None and "targets" in self.model_fields_set: + _dict['targets'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RebuildInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app_id": obj.get("app_id") if obj.get("app_id") is not None else 'default', + "project_id": obj.get("project_id") if obj.get("project_id") is not None else 'default', + "user_id": obj.get("user_id"), + "agent_id": obj.get("agent_id"), + "targets": obj.get("targets"), + "force": obj.get("force") if obj.get("force") is not None else False, + "dry_run": obj.get("dry_run") if obj.get("dry_run") is not None else False + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/rebuild_progress.py b/everos_cloud/models/rebuild_progress.py new file mode 100644 index 0000000..09cd1bc --- /dev/null +++ b/everos_cloud/models/rebuild_progress.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RebuildProgress(BaseModel): + """ + RebuildProgress + """ # noqa: E501 + units_total: StrictInt = Field(description="Work items the job fanned out") + units_done: StrictInt = Field(description="Work items finished") + episodes_fed: Optional[StrictInt] = Field(default=0, description="Episodes the profile rebuild has read so far") + estimated_episodes: Optional[StrictInt] = Field(default=0, description="Episodes the profile rebuild reads in total (approx.)") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["units_total", "units_done", "episodes_fed", "estimated_episodes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RebuildProgress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RebuildProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "units_total": obj.get("units_total"), + "units_done": obj.get("units_done"), + "episodes_fed": obj.get("episodes_fed") if obj.get("episodes_fed") is not None else 0, + "estimated_episodes": obj.get("estimated_episodes") if obj.get("estimated_episodes") is not None else 0 + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/rebuild_status_data.py b/everos_cloud/models/rebuild_status_data.py new file mode 100644 index 0000000..f617e08 --- /dev/null +++ b/everos_cloud/models/rebuild_status_data.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from everos_cloud.models.rebuild_progress import RebuildProgress +from typing import Optional, Set +from typing_extensions import Self + +class RebuildStatusData(BaseModel): + """ + RebuildStatusData + """ # noqa: E501 + job_id: StrictStr + status: StrictStr + targets: Optional[List[StrictStr]] = None + progress: RebuildProgress + error: Optional[StrictStr] = None + created_at: Optional[datetime] = None + finished_at: Optional[datetime] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["job_id", "status", "targets", "progress", "error", "created_at", "finished_at"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['queued', 'running', 'succeeded', 'failed']): + raise ValueError("must be one of enum values ('queued', 'running', 'succeeded', 'failed')") + return value + + @field_validator('targets') + def targets_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['profile', 'session_summary', 'skill']): + raise ValueError("each list item must be one of ('profile', 'session_summary', 'skill')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RebuildStatusData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of progress + if self.progress: + _dict['progress'] = self.progress.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if created_at (nullable) is None + # and model_fields_set contains the field + if self.created_at is None and "created_at" in self.model_fields_set: + _dict['created_at'] = None + + # set to None if finished_at (nullable) is None + # and model_fields_set contains the field + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict['finished_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RebuildStatusData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "job_id": obj.get("job_id"), + "status": obj.get("status"), + "targets": obj.get("targets"), + "progress": RebuildProgress.from_dict(obj["progress"]) if obj.get("progress") is not None else None, + "error": obj.get("error"), + "created_at": obj.get("created_at"), + "finished_at": obj.get("finished_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/rebuild_status_input.py b/everos_cloud/models/rebuild_status_input.py new file mode 100644 index 0000000..de25447 --- /dev/null +++ b/everos_cloud/models/rebuild_status_input.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RebuildStatusInput(BaseModel): + """ + RebuildStatusInput + """ # noqa: E501 + job_id: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="From /memory/rebuild") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["job_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RebuildStatusInput from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RebuildStatusInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "job_id": obj.get("job_id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/search_data.py b/everos_cloud/models/search_data.py index ffb145b..e0c64be 100644 --- a/everos_cloud/models/search_data.py +++ b/everos_cloud/models/search_data.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from everos_cloud.models.search_agent_case_item import SearchAgentCaseItem from everos_cloud.models.search_agent_skill_item import SearchAgentSkillItem @@ -37,8 +37,9 @@ class SearchData(BaseModel): agent_cases: Optional[List[SearchAgentCaseItem]] = Field(default=None, description="Matching agent cases, for an agent owner.") agent_skills: Optional[List[SearchAgentSkillItem]] = Field(default=None, description="Matching agent skills, for an agent owner.") unprocessed_messages: Optional[List[UnprocessedMessageDTO]] = Field(default=None, description="Raw buffered messages not yet extracted. Returned only when the request filtered on a single `session_id`, so a caller can see what is still in flight.") + answer: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["episodes", "profiles", "agent_cases", "agent_skills", "unprocessed_messages"] + __properties: ClassVar[List[str]] = ["episodes", "profiles", "agent_cases", "agent_skills", "unprocessed_messages", "answer"] model_config = ConfigDict( populate_by_name=True, @@ -121,6 +122,11 @@ def to_dict(self) -> Dict[str, Any]: for _key, _value in self.additional_properties.items(): _dict[_key] = _value + # set to None if answer (nullable) is None + # and model_fields_set contains the field + if self.answer is None and "answer" in self.model_fields_set: + _dict['answer'] = None + return _dict @classmethod @@ -137,7 +143,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "profiles": [SearchProfileItem.from_dict(_item) for _item in obj["profiles"]] if obj.get("profiles") is not None else None, "agent_cases": [SearchAgentCaseItem.from_dict(_item) for _item in obj["agent_cases"]] if obj.get("agent_cases") is not None else None, "agent_skills": [SearchAgentSkillItem.from_dict(_item) for _item in obj["agent_skills"]] if obj.get("agent_skills") is not None else None, - "unprocessed_messages": [UnprocessedMessageDTO.from_dict(_item) for _item in obj["unprocessed_messages"]] if obj.get("unprocessed_messages") is not None else None + "unprocessed_messages": [UnprocessedMessageDTO.from_dict(_item) for _item in obj["unprocessed_messages"]] if obj.get("unprocessed_messages") is not None else None, + "answer": obj.get("answer") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/everos_cloud/models/search_profile_item.py b/everos_cloud/models/search_profile_item.py index 85528cb..425b744 100644 --- a/everos_cloud/models/search_profile_item.py +++ b/everos_cloud/models/search_profile_item.py @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self @@ -35,9 +35,10 @@ class SearchProfileItem(BaseModel): profile_data: Optional[Dict[str, Any]] = Field(default=None, description="The profile itself — the explicit_info and implicit_traits items maintained by extraction and by /api/v2/memory/edit. Each item's id is what an edit operation targets.") created_at: Optional[datetime] = None updated_at: Optional[datetime] = None + stale: Optional[StrictBool] = Field(default=False, description="True when memories this profile was built from have been deleted; it may still contain information from them until /memory/rebuild is called. During a rebuild it stays true, and the profile holds only its manually edited items plus what has been re-extracted so far.") score: Optional[Union[StrictFloat, StrictInt]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "app_id", "project_id", "user_id", "profile_data", "created_at", "updated_at", "score"] + __properties: ClassVar[List[str]] = ["id", "app_id", "project_id", "user_id", "profile_data", "created_at", "updated_at", "stale", "score"] model_config = ConfigDict( populate_by_name=True, @@ -119,6 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "profile_data": obj.get("profile_data"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), + "stale": obj.get("stale") if obj.get("stale") is not None else False, "score": obj.get("score") }) # store additional fields in additional_properties diff --git a/everos_cloud/models/success_envelope_rebuild_data.py b/everos_cloud/models/success_envelope_rebuild_data.py new file mode 100644 index 0000000..d34346e --- /dev/null +++ b/everos_cloud/models/success_envelope_rebuild_data.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from everos_cloud.models.rebuild_data import RebuildData +from typing import Optional, Set +from typing_extensions import Self + +class SuccessEnvelopeRebuildData(BaseModel): + """ + SuccessEnvelopeRebuildData + """ # noqa: E501 + request_id: StrictStr = Field(description="Request trace id (peer to data)") + data: RebuildData = Field(description="Endpoint-defined business result") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["request_id", "data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SuccessEnvelopeRebuildData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SuccessEnvelopeRebuildData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "request_id": obj.get("request_id"), + "data": RebuildData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/success_envelope_rebuild_status_data.py b/everos_cloud/models/success_envelope_rebuild_status_data.py new file mode 100644 index 0000000..cfcb0a3 --- /dev/null +++ b/everos_cloud/models/success_envelope_rebuild_status_data.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from everos_cloud.models.rebuild_status_data import RebuildStatusData +from typing import Optional, Set +from typing_extensions import Self + +class SuccessEnvelopeRebuildStatusData(BaseModel): + """ + SuccessEnvelopeRebuildStatusData + """ # noqa: E501 + request_id: StrictStr = Field(description="Request trace id (peer to data)") + data: RebuildStatusData = Field(description="Endpoint-defined business result") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["request_id", "data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SuccessEnvelopeRebuildStatusData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SuccessEnvelopeRebuildStatusData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "request_id": obj.get("request_id"), + "data": RebuildStatusData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/everos_cloud/models/update_input.py b/everos_cloud/models/update_input.py index 371bbbd..24b3ed8 100644 --- a/everos_cloud/models/update_input.py +++ b/everos_cloud/models/update_input.py @@ -35,8 +35,10 @@ class UpdateInput(BaseModel): patch: EpisodePatch = Field(description="The fields to rewrite — at least one. Fields left out keep their current value.") reason: Optional[Reason] = None user_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=256)]] = None + app_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = None + project_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["memory_type", "memory_id", "patch", "reason", "user_id"] + __properties: ClassVar[List[str]] = ["memory_type", "memory_id", "patch", "reason", "user_id", "app_id", "project_id"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +102,16 @@ def to_dict(self) -> Dict[str, Any]: if self.user_id is None and "user_id" in self.model_fields_set: _dict['user_id'] = None + # set to None if app_id (nullable) is None + # and model_fields_set contains the field + if self.app_id is None and "app_id" in self.model_fields_set: + _dict['app_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + return _dict @classmethod @@ -116,7 +128,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "memory_id": obj.get("memory_id"), "patch": EpisodePatch.from_dict(obj["patch"]) if obj.get("patch") is not None else None, "reason": Reason.from_dict(obj["reason"]) if obj.get("reason") is not None else None, - "user_id": obj.get("user_id") + "user_id": obj.get("user_id"), + "app_id": obj.get("app_id"), + "project_id": obj.get("project_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/openapi.json b/openapi.json index a61ddae..9159ce6 100644 --- a/openapi.json +++ b/openapi.json @@ -113,7 +113,7 @@ "Memory" ], "summary": "Context Retrieval [Cloud-only]", - "description": "Retrieve memories with a multi-round, LLM-driven search loop.\n\nAn LLM plans and runs several searches over the owner's memories \u2014 keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session \u2014 and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **The response contains memories, not an answer**: the model's own answer is discarded.\n\nUse it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper.\n\n**Request** \u2014 the same body as `/search`, except:\n- `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories.\n- `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422.\n- `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score.\n- `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them.\n\n**Response** \u2014 the same `SearchData` shape as `/search`:\n- The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`.\n- `episodes[].cited` is `true` for memories the model named as the ones its answer rested on.\n- `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01\u20130.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores.\n\n**Limits** \u2014 by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned.\n\n**Latency** \u2014 several LLM calls per request, so noticeably slower than `/search`.", + "description": "Retrieve memories with a multi-round, LLM-driven search loop.\n\nAn LLM plans and runs several searches over the owner's memories \u2014 keyword, semantic, hybrid, topic-cluster, and reading the surrounding conversation or a whole session \u2014 and keeps searching until it judges the evidence sufficient to answer `query`. The memories it found are returned. **By default the response contains memories, not an answer**: the model's own answer is discarded. A deployment can enable answer mode, which also returns that answer in `answer`.\n\nUse it for questions a single search answers poorly: multi-hop, temporal, or spread across several conversations. For simple lookups, `/search` is faster and cheaper.\n\n**Request** \u2014 the same body as `/search`, except:\n- `user_id` is required and `agent_id` is not accepted (422): the loop searches a user's memories only. Use `/search` for agent memories.\n- `method` is fixed to `\"context\"`. It can be omitted; any other value is a 422.\n- `min_score` is not supported (422): results are ranked by rank fusion, not by a similarity score.\n- `radius`, `enable_llm_rerank` and `with_readable_episode` are not accepted (422): the loop does not use them.\n\n**Response** \u2014 the same `SearchData` shape as `/search`:\n- The loop returns its memories in `episodes`. `profiles` (`include_profile`) and `unprocessed_messages` (a top-level `session_id` filter) are filled exactly as on `/search`.\n- `episodes[].cited` is `true` for memories the model named as the ones its answer rested on.\n- `episodes[].score` is a rank-fusion score, not a similarity: roughly 0.01\u20130.05, plus 1.0 for a cited memory, so cited memories come first. It is not comparable with `/search` scores.\n- In answer mode, `answer` holds the model's answer (\"\" if it gave none), cited memories come first **in the order the model cited them**, and each cited score is above every uncited one. Without answer mode, `answer` is absent.\n\n**Limits** \u2014 by default at most 5 LLM rounds and 45 seconds per request. Reaching a limit is not an error: the memories found so far are returned.\n\n**Latency** \u2014 several LLM calls per request, so noticeably slower than `/search`.", "operationId": "retrieveContext", "requestBody": { "content": { @@ -276,7 +276,7 @@ "tags": [ "Memory" ], - "summary": "Soft-delete memory records by id [Cloud-only]", + "summary": "Delete memory records by id [Cloud-only]", "operationId": "deleteMemoriesByIds", "requestBody": { "content": { @@ -928,6 +928,89 @@ "description": "Read a purge job by the `job_id` that /api/v2/memory/purge/confirm returned.\n\n`status` goes `queued` \u2192 `running` \u2192 `succeeded` or `failed`. `steps` lists every store the purge touches (for example `mongo:v2_episodes` or `es:episode`) with its own state and deleted count, and `error` for a store that failed.\n\nWrites to the memory space are rejected with `409 purge_in_progress` until the job has ended, so poll this before writing again." } }, + "/api/v2/memory/rebuild": { + "post": { + "tags": [ + "Memory" + ], + "summary": "Rebuild derived memories a delete left stale [Cloud-only]", + "description": "Deletes never spend LLM calls: a derived memory that can only be regenerated by an LLM (the profile, session summaries, agent skills) is kept and marked stale (`rebuild_required` / `targets` on the delete response, `stale` on the profile). This call starts one background job that regenerates the marked ones from the remaining memories. Free; the extraction it runs is metered like any extraction, so like `add` it is refused with 429 once the account's mcu balance is exhausted. One active job per owner: a second call returns the running job. Poll `/memory/rebuild/status` with the returned `job_id`.\n\nWhile a profile rebuild runs, the profile holds only its manually edited items plus what has been re-extracted so far: the LLM-generated items are cleared when the job starts and come back batch by batch. `stale` stays `true` until the job finishes.", + "operationId": "rebuildMemory", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RebuildInput" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessEnvelope_RebuildData_" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v2/memory/rebuild/status": { + "post": { + "tags": [ + "Memory" + ], + "summary": "Status of a rebuild job [Cloud-only]", + "operationId": "getRebuildStatus", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RebuildStatusInput" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessEnvelope_RebuildStatusData_" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/api/v2/memory/search": { "post": { "tags": [ @@ -4480,6 +4563,25 @@ "type": "integer", "title": "Deleted", "description": "Records this request removed. Ids that were absent, already deleted, another tenant's or (with `user_id`) another user's are skipped and count 0 alike." + }, + "rebuild_required": { + "type": "boolean", + "title": "Rebuild Required", + "description": "True when derived memories built from the deleted ones were kept and may still contain their content; call /memory/rebuild to regenerate them.", + "default": false + }, + "targets": { + "items": { + "type": "string", + "enum": [ + "profile", + "session_summary", + "skill" + ] + }, + "type": "array", + "title": "Targets", + "description": "What /memory/rebuild would regenerate; empty when nothing." } }, "type": "object", @@ -4489,7 +4591,7 @@ "deleted" ], "title": "DeleteByIdsData", - "description": "Result of a by-ids soft delete. A 200 means the request was applied; ids that\nwere already gone are a no-op, not a failure, so a re-sent batch is safe." + "description": "Result of a by-ids delete. A 200 means the request was applied; ids that\nwere already gone are a no-op, not a failure, so a re-sent batch is safe." }, "DeleteByIdsInput": { "properties": { @@ -4533,6 +4635,34 @@ ], "title": "User Id", "description": "Optional owner guard. When set, ids owned by anyone else are skipped like absent ones. Set it from your own session, not from model output." + }, + "app_id": { + "anyOf": [ + { + "type": "string", + "maxLength": 128, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "App Id", + "description": "If set, only a record in this app is affected; any other record is treated as not found." + }, + "project_id": { + "anyOf": [ + { + "type": "string", + "maxLength": 128, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "Project Id", + "description": "If set, only a record in this project is affected; any other record is treated as not found." } }, "additionalProperties": false, @@ -4542,7 +4672,7 @@ "memory_ids" ], "title": "DeleteByIdsInput", - "description": "Soft-delete the named memory records [Cloud-only].", + "description": "Permanently delete the named memory records [Cloud-only].", "example": { "memory_type": "episode", "memory_ids": [ @@ -4568,13 +4698,32 @@ "count": { "type": "integer", "title": "Count", - "description": "Total memory records soft-deleted", + "description": "Total memory records deleted", "default": 0 + }, + "rebuild_required": { + "type": "boolean", + "title": "Rebuild Required", + "description": "True when derived memories built from the deleted ones were kept and may still contain their content; call /memory/rebuild to regenerate them.", + "default": false + }, + "targets": { + "items": { + "type": "string", + "enum": [ + "profile", + "session_summary", + "skill" + ] + }, + "type": "array", + "title": "Targets", + "description": "What /memory/rebuild would regenerate; empty when nothing." } }, "type": "object", "title": "DeleteData", - "description": "Delete result (mirrors v1 ``DeleteMemoriesResult``): which scope filters were\napplied + how many mongo records were soft-deleted across all memory types." + "description": "Delete result (mirrors v1 ``DeleteMemoriesResult``): which scope filters were\napplied + how many mongo records were deleted across all memory types." }, "DeleteInput": { "properties": { @@ -6318,6 +6467,12 @@ ], "title": "Updated At", "description": "When it last changed." + }, + "stale": { + "type": "boolean", + "title": "Stale", + "description": "True when memories this profile was built from have been deleted; it may still contain information from them until /memory/rebuild is called. During a rebuild it stays true, and the profile holds only its manually edited items plus what has been re-extracted so far.", + "default": false } }, "type": "object", @@ -6731,6 +6886,261 @@ "title": "Reason", "description": "Why the operator made the change. OPTIONAL on both ops: it is recorded on the\naudit event for quality analysis, never used to gate anything. When given, ``code``\nis required and ``note`` is free text." }, + "RebuildData": { + "properties": { + "job_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Job Id", + "description": "Rebuild job id; null when no job was started (nothing_to_do, dry_run)" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "already_running", + "nothing_to_do", + "dry_run" + ], + "title": "Status", + "description": "queued: a job was started. already_running: the owner's running job is returned instead of starting another. nothing_to_do: nothing is marked stale (and force is false). dry_run: what would be rebuilt." + }, + "targets": { + "items": { + "type": "string", + "enum": [ + "profile", + "session_summary", + "skill" + ] + }, + "type": "array", + "title": "Targets", + "description": "What the job rebuilds (or would)" + }, + "estimated_episodes": { + "type": "integer", + "title": "Estimated Episodes", + "description": "Episodes a profile rebuild re-reads (a cost hint; 0 without profile)", + "default": 0 + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "RebuildData" + }, + "RebuildInput": { + "properties": { + "app_id": { + "type": "string", + "maxLength": 128, + "title": "App Id", + "default": "default" + }, + "project_id": { + "type": "string", + "maxLength": 128, + "title": "Project Id", + "default": "default" + }, + "user_id": { + "anyOf": [ + { + "type": "string", + "maxLength": 256, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "User Id", + "description": "The user whose profile / session summaries to rebuild" + }, + "agent_id": { + "anyOf": [ + { + "type": "string", + "maxLength": 256, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "Agent Id", + "description": "The agent whose skills to rebuild" + }, + "targets": { + "anyOf": [ + { + "items": { + "type": "string", + "enum": [ + "profile", + "session_summary", + "skill" + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Targets", + "description": "Subset to rebuild. Default: everything marked stale for this owner. user_id \u2192 profile, session_summary; agent_id \u2192 skill." + }, + "force": { + "type": "boolean", + "title": "Force", + "description": "Rebuild the profile / every skill cluster even when nothing is marked stale. Session summaries are only rebuilt when marked.", + "default": false + }, + "dry_run": { + "type": "boolean", + "title": "Dry Run", + "description": "Report what would be rebuilt; start no job and spend nothing.", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "RebuildInput" + }, + "RebuildProgress": { + "properties": { + "units_total": { + "type": "integer", + "title": "Units Total", + "description": "Work items the job fanned out" + }, + "units_done": { + "type": "integer", + "title": "Units Done", + "description": "Work items finished" + }, + "episodes_fed": { + "type": "integer", + "title": "Episodes Fed", + "description": "Episodes the profile rebuild has read so far", + "default": 0 + }, + "estimated_episodes": { + "type": "integer", + "title": "Estimated Episodes", + "description": "Episodes the profile rebuild reads in total (approx.)", + "default": 0 + } + }, + "type": "object", + "required": [ + "units_total", + "units_done" + ], + "title": "RebuildProgress" + }, + "RebuildStatusData": { + "properties": { + "job_id": { + "type": "string", + "title": "Job Id" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "running", + "succeeded", + "failed" + ], + "title": "Status" + }, + "targets": { + "items": { + "type": "string", + "enum": [ + "profile", + "session_summary", + "skill" + ] + }, + "type": "array", + "title": "Targets" + }, + "progress": { + "$ref": "#/components/schemas/RebuildProgress" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error", + "description": "Why the job failed (failed jobs only)" + }, + "created_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "finished_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "Finished At" + } + }, + "type": "object", + "required": [ + "job_id", + "status", + "progress" + ], + "title": "RebuildStatusData" + }, + "RebuildStatusInput": { + "properties": { + "job_id": { + "type": "string", + "maxLength": 64, + "minLength": 1, + "title": "Job Id", + "description": "From /memory/rebuild" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "job_id" + ], + "title": "RebuildStatusInput" + }, "RelatedTagUsageBody": { "properties": { "tag_ids": { @@ -7141,6 +7551,18 @@ "type": "array", "title": "Unprocessed Messages", "description": "Raw buffered messages not yet extracted. Returned only when the request filtered on a single `session_id`, so a caller can see what is still in flight." + }, + "answer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Answer", + "description": "`/context` only, when the deployment enables answer mode: the retrieval model's answer to `query`, grounded in the cited `episodes`. An empty string means the loop ended without one. Absent otherwise." } }, "type": "object", @@ -7687,6 +8109,12 @@ "title": "Updated At", "description": "When it last changed." }, + "stale": { + "type": "boolean", + "title": "Stale", + "description": "True when memories this profile was built from have been deleted; it may still contain information from them until /memory/rebuild is called. During a rebuild it stays true, and the profile holds only its manually edited items plus what has been re-extracted so far.", + "default": false + }, "score": { "anyOf": [ { @@ -8108,6 +8536,44 @@ ], "title": "SuccessEnvelope[PurgeRequestData]" }, + "SuccessEnvelope_RebuildData_": { + "properties": { + "request_id": { + "type": "string", + "title": "Request Id", + "description": "Request trace id (peer to data)" + }, + "data": { + "$ref": "#/components/schemas/RebuildData", + "description": "Endpoint-defined business result" + } + }, + "type": "object", + "required": [ + "request_id", + "data" + ], + "title": "SuccessEnvelope[RebuildData]" + }, + "SuccessEnvelope_RebuildStatusData_": { + "properties": { + "request_id": { + "type": "string", + "title": "Request Id", + "description": "Request trace id (peer to data)" + }, + "data": { + "$ref": "#/components/schemas/RebuildStatusData", + "description": "Endpoint-defined business result" + } + }, + "type": "object", + "required": [ + "request_id", + "data" + ], + "title": "SuccessEnvelope[RebuildStatusData]" + }, "SuccessEnvelope_RelatedTagUsageListData_": { "properties": { "request_id": { @@ -9381,6 +9847,34 @@ ], "title": "User Id", "description": "Optional owner guard. When set, a record owned by anyone else is a 404, like an absent one. Set it from your own session, not from model output." + }, + "app_id": { + "anyOf": [ + { + "type": "string", + "maxLength": 128, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "App Id", + "description": "If set, only a record in this app is affected; any other record is treated as not found." + }, + "project_id": { + "anyOf": [ + { + "type": "string", + "maxLength": 128, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "Project Id", + "description": "If set, only a record in this project is affected; any other record is treated as not found." } }, "additionalProperties": false, diff --git a/pyproject.toml b/pyproject.toml index 3797a46..66a008b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "everos_cloud" -version = "1.3.0-rc3" +version = "1.3.0-rc4" description = "EverOS Cloud Memory API" authors = ["EverMind AI "] license = "Apache-2.0" diff --git a/setup.py b/setup.py index 56d5df0..eafb467 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "everos-cloud" -VERSION = "1.3.0-rc3" +VERSION = "1.3.0-rc4" # Floor = the oldest interpreter CI actually runs (see .github/workflows/ci.yml in # the public repo). Nothing in the generated code needs it this high — the tree # parses as 3.8 — so this is a support policy, not a technical bound, and it is set diff --git a/test/test_delete_by_ids_data.py b/test/test_delete_by_ids_data.py index 9619688..4ac900a 100644 --- a/test/test_delete_by_ids_data.py +++ b/test/test_delete_by_ids_data.py @@ -38,7 +38,11 @@ def make_instance(self, include_optional) -> DeleteByIdsData: return DeleteByIdsData( memory_type = '', success = True, - deleted = 56 + deleted = 56, + rebuild_required = True, + targets = [ + 'profile' + ] ) else: return DeleteByIdsData( diff --git a/test/test_delete_by_ids_input.py b/test/test_delete_by_ids_input.py index 7abaa7f..d53e3c5 100644 --- a/test/test_delete_by_ids_input.py +++ b/test/test_delete_by_ids_input.py @@ -41,7 +41,9 @@ def make_instance(self, include_optional) -> DeleteByIdsInput: '' ], reason = { }, - user_id = '0' + user_id = '0', + app_id = '0', + project_id = '0' ) else: return DeleteByIdsInput( diff --git a/test/test_delete_data.py b/test/test_delete_data.py index d27f242..cfe67f0 100644 --- a/test/test_delete_data.py +++ b/test/test_delete_data.py @@ -39,7 +39,11 @@ def make_instance(self, include_optional) -> DeleteData: filters = [ '' ], - count = 56 + count = 56, + rebuild_required = True, + targets = [ + 'profile' + ] ) else: return DeleteData( diff --git a/test/test_get_data.py b/test/test_get_data.py index f19e7eb..c995d77 100644 --- a/test/test_get_data.py +++ b/test/test_get_data.py @@ -71,7 +71,8 @@ def make_instance(self, include_optional) -> GetData: user_id = '', profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, ) ], agent_cases = [ everos_cloud.models.agent_case_item.AgentCaseItem( diff --git a/test/test_memory_api.py b/test/test_memory_api.py index d7bd552..7c013d1 100644 --- a/test/test_memory_api.py +++ b/test/test_memory_api.py @@ -51,7 +51,7 @@ def test_confirm_purge(self) -> None: def test_delete_memories_by_ids(self) -> None: """Test case for delete_memories_by_ids - Soft-delete memory records by id [Cloud-only] + Delete memory records by id [Cloud-only] """ pass @@ -90,6 +90,20 @@ def test_get_purge_job(self) -> None: """ pass + def test_get_rebuild_status(self) -> None: + """Test case for get_rebuild_status + + Status of a rebuild job [Cloud-only] + """ + pass + + def test_rebuild_memory(self) -> None: + """Test case for rebuild_memory + + Rebuild derived memories a delete left stale [Cloud-only] + """ + pass + def test_replace_tags(self) -> None: """Test case for replace_tags diff --git a/test/test_profile_item.py b/test/test_profile_item.py index 0b914ae..870b33f 100644 --- a/test/test_profile_item.py +++ b/test/test_profile_item.py @@ -42,7 +42,8 @@ def make_instance(self, include_optional) -> ProfileItem: user_id = '', profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True ) else: return ProfileItem( diff --git a/test/test_rebuild_data.py b/test/test_rebuild_data.py new file mode 100644 index 0000000..b07ad91 --- /dev/null +++ b/test/test_rebuild_data.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.rebuild_data import RebuildData + +class TestRebuildData(unittest.TestCase): + """RebuildData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RebuildData: + """Test RebuildData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RebuildData` + """ + model = RebuildData() + if include_optional: + return RebuildData( + job_id = '', + status = 'queued', + targets = [ + 'profile' + ], + estimated_episodes = 56 + ) + else: + return RebuildData( + status = 'queued', + ) + """ + + def testRebuildData(self): + """Test RebuildData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_rebuild_input.py b/test/test_rebuild_input.py new file mode 100644 index 0000000..2d75536 --- /dev/null +++ b/test/test_rebuild_input.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.rebuild_input import RebuildInput + +class TestRebuildInput(unittest.TestCase): + """RebuildInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RebuildInput: + """Test RebuildInput + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RebuildInput` + """ + model = RebuildInput() + if include_optional: + return RebuildInput( + app_id = 'default', + project_id = 'default', + user_id = '0', + agent_id = '0', + targets = [ + 'profile' + ], + force = True, + dry_run = True + ) + else: + return RebuildInput( + ) + """ + + def testRebuildInput(self): + """Test RebuildInput""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_rebuild_progress.py b/test/test_rebuild_progress.py new file mode 100644 index 0000000..798ffe3 --- /dev/null +++ b/test/test_rebuild_progress.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.rebuild_progress import RebuildProgress + +class TestRebuildProgress(unittest.TestCase): + """RebuildProgress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RebuildProgress: + """Test RebuildProgress + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RebuildProgress` + """ + model = RebuildProgress() + if include_optional: + return RebuildProgress( + units_total = 56, + units_done = 56, + episodes_fed = 56, + estimated_episodes = 56 + ) + else: + return RebuildProgress( + units_total = 56, + units_done = 56, + ) + """ + + def testRebuildProgress(self): + """Test RebuildProgress""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_rebuild_status_data.py b/test/test_rebuild_status_data.py new file mode 100644 index 0000000..ec7accb --- /dev/null +++ b/test/test_rebuild_status_data.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.rebuild_status_data import RebuildStatusData + +class TestRebuildStatusData(unittest.TestCase): + """RebuildStatusData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RebuildStatusData: + """Test RebuildStatusData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RebuildStatusData` + """ + model = RebuildStatusData() + if include_optional: + return RebuildStatusData( + job_id = '', + status = 'queued', + targets = [ + 'profile' + ], + progress = everos_cloud.models.rebuild_progress.RebuildProgress( + units_total = 56, + units_done = 56, + episodes_fed = 56, + estimated_episodes = 56, ), + error = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finished_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return RebuildStatusData( + job_id = '', + status = 'queued', + progress = everos_cloud.models.rebuild_progress.RebuildProgress( + units_total = 56, + units_done = 56, + episodes_fed = 56, + estimated_episodes = 56, ), + ) + """ + + def testRebuildStatusData(self): + """Test RebuildStatusData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_rebuild_status_input.py b/test/test_rebuild_status_input.py new file mode 100644 index 0000000..58ee46b --- /dev/null +++ b/test/test_rebuild_status_input.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.rebuild_status_input import RebuildStatusInput + +class TestRebuildStatusInput(unittest.TestCase): + """RebuildStatusInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RebuildStatusInput: + """Test RebuildStatusInput + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RebuildStatusInput` + """ + model = RebuildStatusInput() + if include_optional: + return RebuildStatusInput( + job_id = '0' + ) + else: + return RebuildStatusInput( + job_id = '0', + ) + """ + + def testRebuildStatusInput(self): + """Test RebuildStatusInput""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_search_data.py b/test/test_search_data.py index cf2fd1b..9104521 100644 --- a/test/test_search_data.py +++ b/test/test_search_data.py @@ -75,6 +75,7 @@ def make_instance(self, include_optional) -> SearchData: profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, score = 1.337, ) ], agent_cases = [ @@ -129,7 +130,8 @@ def make_instance(self, include_optional) -> SearchData: arguments = '', ), ) ], tool_call_id = '', ) - ] + ], + answer = '' ) else: return SearchData( diff --git a/test/test_search_profile_item.py b/test/test_search_profile_item.py index ca78ba4..5960ce2 100644 --- a/test/test_search_profile_item.py +++ b/test/test_search_profile_item.py @@ -43,6 +43,7 @@ def make_instance(self, include_optional) -> SearchProfileItem: profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, score = 1.337 ) else: diff --git a/test/test_success_envelope_delete_by_ids_data.py b/test/test_success_envelope_delete_by_ids_data.py index 79b1210..b153015 100644 --- a/test/test_success_envelope_delete_by_ids_data.py +++ b/test/test_success_envelope_delete_by_ids_data.py @@ -40,7 +40,11 @@ def make_instance(self, include_optional) -> SuccessEnvelopeDeleteByIdsData: data = everos_cloud.models.delete_by_ids_data.DeleteByIdsData( memory_type = '', success = True, - deleted = 56, ) + deleted = 56, + rebuild_required = True, + targets = [ + 'profile' + ], ) ) else: return SuccessEnvelopeDeleteByIdsData( @@ -48,7 +52,11 @@ def make_instance(self, include_optional) -> SuccessEnvelopeDeleteByIdsData: data = everos_cloud.models.delete_by_ids_data.DeleteByIdsData( memory_type = '', success = True, - deleted = 56, ), + deleted = 56, + rebuild_required = True, + targets = [ + 'profile' + ], ), ) """ diff --git a/test/test_success_envelope_delete_data.py b/test/test_success_envelope_delete_data.py index 98c7acd..5cb5382 100644 --- a/test/test_success_envelope_delete_data.py +++ b/test/test_success_envelope_delete_data.py @@ -41,7 +41,11 @@ def make_instance(self, include_optional) -> SuccessEnvelopeDeleteData: filters = [ '' ], - count = 56, ) + count = 56, + rebuild_required = True, + targets = [ + 'profile' + ], ) ) else: return SuccessEnvelopeDeleteData( @@ -50,7 +54,11 @@ def make_instance(self, include_optional) -> SuccessEnvelopeDeleteData: filters = [ '' ], - count = 56, ), + count = 56, + rebuild_required = True, + targets = [ + 'profile' + ], ), ) """ diff --git a/test/test_success_envelope_get_data.py b/test/test_success_envelope_get_data.py index c4ee7d1..dbeae08 100644 --- a/test/test_success_envelope_get_data.py +++ b/test/test_success_envelope_get_data.py @@ -73,7 +73,8 @@ def make_instance(self, include_optional) -> SuccessEnvelopeGetData: user_id = '', profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, ) ], agent_cases = [ everos_cloud.models.agent_case_item.AgentCaseItem( @@ -147,7 +148,8 @@ def make_instance(self, include_optional) -> SuccessEnvelopeGetData: user_id = '', profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, ) ], agent_cases = [ everos_cloud.models.agent_case_item.AgentCaseItem( diff --git a/test/test_success_envelope_rebuild_data.py b/test/test_success_envelope_rebuild_data.py new file mode 100644 index 0000000..9dcd205 --- /dev/null +++ b/test/test_success_envelope_rebuild_data.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.success_envelope_rebuild_data import SuccessEnvelopeRebuildData + +class TestSuccessEnvelopeRebuildData(unittest.TestCase): + """SuccessEnvelopeRebuildData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SuccessEnvelopeRebuildData: + """Test SuccessEnvelopeRebuildData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SuccessEnvelopeRebuildData` + """ + model = SuccessEnvelopeRebuildData() + if include_optional: + return SuccessEnvelopeRebuildData( + request_id = '', + data = everos_cloud.models.rebuild_data.RebuildData( + job_id = '', + status = 'queued', + targets = [ + 'profile' + ], + estimated_episodes = 56, ) + ) + else: + return SuccessEnvelopeRebuildData( + request_id = '', + data = everos_cloud.models.rebuild_data.RebuildData( + job_id = '', + status = 'queued', + targets = [ + 'profile' + ], + estimated_episodes = 56, ), + ) + """ + + def testSuccessEnvelopeRebuildData(self): + """Test SuccessEnvelopeRebuildData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_success_envelope_rebuild_status_data.py b/test/test_success_envelope_rebuild_status_data.py new file mode 100644 index 0000000..b703abb --- /dev/null +++ b/test/test_success_envelope_rebuild_status_data.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + EverOS Cloud Memory API + + Official Python client for the EverOS Cloud Memory API. Add, search, retrieve, and manage long-term memory for your AI applications over a typed interface (pydantic v2, with full type hints). Install and usage guides: https://github.com/EverMind-AI/everos-cloud-sdk-python + + The version of the OpenAPI document: 2.0.0 + Contact: service@evermind.ai + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from everos_cloud.models.success_envelope_rebuild_status_data import SuccessEnvelopeRebuildStatusData + +class TestSuccessEnvelopeRebuildStatusData(unittest.TestCase): + """SuccessEnvelopeRebuildStatusData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SuccessEnvelopeRebuildStatusData: + """Test SuccessEnvelopeRebuildStatusData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SuccessEnvelopeRebuildStatusData` + """ + model = SuccessEnvelopeRebuildStatusData() + if include_optional: + return SuccessEnvelopeRebuildStatusData( + request_id = '', + data = everos_cloud.models.rebuild_status_data.RebuildStatusData( + job_id = '', + status = 'queued', + targets = [ + 'profile' + ], + progress = everos_cloud.models.rebuild_progress.RebuildProgress( + units_total = 56, + units_done = 56, + episodes_fed = 56, + estimated_episodes = 56, ), + error = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finished_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ) + else: + return SuccessEnvelopeRebuildStatusData( + request_id = '', + data = everos_cloud.models.rebuild_status_data.RebuildStatusData( + job_id = '', + status = 'queued', + targets = [ + 'profile' + ], + progress = everos_cloud.models.rebuild_progress.RebuildProgress( + units_total = 56, + units_done = 56, + episodes_fed = 56, + estimated_episodes = 56, ), + error = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finished_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + ) + """ + + def testSuccessEnvelopeRebuildStatusData(self): + """Test SuccessEnvelopeRebuildStatusData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_success_envelope_search_data.py b/test/test_success_envelope_search_data.py index c002737..bd3120d 100644 --- a/test/test_success_envelope_search_data.py +++ b/test/test_success_envelope_search_data.py @@ -77,6 +77,7 @@ def make_instance(self, include_optional) -> SuccessEnvelopeSearchData: profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, score = 1.337, ) ], agent_cases = [ @@ -131,7 +132,8 @@ def make_instance(self, include_optional) -> SuccessEnvelopeSearchData: arguments = '', ), ) ], tool_call_id = '', ) - ], ) + ], + answer = '', ) ) else: return SuccessEnvelopeSearchData( @@ -176,6 +178,7 @@ def make_instance(self, include_optional) -> SuccessEnvelopeSearchData: profile_data = { }, created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + stale = True, score = 1.337, ) ], agent_cases = [ @@ -230,7 +233,8 @@ def make_instance(self, include_optional) -> SuccessEnvelopeSearchData: arguments = '', ), ) ], tool_call_id = '', ) - ], ), + ], + answer = '', ), ) """ diff --git a/test/test_update_input.py b/test/test_update_input.py index 89f2d1c..a79867f 100644 --- a/test/test_update_input.py +++ b/test/test_update_input.py @@ -40,7 +40,9 @@ def make_instance(self, include_optional) -> UpdateInput: memory_id = '0', patch = { }, reason = { }, - user_id = '0' + user_id = '0', + app_id = '0', + project_id = '0' ) else: return UpdateInput(