From f11154431fb18b9d1ff792ec4fa6d6d872a0b786 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 17:17:25 +0000 Subject: [PATCH 01/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index edf51b3c..3ecab509 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-17587551addb077f3da29dd969fcd5f57c7272b4d3d3b1707dca00b1d04b7ee8.yml -openapi_spec_hash: 261e4f33ccaac115058a54ffc28ad9f6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-388f755216226ef788347fb6a3a9ee8636e3305495ccc4fee21f2d1a5273f177.yml +openapi_spec_hash: 1fcfc982fa4336fb7c3c13100a58dea4 config_hash: 48130b77367435ca80edf565b73c49f9 From a3e6d1f6665d12629d8c16e90bcc946b18b089bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 18:45:41 +0000 Subject: [PATCH 02/32] fix(internal): resolve build failures --- scripts/lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lint b/scripts/lint index ade6bb5b..02defcf3 100755 --- a/scripts/lint +++ b/scripts/lint @@ -13,7 +13,7 @@ else fi echo "==> Running pyright" -uv run pyright +uv run pyright -p . echo "==> Running mypy" uv run mypy . From 0ecaea31a698735d137f494352a8682a794f90de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 21:17:37 +0000 Subject: [PATCH 03/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3ecab509..37498ecc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-388f755216226ef788347fb6a3a9ee8636e3305495ccc4fee21f2d1a5273f177.yml -openapi_spec_hash: 1fcfc982fa4336fb7c3c13100a58dea4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-d4b4571c634ebdda12ec7dd7bf38054f5ad8129ea57cb5b150b8f490a893bfe9.yml +openapi_spec_hash: 3a58f8d83133bb188548cac5c14ee5ee config_hash: 48130b77367435ca80edf565b73c49f9 From ddbc4a3749b1e401c2df53a21ebb2269dbc77e04 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 22:17:30 +0000 Subject: [PATCH 04/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 37498ecc..036c9f67 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-d4b4571c634ebdda12ec7dd7bf38054f5ad8129ea57cb5b150b8f490a893bfe9.yml -openapi_spec_hash: 3a58f8d83133bb188548cac5c14ee5ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-fefec8f845f070d2002797f0d55e53f06d4b03b1532b5bb6b9bc116297564c7e.yml +openapi_spec_hash: 8336fa93a223fa806c07aadfc7298755 config_hash: 48130b77367435ca80edf565b73c49f9 From 477d860edf3695c3d033f707e540a597a9decaf2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:17:37 +0000 Subject: [PATCH 05/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 036c9f67..ed211416 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-fefec8f845f070d2002797f0d55e53f06d4b03b1532b5bb6b9bc116297564c7e.yml -openapi_spec_hash: 8336fa93a223fa806c07aadfc7298755 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-38dbf29fbea51024bf3273a6e26343a62e1a7121ea0e0be114addc5dc51eea02.yml +openapi_spec_hash: 78d74494f114f047c1b21fa82e5fe6b8 config_hash: 48130b77367435ca80edf565b73c49f9 From cb2f3762464c944099fcf4e3f48bf50130703a4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 16:17:36 +0000 Subject: [PATCH 06/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ed211416..39484b07 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-38dbf29fbea51024bf3273a6e26343a62e1a7121ea0e0be114addc5dc51eea02.yml -openapi_spec_hash: 78d74494f114f047c1b21fa82e5fe6b8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-a9d92d15f222511796e8948b394adaf97c510bd6a43d447133dd031d108abf80.yml +openapi_spec_hash: 125dbf0035478caa44772e8a09dc0b09 config_hash: 48130b77367435ca80edf565b73c49f9 From 8688fd38a33f6cb173afe3d2afed6f40203f02bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 17:17:37 +0000 Subject: [PATCH 07/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 39484b07..c0175f18 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-a9d92d15f222511796e8948b394adaf97c510bd6a43d447133dd031d108abf80.yml -openapi_spec_hash: 125dbf0035478caa44772e8a09dc0b09 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-73bb8c46c4e6e15eae24fbbcc3f200c7061adf942061154dce1e3a75b70ec312.yml +openapi_spec_hash: d1da0b8a2a2f2daea68c008c48bda7da config_hash: 48130b77367435ca80edf565b73c49f9 From bedb0380d42036914f5b548f24d3e056a7672f19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 18:17:31 +0000 Subject: [PATCH 08/32] feat(api): api update --- .stats.yml | 4 ++-- src/profound/resources/reports/shopping.py | 2 ++ src/profound/types/reports/shopping_item_visibility_params.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c0175f18..db4bd177 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-73bb8c46c4e6e15eae24fbbcc3f200c7061adf942061154dce1e3a75b70ec312.yml -openapi_spec_hash: d1da0b8a2a2f2daea68c008c48bda7da +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-0fb35cadd8b8da8e5c16bdf363279948c3de0a9f523667b014a5ee6bd0461f91.yml +openapi_spec_hash: 5a6c739207ec34516f7898745436fbd9 config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/src/profound/resources/reports/shopping.py b/src/profound/resources/reports/shopping.py index fcb60e87..60b4371c 100644 --- a/src/profound/resources/reports/shopping.py +++ b/src/profound/resources/reports/shopping.py @@ -260,6 +260,7 @@ def item_visibility( dimensions: List[ Literal[ "period", + "product_key", "product_name", "brand_name", "date", @@ -1129,6 +1130,7 @@ async def item_visibility( dimensions: List[ Literal[ "period", + "product_key", "product_name", "brand_name", "date", diff --git a/src/profound/types/reports/shopping_item_visibility_params.py b/src/profound/types/reports/shopping_item_visibility_params.py index d1fecef8..85a19c6a 100644 --- a/src/profound/types/reports/shopping_item_visibility_params.py +++ b/src/profound/types/reports/shopping_item_visibility_params.py @@ -42,6 +42,7 @@ class ShoppingItemVisibilityParams(TypedDict, total=False): dimensions: List[ Literal[ "period", + "product_key", "product_name", "brand_name", "date", From 42ce611bdf4cc9e34489a05d2363bdf9d92a749c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 22:17:36 +0000 Subject: [PATCH 09/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index db4bd177..c8eac4c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-0fb35cadd8b8da8e5c16bdf363279948c3de0a9f523667b014a5ee6bd0461f91.yml -openapi_spec_hash: 5a6c739207ec34516f7898745436fbd9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-732a8e32462a734c87a048d4a9c89fb143f682cf14954c6bc630b498cbc03e2a.yml +openapi_spec_hash: 6a6b5b86761a9d35f60869e5b1e8c090 config_hash: 48130b77367435ca80edf565b73c49f9 From 7aa69a6761298ead98c4092ce427303f0343b626 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 00:17:37 +0000 Subject: [PATCH 10/32] feat(api): api update --- .stats.yml | 4 ++-- src/profound/types/category.py | 4 ++++ src/profound/types/organizations/category_list_response.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c8eac4c0..ccdfa276 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-732a8e32462a734c87a048d4a9c89fb143f682cf14954c6bc630b498cbc03e2a.yml -openapi_spec_hash: 6a6b5b86761a9d35f60869e5b1e8c090 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-9a74271899973e327a9ff6b26628e5a92a83c9c28fbc0aa5531c33a85cf0745d.yml +openapi_spec_hash: 6538d7a363042b3d7f329de0a7a37b66 config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/src/profound/types/category.py b/src/profound/types/category.py index a2d7566c..becc978e 100644 --- a/src/profound/types/category.py +++ b/src/profound/types/category.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional + from .._models import BaseModel __all__ = ["Category"] @@ -9,3 +11,5 @@ class Category(BaseModel): id: str name: str + + internal_name: Optional[str] = None diff --git a/src/profound/types/organizations/category_list_response.py b/src/profound/types/organizations/category_list_response.py index 3135cff2..61ed8ac0 100644 --- a/src/profound/types/organizations/category_list_response.py +++ b/src/profound/types/organizations/category_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import TypeAlias from ..._models import BaseModel @@ -18,5 +18,7 @@ class CategoryListResponseItem(BaseModel): organization: Organization + internal_name: Optional[str] = None + CategoryListResponse: TypeAlias = List[CategoryListResponseItem] From e861191900e1dadf944408baf1cdf3cc8346e774 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:17:32 +0000 Subject: [PATCH 11/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ccdfa276..a710890d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-9a74271899973e327a9ff6b26628e5a92a83c9c28fbc0aa5531c33a85cf0745d.yml -openapi_spec_hash: 6538d7a363042b3d7f329de0a7a37b66 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-3964966d934cdab3fc97529c8025eabe4f421613e72a49a5c560ebe021b32727.yml +openapi_spec_hash: 7b9f81e8814fc9c5995290fd27e1a2e8 config_hash: 48130b77367435ca80edf565b73c49f9 From 3dcc6f823003c5439629b90e41a429a213bdbd75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 15:17:41 +0000 Subject: [PATCH 12/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a710890d..d7df6f40 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-3964966d934cdab3fc97529c8025eabe4f421613e72a49a5c560ebe021b32727.yml -openapi_spec_hash: 7b9f81e8814fc9c5995290fd27e1a2e8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-f23918bffb9a51b00b62ffbd2b74f6f734e6f420db072c33f2543d89ae2c2161.yml +openapi_spec_hash: a531ff3ea5027ef7e2403450eb4cc230 config_hash: 48130b77367435ca80edf565b73c49f9 From 02477bf17e69c20b0132cfafe82e54949e0fe960 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 17:24:06 +0000 Subject: [PATCH 13/32] feat(stlc): configurable CI runner and private-production-repo support in workflow templates --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b4ca550..22936c21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/profound-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -41,7 +41,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/profound-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -78,7 +78,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/profound-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From 182627628ae5d3931dd22bcca6dc1dfe8785d4be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 18:07:57 +0000 Subject: [PATCH 14/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d7df6f40..77166699 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-f23918bffb9a51b00b62ffbd2b74f6f734e6f420db072c33f2543d89ae2c2161.yml -openapi_spec_hash: a531ff3ea5027ef7e2403450eb4cc230 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-543e70e084081fa707c2c5dc6056640acab3bfa955d82c786b8e1f4d59d6342a.yml +openapi_spec_hash: 4bd95c3dd3648c0ecc64fbd990edd82a config_hash: 48130b77367435ca80edf565b73c49f9 From 0e2fc3e06226ae103c9acc86eae54cc1377f06d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 18:17:23 +0000 Subject: [PATCH 15/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 77166699..d7df6f40 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-543e70e084081fa707c2c5dc6056640acab3bfa955d82c786b8e1f4d59d6342a.yml -openapi_spec_hash: 4bd95c3dd3648c0ecc64fbd990edd82a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-f23918bffb9a51b00b62ffbd2b74f6f734e6f420db072c33f2543d89ae2c2161.yml +openapi_spec_hash: a531ff3ea5027ef7e2403450eb4cc230 config_hash: 48130b77367435ca80edf565b73c49f9 From dcd95d9e47d35660760d6590073613d4ef0fc510 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 21:31:21 +0000 Subject: [PATCH 16/32] feat(api): api update --- .stats.yml | 4 ++-- src/profound/resources/agents/node_types.py | 4 ++-- src/profound/resources/prompts.py | 8 ++++---- .../agents/node_type_retrieve_schema_response.py | 13 ++++++------- src/profound/types/prompt_answers_v2_params.py | 2 +- .../types/prompt_stream_answers_v2_params.py | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index d7df6f40..ffafca55 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-f23918bffb9a51b00b62ffbd2b74f6f734e6f420db072c33f2543d89ae2c2161.yml -openapi_spec_hash: a531ff3ea5027ef7e2403450eb4cc230 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-cbce28c5c12d46a5599d2a6e3e6d5db14dc29df0bbb30d7adc44bf2725e0ade7.yml +openapi_spec_hash: 3191c472b21656491ecf1763f16765dc config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/src/profound/resources/agents/node_types.py b/src/profound/resources/agents/node_types.py index 38ea3f14..5ed9a877 100644 --- a/src/profound/resources/agents/node_types.py +++ b/src/profound/resources/agents/node_types.py @@ -78,7 +78,7 @@ def retrieve_schema( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NodeTypeRetrieveSchemaResponse: """ - Retrieve the JSON schema and worked examples for a single node type. + Retrieve the JSON schema for a single node type. The `schema` field is an opaque JSON Schema for the node's configuration. Use `schema_version` as a cache key — it bumps whenever the schema changes. @@ -162,7 +162,7 @@ async def retrieve_schema( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NodeTypeRetrieveSchemaResponse: """ - Retrieve the JSON schema and worked examples for a single node type. + Retrieve the JSON schema for a single node type. The `schema` field is an opaque JSON Schema for the node's configuration. Use `schema_version` as a cache key — it bumps whenever the schema changes. diff --git a/src/profound/resources/prompts.py b/src/profound/resources/prompts.py index 79fc3db1..ecd639a6 100644 --- a/src/profound/resources/prompts.py +++ b/src/profound/resources/prompts.py @@ -153,7 +153,7 @@ def answers_v2( `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for all of them. - limit: Page size; default 10, max 50. + limit: Page size; default 10, max 200. max_results: Stream endpoint only: cap the number of streamed rows (default: all). @@ -241,7 +241,7 @@ def stream_answers_v2( `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for all of them. - limit: Page size; default 10, max 50. + limit: Page size; default 10, max 200. max_results: Stream endpoint only: cap the number of streamed rows (default: all). @@ -402,7 +402,7 @@ async def answers_v2( `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for all of them. - limit: Page size; default 10, max 50. + limit: Page size; default 10, max 200. max_results: Stream endpoint only: cap the number of streamed rows (default: all). @@ -490,7 +490,7 @@ async def stream_answers_v2( `citations`, `search_queries`, `analysis_types`, `sentiment_claims`. Omit for all of them. - limit: Page size; default 10, max 50. + limit: Page size; default 10, max 200. max_results: Stream endpoint only: cap the number of streamed rows (default: all). diff --git a/src/profound/types/agents/node_type_retrieve_schema_response.py b/src/profound/types/agents/node_type_retrieve_schema_response.py index 9d9ad1ae..cc85b6d9 100644 --- a/src/profound/types/agents/node_type_retrieve_schema_response.py +++ b/src/profound/types/agents/node_type_retrieve_schema_response.py @@ -10,7 +10,7 @@ class NodeTypeRetrieveSchemaResponse(BaseModel): - """JSON schema and worked examples for a single node type.""" + """JSON schema for a single node type.""" node_type: str """Stable identifier for the node type, e.g. `llm`.""" @@ -53,10 +53,9 @@ class NodeTypeRetrieveSchemaResponse(BaseModel): examples: Optional[List[Dict[str, object]]] = None """Worked example configurations for the node type, in the canonical graph dialect. - These are curated guidance maintained by external-api, versioned by - `docs_version` (NOT `schema_version`): they illustrate a valid shape at curation - time but are a starting point, not the contract — they may lag the validator. - The authoritative contract is `schema`, and the only authoritative check that a - graph is valid is publishing it (or the agent-validation endpoint). Do not parse - `examples` as the schema. + Curated authoring guidance, versioned by `docs_version` (NOT `schema_version`): + they illustrate a valid shape at curation time but are a starting point, not the + contract — they may lag the validator. The authoritative contract is `schema`, + and the only authoritative check that a graph is valid is publishing it (or the + agent-validation endpoint). Do not parse `examples` as the schema. """ diff --git a/src/profound/types/prompt_answers_v2_params.py b/src/profound/types/prompt_answers_v2_params.py index 92005401..4700da28 100644 --- a/src/profound/types/prompt_answers_v2_params.py +++ b/src/profound/types/prompt_answers_v2_params.py @@ -52,7 +52,7 @@ class PromptAnswersV2Params(TypedDict, total=False): """ limit: Optional[int] - """Page size; default 10, max 50.""" + """Page size; default 10, max 200.""" max_results: Optional[int] """Stream endpoint only: cap the number of streamed rows (default: all).""" diff --git a/src/profound/types/prompt_stream_answers_v2_params.py b/src/profound/types/prompt_stream_answers_v2_params.py index fd810415..10a7a2cb 100644 --- a/src/profound/types/prompt_stream_answers_v2_params.py +++ b/src/profound/types/prompt_stream_answers_v2_params.py @@ -52,7 +52,7 @@ class PromptStreamAnswersV2Params(TypedDict, total=False): """ limit: Optional[int] - """Page size; default 10, max 50.""" + """Page size; default 10, max 200.""" max_results: Optional[int] """Stream endpoint only: cap the number of streamed rows (default: all).""" From 00b843b7da3bb33c1ab120758fb41056101b646d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 22:17:33 +0000 Subject: [PATCH 17/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ffafca55..8aea652e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-cbce28c5c12d46a5599d2a6e3e6d5db14dc29df0bbb30d7adc44bf2725e0ade7.yml -openapi_spec_hash: 3191c472b21656491ecf1763f16765dc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-10146f6dedeaad420b3a95e27fa65854ffe9d4bb7e55821067a6fa06ace074c6.yml +openapi_spec_hash: 1bc07108964eebece7147441d6b2b2c1 config_hash: 48130b77367435ca80edf565b73c49f9 From b7fad704abe6821f6640c152812b5746fc565c80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 19:44:43 +0000 Subject: [PATCH 18/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8aea652e..ffafca55 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-10146f6dedeaad420b3a95e27fa65854ffe9d4bb7e55821067a6fa06ace074c6.yml -openapi_spec_hash: 1bc07108964eebece7147441d6b2b2c1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-cbce28c5c12d46a5599d2a6e3e6d5db14dc29df0bbb30d7adc44bf2725e0ade7.yml +openapi_spec_hash: 3191c472b21656491ecf1763f16765dc config_hash: 48130b77367435ca80edf565b73c49f9 From 6ec912685f3327c631c70cbc006d58fec88cea38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 20:17:25 +0000 Subject: [PATCH 19/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ffafca55..8aea652e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-cbce28c5c12d46a5599d2a6e3e6d5db14dc29df0bbb30d7adc44bf2725e0ade7.yml -openapi_spec_hash: 3191c472b21656491ecf1763f16765dc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-10146f6dedeaad420b3a95e27fa65854ffe9d4bb7e55821067a6fa06ace074c6.yml +openapi_spec_hash: 1bc07108964eebece7147441d6b2b2c1 config_hash: 48130b77367435ca80edf565b73c49f9 From 641081e222e99a24287f76aca3888d4752b4a07a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:09:11 +0000 Subject: [PATCH 20/32] feat(api): api update --- .stats.yml | 4 ++-- tests/api_resources/test_reports.py | 32 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8aea652e..a81892c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-10146f6dedeaad420b3a95e27fa65854ffe9d4bb7e55821067a6fa06ace074c6.yml -openapi_spec_hash: 1bc07108964eebece7147441d6b2b2c1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-fb09edb5b8d00049735d32e76dce6d4eb7f3f1dd4cc5d1a4f84f7d8723416b68.yml +openapi_spec_hash: 499332ffbc5348f13191f859c678e63c config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/tests/api_resources/test_reports.py b/tests/api_resources/test_reports.py index 222ee0f5..3aa66f6f 100644 --- a/tests/api_resources/test_reports.py +++ b/tests/api_resources/test_reports.py @@ -663,7 +663,7 @@ def test_streaming_response_query_sentiment(self, client: Profound) -> None: @parametrize def test_method_query_visibility(self, client: Profound) -> None: report = client.reports.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -673,7 +673,7 @@ def test_method_query_visibility(self, client: Profound) -> None: @parametrize def test_method_query_visibility_with_all_params(self, client: Profound) -> None: report = client.reports.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", assets="string", @@ -699,7 +699,7 @@ def test_method_query_visibility_with_all_params(self, client: Profound) -> None @parametrize def test_raw_response_query_visibility(self, client: Profound) -> None: response = client.reports.with_raw_response.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -713,7 +713,7 @@ def test_raw_response_query_visibility(self, client: Profound) -> None: @parametrize def test_streaming_response_query_visibility(self, client: Profound) -> None: with client.reports.with_streaming_response.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -1277,7 +1277,7 @@ def test_streaming_response_stream_visibility(self, client: Profound) -> None: @parametrize def test_method_stream_visibility_v2(self, client: Profound) -> None: report = client.reports.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -1287,7 +1287,7 @@ def test_method_stream_visibility_v2(self, client: Profound) -> None: @parametrize def test_method_stream_visibility_v2_with_all_params(self, client: Profound) -> None: report = client.reports.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", assets="string", @@ -1313,7 +1313,7 @@ def test_method_stream_visibility_v2_with_all_params(self, client: Profound) -> @parametrize def test_raw_response_stream_visibility_v2(self, client: Profound) -> None: response = client.reports.with_raw_response.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -1327,7 +1327,7 @@ def test_raw_response_stream_visibility_v2(self, client: Profound) -> None: @parametrize def test_streaming_response_stream_visibility_v2(self, client: Profound) -> None: with client.reports.with_streaming_response.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -2050,7 +2050,7 @@ async def test_streaming_response_query_sentiment(self, async_client: AsyncProfo @parametrize async def test_method_query_visibility(self, async_client: AsyncProfound) -> None: report = await async_client.reports.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -2060,7 +2060,7 @@ async def test_method_query_visibility(self, async_client: AsyncProfound) -> Non @parametrize async def test_method_query_visibility_with_all_params(self, async_client: AsyncProfound) -> None: report = await async_client.reports.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", assets="string", @@ -2086,7 +2086,7 @@ async def test_method_query_visibility_with_all_params(self, async_client: Async @parametrize async def test_raw_response_query_visibility(self, async_client: AsyncProfound) -> None: response = await async_client.reports.with_raw_response.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -2100,7 +2100,7 @@ async def test_raw_response_query_visibility(self, async_client: AsyncProfound) @parametrize async def test_streaming_response_query_visibility(self, async_client: AsyncProfound) -> None: async with async_client.reports.with_streaming_response.query_visibility( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -2664,7 +2664,7 @@ async def test_streaming_response_stream_visibility(self, async_client: AsyncPro @parametrize async def test_method_stream_visibility_v2(self, async_client: AsyncProfound) -> None: report = await async_client.reports.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -2674,7 +2674,7 @@ async def test_method_stream_visibility_v2(self, async_client: AsyncProfound) -> @parametrize async def test_method_stream_visibility_v2_with_all_params(self, async_client: AsyncProfound) -> None: report = await async_client.reports.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", assets="string", @@ -2700,7 +2700,7 @@ async def test_method_stream_visibility_v2_with_all_params(self, async_client: A @parametrize async def test_raw_response_stream_visibility_v2(self, async_client: AsyncProfound) -> None: response = await async_client.reports.with_raw_response.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -2714,7 +2714,7 @@ async def test_raw_response_stream_visibility_v2(self, async_client: AsyncProfou @parametrize async def test_streaming_response_stream_visibility_v2(self, async_client: AsyncProfound) -> None: async with async_client.reports.with_streaming_response.stream_visibility_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: From 98f0beacbe8ca034a48bb57ec53921012a183279 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:17:44 +0000 Subject: [PATCH 21/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a81892c0..945bfb71 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-fb09edb5b8d00049735d32e76dce6d4eb7f3f1dd4cc5d1a4f84f7d8723416b68.yml -openapi_spec_hash: 499332ffbc5348f13191f859c678e63c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-c1f33def48fec98225e139dab788e9cd1914ca20cf3ba0f2fd0b6b09e4c6b9e2.yml +openapi_spec_hash: df025d4cdf6ce14833f0503de4b6233a config_hash: 48130b77367435ca80edf565b73c49f9 From ee476f40439fd739ac8b3e97b028e55b98135a5d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 14:17:27 +0000 Subject: [PATCH 22/32] feat(api): api update --- .stats.yml | 4 ++-- src/profound/resources/reports/reports.py | 18 +++++++++++++++--- .../types/report_get_bots_report_v2_params.py | 8 +++++++- tests/api_resources/test_reports.py | 4 ++++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 945bfb71..30abf9bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-c1f33def48fec98225e139dab788e9cd1914ca20cf3ba0f2fd0b6b09e4c6b9e2.yml -openapi_spec_hash: df025d4cdf6ce14833f0503de4b6233a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-dc025067047713ed3eef920a0ddbbfcf1945a969f49347e3387d8199081958aa.yml +openapi_spec_hash: 92a6c574a05d3c516eef32f257cc8233 config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/src/profound/resources/reports/reports.py b/src/profound/resources/reports/reports.py index 685c9a37..24d5716b 100644 --- a/src/profound/resources/reports/reports.py +++ b/src/profound/resources/reports/reports.py @@ -30,7 +30,7 @@ report_stream_visibility_v2_params, report_get_referrals_report_v2_params, ) -from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .accuracy import ( AccuracyResource, @@ -323,16 +323,18 @@ def get_bots_report_v2( self, *, domain: str, - metrics: List[Literal["count", "citations", "indexing", "training", "last_visit"]], + metrics: List[Literal["count", "citations", "indexing", "training", "last_visit", "agents"]], start_date: Union[str, datetime], date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit, dimensions: List[Literal["date", "hour", "path", "bot_name", "bot_provider", "bot_type"]] | Omit = omit, + domain_id: Optional[str] | Omit = omit, end_date: Union[str, datetime] | Omit = omit, filters: Iterable[report_get_bots_report_v2_params.Filter] | Omit = omit, metric_filters: Iterable[report_get_bots_report_v2_params.MetricFilter] | Omit = omit, order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit, organization_id: Optional[str] | Omit = omit, pagination: Pagination | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -368,6 +370,8 @@ def get_bots_report_v2( dimensions: Dimensions to group the report by. + domain_id: Domain UUID used for tag lookups. + end_date: End date in UTC. Accepts same formats as start_date. Defaults to now UTC if omitted. @@ -405,12 +409,14 @@ def get_bots_report_v2( "start_date": start_date, "date_interval": date_interval, "dimensions": dimensions, + "domain_id": domain_id, "end_date": end_date, "filters": filters, "metric_filters": metric_filters, "order_by": order_by, "organization_id": organization_id, "pagination": pagination, + "tags": tags, }, report_get_bots_report_v2_params.ReportGetBotsReportV2Params, ), @@ -2087,16 +2093,18 @@ async def get_bots_report_v2( self, *, domain: str, - metrics: List[Literal["count", "citations", "indexing", "training", "last_visit"]], + metrics: List[Literal["count", "citations", "indexing", "training", "last_visit", "agents"]], start_date: Union[str, datetime], date_interval: Literal["hour", "day", "week", "month", "quarter", "year", "relative_week"] | Omit = omit, dimensions: List[Literal["date", "hour", "path", "bot_name", "bot_provider", "bot_type"]] | Omit = omit, + domain_id: Optional[str] | Omit = omit, end_date: Union[str, datetime] | Omit = omit, filters: Iterable[report_get_bots_report_v2_params.Filter] | Omit = omit, metric_filters: Iterable[report_get_bots_report_v2_params.MetricFilter] | Omit = omit, order_by: Dict[str, Literal["asc", "desc"]] | Omit = omit, organization_id: Optional[str] | Omit = omit, pagination: Pagination | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2132,6 +2140,8 @@ async def get_bots_report_v2( dimensions: Dimensions to group the report by. + domain_id: Domain UUID used for tag lookups. + end_date: End date in UTC. Accepts same formats as start_date. Defaults to now UTC if omitted. @@ -2169,12 +2179,14 @@ async def get_bots_report_v2( "start_date": start_date, "date_interval": date_interval, "dimensions": dimensions, + "domain_id": domain_id, "end_date": end_date, "filters": filters, "metric_filters": metric_filters, "order_by": order_by, "organization_id": organization_id, "pagination": pagination, + "tags": tags, }, report_get_bots_report_v2_params.ReportGetBotsReportV2Params, ), diff --git a/src/profound/types/report_get_bots_report_v2_params.py b/src/profound/types/report_get_bots_report_v2_params.py index 4279dbd6..ae7e3870 100644 --- a/src/profound/types/report_get_bots_report_v2_params.py +++ b/src/profound/types/report_get_bots_report_v2_params.py @@ -6,6 +6,7 @@ from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared_params.pagination import Pagination from .shared_params.path_filter import PathFilter @@ -19,7 +20,7 @@ class ReportGetBotsReportV2Params(TypedDict, total=False): domain: Required[str] """Domain to query logs for.""" - metrics: Required[List[Literal["count", "citations", "indexing", "training", "last_visit"]]] + metrics: Required[List[Literal["count", "citations", "indexing", "training", "last_visit", "agents"]]] start_date: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] """Start date for logs. @@ -34,6 +35,9 @@ class ReportGetBotsReportV2Params(TypedDict, total=False): dimensions: List[Literal["date", "hour", "path", "bot_name", "bot_provider", "bot_type"]] """Dimensions to group the report by.""" + domain_id: Optional[str] + """Domain UUID used for tag lookups.""" + end_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """End date in UTC. @@ -64,6 +68,8 @@ class ReportGetBotsReportV2Params(TypedDict, total=False): pagination: Pagination """Pagination settings for the report results.""" + tags: SequenceNotStr[str] + class FilterBotTypeFilter(TypedDict, total=False): """Filter by bot_type column (v2 hourly table only)""" diff --git a/tests/api_resources/test_reports.py b/tests/api_resources/test_reports.py index 3aa66f6f..760328d1 100644 --- a/tests/api_resources/test_reports.py +++ b/tests/api_resources/test_reports.py @@ -186,6 +186,7 @@ def test_method_get_bots_report_v2_with_all_params(self, client: Profound) -> No start_date=parse_datetime("2019-12-27T18:11:19.117Z"), date_interval="hour", dimensions=["date"], + domain_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date=parse_datetime("2019-12-27T18:11:19.117Z"), filters=[ { @@ -207,6 +208,7 @@ def test_method_get_bots_report_v2_with_all_params(self, client: Profound) -> No "limit": 1, "offset": 0, }, + tags=["string"], ) assert_matches_type(ReportResponse, report, path=["response"]) @@ -1573,6 +1575,7 @@ async def test_method_get_bots_report_v2_with_all_params(self, async_client: Asy start_date=parse_datetime("2019-12-27T18:11:19.117Z"), date_interval="hour", dimensions=["date"], + domain_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date=parse_datetime("2019-12-27T18:11:19.117Z"), filters=[ { @@ -1594,6 +1597,7 @@ async def test_method_get_bots_report_v2_with_all_params(self, async_client: Asy "limit": 1, "offset": 0, }, + tags=["string"], ) assert_matches_type(ReportResponse, report, path=["response"]) From 949c8c4aecea50ff7fdf56dc3b3ab74a032aa2bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 21:11:06 +0000 Subject: [PATCH 23/32] feat(api): api update --- .stats.yml | 4 +- api.md | 2 +- src/profound/resources/agents/runs.py | 20 ++++++-- src/profound/resources/reports/reports.py | 48 +++++++++++++++---- src/profound/types/agents/__init__.py | 1 + .../types/agents/run_retrieve_params.py | 15 ++++++ .../types/agents/run_retrieve_response.py | 46 +++++++++++++++++- .../types/report_query_citations_params.py | 15 ++++-- .../report_stream_citations_v2_params.py | 15 ++++-- tests/api_resources/agents/test_runs.py | 20 ++++++++ tests/api_resources/test_reports.py | 4 ++ 11 files changed, 168 insertions(+), 22 deletions(-) create mode 100644 src/profound/types/agents/run_retrieve_params.py diff --git a/.stats.yml b/.stats.yml index 30abf9bb..9bd56d95 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-dc025067047713ed3eef920a0ddbbfcf1945a969f49347e3387d8199081958aa.yml -openapi_spec_hash: 92a6c574a05d3c516eef32f257cc8233 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-f52fb1473a2cf2edc57af10caf0902c839b1d0f38ce6214b3c6ac24343ff4015.yml +openapi_spec_hash: f546ab89ceef1f4a4afacfe985608524 config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/api.md b/api.md index 9a452da9..7d86c1cf 100644 --- a/api.md +++ b/api.md @@ -312,7 +312,7 @@ from profound.types.agents import RunCreateResponse, RunRetrieveResponse Methods: - client.agents.runs.create(agent_id, \*\*params) -> RunCreateResponse -- client.agents.runs.retrieve(run_id, \*, agent_id) -> RunRetrieveResponse +- client.agents.runs.retrieve(run_id, \*, agent_id, \*\*params) -> RunRetrieveResponse ## NodeTypes diff --git a/src/profound/resources/agents/runs.py b/src/profound/resources/agents/runs.py index e53bc057..f50ca1b1 100644 --- a/src/profound/resources/agents/runs.py +++ b/src/profound/resources/agents/runs.py @@ -17,7 +17,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.agents import run_create_params +from ...types.agents import run_create_params, run_retrieve_params from ...types.agents.run_create_response import RunCreateResponse from ...types.agents.run_retrieve_response import RunRetrieveResponse @@ -93,6 +93,7 @@ def retrieve( run_id: str, *, agent_id: str, + verbose: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -108,6 +109,8 @@ def retrieve( run_id: The ID of the run to retrieve. + verbose: Include each step's raw `outputs` payload in the execution trace. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -123,7 +126,11 @@ def retrieve( return self._get( path_template("/v1/agents/{agent_id}/runs/{run_id}", agent_id=agent_id, run_id=run_id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"verbose": verbose}, run_retrieve_params.RunRetrieveParams), ), cast_to=RunRetrieveResponse, ) @@ -198,6 +205,7 @@ async def retrieve( run_id: str, *, agent_id: str, + verbose: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -213,6 +221,8 @@ async def retrieve( run_id: The ID of the run to retrieve. + verbose: Include each step's raw `outputs` payload in the execution trace. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -228,7 +238,11 @@ async def retrieve( return await self._get( path_template("/v1/agents/{agent_id}/runs/{run_id}", agent_id=agent_id, run_id=run_id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"verbose": verbose}, run_retrieve_params.RunRetrieveParams), ), cast_to=RunRetrieveResponse, ) diff --git a/src/profound/resources/reports/reports.py b/src/profound/resources/reports/reports.py index 24d5716b..e07a7b97 100644 --- a/src/profound/resources/reports/reports.py +++ b/src/profound/resources/reports/reports.py @@ -612,6 +612,7 @@ def query_citations( end_date: str, start_date: str, cursor: Optional[str] | Omit = omit, + entity: Literal["domain", "page", "citation_category"] | Omit = omit, filter: Optional[report_query_citations_params.Filter] | Omit = omit, group_by: List[Literal["page", "date", "model", "topic", "region", "persona", "prompt"]] | Omit = omit, interval: Literal["day", "week", "month"] | Omit = omit, @@ -634,14 +635,20 @@ def query_citations( start_date: YYYY-MM-DD, ET, inclusive + entity: What each row represents: `domain` (default), `page`, or `citation_category`. + Legacy: `group_by: ["page"]` (with `entity` omitted) is still accepted and is + equivalent to `entity: "page"`. `citation_category` uses the dashboard split + view: a citation counts under both its page-level and domain-level category, so + category shares can sum to more than 100%. + filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group. limit: Page size; default 10, max 50. max_results: Stream endpoint only: cap the number of streamed rows (default: all). - scope: `all` (every cited domain) or `owned` (only your owned domains, for easy - client-side totals). + scope: `all` (every cited domain) or `owned` (only your owned domains). Applies to + `entity=domain`. extra_headers: Send extra headers @@ -659,6 +666,7 @@ def query_citations( "end_date": end_date, "start_date": start_date, "cursor": cursor, + "entity": entity, "filter": filter, "group_by": group_by, "interval": interval, @@ -1264,6 +1272,7 @@ def stream_citations_v2( end_date: str, start_date: str, cursor: Optional[str] | Omit = omit, + entity: Literal["domain", "page", "citation_category"] | Omit = omit, filter: Optional[report_stream_citations_v2_params.Filter] | Omit = omit, group_by: List[Literal["page", "date", "model", "topic", "region", "persona", "prompt"]] | Omit = omit, interval: Literal["day", "week", "month"] | Omit = omit, @@ -1286,14 +1295,20 @@ def stream_citations_v2( start_date: YYYY-MM-DD, ET, inclusive + entity: What each row represents: `domain` (default), `page`, or `citation_category`. + Legacy: `group_by: ["page"]` (with `entity` omitted) is still accepted and is + equivalent to `entity: "page"`. `citation_category` uses the dashboard split + view: a citation counts under both its page-level and domain-level category, so + category shares can sum to more than 100%. + filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group. limit: Page size; default 10, max 50. max_results: Stream endpoint only: cap the number of streamed rows (default: all). - scope: `all` (every cited domain) or `owned` (only your owned domains, for easy - client-side totals). + scope: `all` (every cited domain) or `owned` (only your owned domains). Applies to + `entity=domain`. extra_headers: Send extra headers @@ -1312,6 +1327,7 @@ def stream_citations_v2( "end_date": end_date, "start_date": start_date, "cursor": cursor, + "entity": entity, "filter": filter, "group_by": group_by, "interval": interval, @@ -2382,6 +2398,7 @@ async def query_citations( end_date: str, start_date: str, cursor: Optional[str] | Omit = omit, + entity: Literal["domain", "page", "citation_category"] | Omit = omit, filter: Optional[report_query_citations_params.Filter] | Omit = omit, group_by: List[Literal["page", "date", "model", "topic", "region", "persona", "prompt"]] | Omit = omit, interval: Literal["day", "week", "month"] | Omit = omit, @@ -2404,14 +2421,20 @@ async def query_citations( start_date: YYYY-MM-DD, ET, inclusive + entity: What each row represents: `domain` (default), `page`, or `citation_category`. + Legacy: `group_by: ["page"]` (with `entity` omitted) is still accepted and is + equivalent to `entity: "page"`. `citation_category` uses the dashboard split + view: a citation counts under both its page-level and domain-level category, so + category shares can sum to more than 100%. + filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group. limit: Page size; default 10, max 50. max_results: Stream endpoint only: cap the number of streamed rows (default: all). - scope: `all` (every cited domain) or `owned` (only your owned domains, for easy - client-side totals). + scope: `all` (every cited domain) or `owned` (only your owned domains). Applies to + `entity=domain`. extra_headers: Send extra headers @@ -2429,6 +2452,7 @@ async def query_citations( "end_date": end_date, "start_date": start_date, "cursor": cursor, + "entity": entity, "filter": filter, "group_by": group_by, "interval": interval, @@ -3034,6 +3058,7 @@ async def stream_citations_v2( end_date: str, start_date: str, cursor: Optional[str] | Omit = omit, + entity: Literal["domain", "page", "citation_category"] | Omit = omit, filter: Optional[report_stream_citations_v2_params.Filter] | Omit = omit, group_by: List[Literal["page", "date", "model", "topic", "region", "persona", "prompt"]] | Omit = omit, interval: Literal["day", "week", "month"] | Omit = omit, @@ -3056,14 +3081,20 @@ async def stream_citations_v2( start_date: YYYY-MM-DD, ET, inclusive + entity: What each row represents: `domain` (default), `page`, or `citation_category`. + Legacy: `group_by: ["page"]` (with `entity` omitted) is still accepted and is + equivalent to `entity: "page"`. `citation_category` uses the dashboard split + view: a citation counts under both its page-level and domain-level category, so + category shares can sum to more than 100%. + filter: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group. limit: Page size; default 10, max 50. max_results: Stream endpoint only: cap the number of streamed rows (default: all). - scope: `all` (every cited domain) or `owned` (only your owned domains, for easy - client-side totals). + scope: `all` (every cited domain) or `owned` (only your owned domains). Applies to + `entity=domain`. extra_headers: Send extra headers @@ -3082,6 +3113,7 @@ async def stream_citations_v2( "end_date": end_date, "start_date": start_date, "cursor": cursor, + "entity": entity, "filter": filter, "group_by": group_by, "interval": interval, diff --git a/src/profound/types/agents/__init__.py b/src/profound/types/agents/__init__.py index 7aa0369e..34ea2ed6 100644 --- a/src/profound/types/agents/__init__.py +++ b/src/profound/types/agents/__init__.py @@ -4,6 +4,7 @@ from .run_create_params import RunCreateParams as RunCreateParams from .run_create_response import RunCreateResponse as RunCreateResponse +from .run_retrieve_params import RunRetrieveParams as RunRetrieveParams from .run_retrieve_response import RunRetrieveResponse as RunRetrieveResponse from .node_type_list_response import NodeTypeListResponse as NodeTypeListResponse from .node_type_retrieve_schema_response import NodeTypeRetrieveSchemaResponse as NodeTypeRetrieveSchemaResponse diff --git a/src/profound/types/agents/run_retrieve_params.py b/src/profound/types/agents/run_retrieve_params.py new file mode 100644 index 00000000..2a6c9179 --- /dev/null +++ b/src/profound/types/agents/run_retrieve_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RunRetrieveParams"] + + +class RunRetrieveParams(TypedDict, total=False): + agent_id: Required[str] + """The ID of the agent that owns the run.""" + + verbose: bool + """Include each step's raw `outputs` payload in the execution trace.""" diff --git a/src/profound/types/agents/run_retrieve_response.py b/src/profound/types/agents/run_retrieve_response.py index 8f0d258e..915c7aec 100644 --- a/src/profound/types/agents/run_retrieve_response.py +++ b/src/profound/types/agents/run_retrieve_response.py @@ -1,12 +1,47 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["RunRetrieveResponse"] +__all__ = ["RunRetrieveResponse", "Step"] + + +class Step(BaseModel): + """One executed node in a run's step trace, in execution order. + + The lightweight fields always ship; ``outputs`` is populated only when the + run-retrieve request asks for ``verbose``. + """ + + node_id: str + """ID of the node that ran, within its agent graph.""" + + node_type: str + """Kind of node, e.g. "profound_visibility", "llm", "conditional".""" + + status: str + """Terminal status of this node execution.""" + + title: str + """Human-readable title of the node.""" + + elapsed_time: Optional[float] = None + """Wall-clock seconds the node took, if recorded.""" + + error_message: Optional[str] = None + """Failure detail for this node, when it failed.""" + + finished_at: Optional[datetime] = None + """When the node finished, if it has.""" + + outputs: Optional[Dict[str, object]] = None + """Raw output payload this node produced. + + Included only when the request asks for `verbose`. + """ class RunRetrieveResponse(BaseModel): @@ -36,3 +71,10 @@ class RunRetrieveResponse(BaseModel): started_at: Optional[datetime] = None """When the run started, if it has started.""" + + steps: Optional[List[Step]] = None + """ + Ordered step-by-step execution trace — one entry per node that ran, in execution + order. Always present once the run has executed a node; per-node `outputs` + inside each step are included only when the request asks for `verbose`. + """ diff --git a/src/profound/types/report_query_citations_params.py b/src/profound/types/report_query_citations_params.py index 4441e22a..778fdf1f 100644 --- a/src/profound/types/report_query_citations_params.py +++ b/src/profound/types/report_query_citations_params.py @@ -19,6 +19,15 @@ class ReportQueryCitationsParams(TypedDict, total=False): cursor: Optional[str] + entity: Literal["domain", "page", "citation_category"] + """What each row represents: `domain` (default), `page`, or `citation_category`. + + Legacy: `group_by: ["page"]` (with `entity` omitted) is still accepted and is + equivalent to `entity: "page"`. `citation_category` uses the dashboard split + view: a citation counts under both its page-level and domain-level category, so + category shares can sum to more than 100%. + """ + filter: Optional[Filter] """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.""" @@ -35,9 +44,9 @@ class ReportQueryCitationsParams(TypedDict, total=False): metrics: Optional[List[Literal["count", "citation_share", "rank", "first_cited_at"]]] scope: Literal["all", "owned"] - """ - `all` (every cited domain) or `owned` (only your owned domains, for easy - client-side totals). + """`all` (every cited domain) or `owned` (only your owned domains). + + Applies to `entity=domain`. """ diff --git a/src/profound/types/report_stream_citations_v2_params.py b/src/profound/types/report_stream_citations_v2_params.py index 465d5943..4cb19270 100644 --- a/src/profound/types/report_stream_citations_v2_params.py +++ b/src/profound/types/report_stream_citations_v2_params.py @@ -19,6 +19,15 @@ class ReportStreamCitationsV2Params(TypedDict, total=False): cursor: Optional[str] + entity: Literal["domain", "page", "citation_category"] + """What each row represents: `domain` (default), `page`, or `citation_category`. + + Legacy: `group_by: ["page"]` (with `entity` omitted) is still accepted and is + equivalent to `entity: "page"`. `citation_category` uses the dashboard split + view: a citation counts under both its page-level and domain-level category, so + category shares can sum to more than 100%. + """ + filter: Optional[Filter] """A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.""" @@ -35,9 +44,9 @@ class ReportStreamCitationsV2Params(TypedDict, total=False): metrics: Optional[List[Literal["count", "citation_share", "rank", "first_cited_at"]]] scope: Literal["all", "owned"] - """ - `all` (every cited domain) or `owned` (only your owned domains, for easy - client-side totals). + """`all` (every cited domain) or `owned` (only your owned domains). + + Applies to `entity=domain`. """ diff --git a/tests/api_resources/agents/test_runs.py b/tests/api_resources/agents/test_runs.py index f89ec572..3856c10d 100644 --- a/tests/api_resources/agents/test_runs.py +++ b/tests/api_resources/agents/test_runs.py @@ -77,6 +77,16 @@ def test_method_retrieve(self, client: Profound) -> None: ) assert_matches_type(RunRetrieveResponse, run, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Profound) -> None: + run = client.agents.runs.retrieve( + run_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + agent_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + verbose=True, + ) + assert_matches_type(RunRetrieveResponse, run, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Profound) -> None: @@ -186,6 +196,16 @@ async def test_method_retrieve(self, async_client: AsyncProfound) -> None: ) assert_matches_type(RunRetrieveResponse, run, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncProfound) -> None: + run = await async_client.agents.runs.retrieve( + run_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + agent_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + verbose=True, + ) + assert_matches_type(RunRetrieveResponse, run, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncProfound) -> None: diff --git a/tests/api_resources/test_reports.py b/tests/api_resources/test_reports.py index 760328d1..0457add7 100644 --- a/tests/api_resources/test_reports.py +++ b/tests/api_resources/test_reports.py @@ -406,6 +406,7 @@ def test_method_query_citations_with_all_params(self, client: Profound) -> None: end_date="end_date", start_date="start_date", cursor="cursor", + entity="domain", filter={ "and": [], "field": "field", @@ -954,6 +955,7 @@ def test_method_stream_citations_v2_with_all_params(self, client: Profound) -> N end_date="end_date", start_date="start_date", cursor="cursor", + entity="domain", filter={ "and": [], "field": "field", @@ -1795,6 +1797,7 @@ async def test_method_query_citations_with_all_params(self, async_client: AsyncP end_date="end_date", start_date="start_date", cursor="cursor", + entity="domain", filter={ "and": [], "field": "field", @@ -2343,6 +2346,7 @@ async def test_method_stream_citations_v2_with_all_params(self, async_client: As end_date="end_date", start_date="start_date", cursor="cursor", + entity="domain", filter={ "and": [], "field": "field", From 79dcecf0ac4be6dbb3ec556677e21c6688818e5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 21:17:28 +0000 Subject: [PATCH 24/32] feat(api): api update --- .stats.yml | 4 +- api.md | 28 +- .../resources/organizations/categories.py | 8 +- src/profound/resources/prompts.py | 26 +- .../resources/reports/factcheck/claims.py | 26 +- .../resources/reports/factcheck/factcheck.py | 26 +- src/profound/resources/reports/reports.py | 86 +++-- src/profound/types/__init__.py | 5 + .../types/prompt_answers_v2_response.py | 118 ++++++- .../prompt_stream_answers_v2_response.py | 115 +++++++ .../types/report_query_citations_response.py | 182 +++++++++- .../report_query_query_fanouts_response.py | 95 +++++- .../types/report_query_sentiment_response.py | 295 +++++++++++++++- .../types/report_query_visibility_response.py | 185 +++++++++- .../report_stream_citations_v2_response.py | 179 ++++++++++ .../report_stream_query_fanouts_response.py | 92 +++++ .../report_stream_sentiment_v2_response.py | 292 ++++++++++++++++ .../report_stream_visibility_v2_response.py | 182 ++++++++++ src/profound/types/reports/__init__.py | 1 + .../types/reports/factcheck/__init__.py | 1 + .../factcheck/claim_query_claims_response.py | 320 +++++++++++++++++- .../factcheck/claim_stream_claims_response.py | 317 +++++++++++++++++ .../factcheck_query_scores_response.py | 211 +++++++++++- .../factcheck_stream_scores_response.py | 209 ++++++++++++ .../reports/factcheck/test_claims.py | 66 ++-- tests/api_resources/reports/test_factcheck.py | 66 ++-- tests/api_resources/test_prompts.py | 66 ++-- tests/api_resources/test_reports.py | 200 ++++++----- 28 files changed, 3103 insertions(+), 298 deletions(-) create mode 100644 src/profound/types/prompt_stream_answers_v2_response.py create mode 100644 src/profound/types/report_stream_citations_v2_response.py create mode 100644 src/profound/types/report_stream_query_fanouts_response.py create mode 100644 src/profound/types/report_stream_sentiment_v2_response.py create mode 100644 src/profound/types/report_stream_visibility_v2_response.py create mode 100644 src/profound/types/reports/factcheck/claim_stream_claims_response.py create mode 100644 src/profound/types/reports/factcheck_stream_scores_response.py diff --git a/.stats.yml b/.stats.yml index 9bd56d95..f92de618 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-f52fb1473a2cf2edc57af10caf0902c839b1d0f38ce6214b3c6ac24343ff4015.yml -openapi_spec_hash: f546ab89ceef1f4a4afacfe985608524 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-52ba02a24f99396c26b151bbf7a65fbcd9d12a49b997f79b43234ec5594f3ce6.yml +openapi_spec_hash: 74344fe8287b4d42268ecf5764ff5bf7 config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/api.md b/api.md index 7d86c1cf..7a40c941 100644 --- a/api.md +++ b/api.md @@ -91,14 +91,18 @@ Methods: Types: ```python -from profound.types import PromptAnswersResponse, PromptAnswersV2Response +from profound.types import ( + PromptAnswersResponse, + PromptAnswersV2Response, + PromptStreamAnswersV2Response, +) ``` Methods: - client.prompts.answers(\*\*params) -> PromptAnswersResponse - client.prompts.answers_v2(\*\*params) -> PromptAnswersV2Response -- client.prompts.stream_answers_v2(\*\*params) -> None +- client.prompts.stream_answers_v2(\*\*params) -> PromptStreamAnswersV2Response # Reports @@ -122,8 +126,12 @@ from profound.types import ( ReportQueryVisibilityResponse, ReportSentimentV2Response, ReportStreamCitationsResponse, + ReportStreamCitationsV2Response, + ReportStreamQueryFanoutsResponse, ReportStreamSentimentResponse, + ReportStreamSentimentV2Response, ReportStreamVisibilityResponse, + ReportStreamVisibilityV2Response, ) ``` @@ -142,12 +150,12 @@ Methods: - client.reports.sentiment(\*\*params) -> ReportResponse - client.reports.sentiment_v2(\*\*params) -> ReportSentimentV2Response - client.reports.stream_citations(\*\*params) -> ReportStreamCitationsResponse -- client.reports.stream_citations_v2(\*\*params) -> None -- client.reports.stream_query_fanouts(\*\*params) -> None +- client.reports.stream_citations_v2(\*\*params) -> ReportStreamCitationsV2Response +- client.reports.stream_query_fanouts(\*\*params) -> ReportStreamQueryFanoutsResponse - client.reports.stream_sentiment(\*\*params) -> ReportStreamSentimentResponse -- client.reports.stream_sentiment_v2(\*\*params) -> None +- client.reports.stream_sentiment_v2(\*\*params) -> ReportStreamSentimentV2Response - client.reports.stream_visibility(\*\*params) -> ReportStreamVisibilityResponse -- client.reports.stream_visibility_v2(\*\*params) -> None +- client.reports.stream_visibility_v2(\*\*params) -> ReportStreamVisibilityV2Response - client.reports.visibility(\*\*params) -> ReportResponse ## WebSearchResults @@ -241,26 +249,26 @@ Methods: Types: ```python -from profound.types.reports import FactcheckQueryScoresResponse +from profound.types.reports import FactcheckQueryScoresResponse, FactcheckStreamScoresResponse ``` Methods: - client.reports.factcheck.query_scores(\*\*params) -> FactcheckQueryScoresResponse -- client.reports.factcheck.stream_scores(\*\*params) -> None +- client.reports.factcheck.stream_scores(\*\*params) -> FactcheckStreamScoresResponse ### Claims Types: ```python -from profound.types.reports.factcheck import ClaimQueryClaimsResponse +from profound.types.reports.factcheck import ClaimQueryClaimsResponse, ClaimStreamClaimsResponse ``` Methods: - client.reports.factcheck.claims.query_claims(\*\*params) -> ClaimQueryClaimsResponse -- client.reports.factcheck.claims.stream_claims(\*\*params) -> None +- client.reports.factcheck.claims.stream_claims(\*\*params) -> ClaimStreamClaimsResponse # Content diff --git a/src/profound/resources/organizations/categories.py b/src/profound/resources/organizations/categories.py index 1bcc9525..3a0c6009 100644 --- a/src/profound/resources/organizations/categories.py +++ b/src/profound/resources/organizations/categories.py @@ -111,7 +111,7 @@ def assets( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryAssetsResponse: """ - Get Category Assets + Assets Args: extra_headers: Send extra headers @@ -193,7 +193,7 @@ def get_category_personas( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryGetCategoryPersonasResponse: """ - Get Category Personas + Personas Args: extra_headers: Send extra headers @@ -583,7 +583,7 @@ async def assets( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryAssetsResponse: """ - Get Category Assets + Assets Args: extra_headers: Send extra headers @@ -665,7 +665,7 @@ async def get_category_personas( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryGetCategoryPersonasResponse: """ - Get Category Personas + Personas Args: extra_headers: Send extra headers diff --git a/src/profound/resources/prompts.py b/src/profound/resources/prompts.py index ecd639a6..aea37d94 100644 --- a/src/profound/resources/prompts.py +++ b/src/profound/resources/prompts.py @@ -2,14 +2,14 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Any, List, Union, Iterable, Optional, cast from datetime import datetime from typing_extensions import Literal import httpx from ..types import prompt_answers_params, prompt_answers_v2_params, prompt_stream_answers_v2_params -from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -19,10 +19,12 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from .._streaming import Stream, AsyncStream from .._base_client import make_request_options from ..types.prompt_answers_response import PromptAnswersResponse from ..types.shared_params.pagination import Pagination from ..types.prompt_answers_v2_response import PromptAnswersV2Response +from ..types.prompt_stream_answers_v2_response import PromptStreamAnswersV2Response __all__ = ["PromptsResource", "AsyncPromptsResource"] @@ -225,7 +227,7 @@ def stream_answers_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[PromptStreamAnswersV2Response]: """ Stream Answers V2 @@ -253,7 +255,7 @@ def stream_answers_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/prompts/answers/stream", body=maybe_transform( @@ -272,7 +274,11 @@ def stream_answers_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, PromptStreamAnswersV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[PromptStreamAnswersV2Response], ) @@ -474,7 +480,7 @@ async def stream_answers_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[PromptStreamAnswersV2Response]: """ Stream Answers V2 @@ -502,7 +508,7 @@ async def stream_answers_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/prompts/answers/stream", body=await async_maybe_transform( @@ -521,7 +527,11 @@ async def stream_answers_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, PromptStreamAnswersV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[PromptStreamAnswersV2Response], ) diff --git a/src/profound/resources/reports/factcheck/claims.py b/src/profound/resources/reports/factcheck/claims.py index 3aac8630..e591f5d9 100644 --- a/src/profound/resources/reports/factcheck/claims.py +++ b/src/profound/resources/reports/factcheck/claims.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Optional +from typing import Any, List, Optional, cast from typing_extensions import Literal import httpx -from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -17,9 +17,11 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ...._streaming import Stream, AsyncStream from ...._base_client import make_request_options from ....types.reports.factcheck import claim_query_claims_params, claim_stream_claims_params from ....types.reports.factcheck.claim_query_claims_response import ClaimQueryClaimsResponse +from ....types.reports.factcheck.claim_stream_claims_response import ClaimStreamClaimsResponse __all__ = ["ClaimsResource", "AsyncClaimsResource"] @@ -130,7 +132,7 @@ def stream_claims( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[ClaimStreamClaimsResponse]: """ Stream Claims @@ -158,7 +160,7 @@ def stream_claims( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/reports/factcheck/claims/stream", body=maybe_transform( @@ -178,7 +180,11 @@ def stream_claims( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ClaimStreamClaimsResponse + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[ClaimStreamClaimsResponse], ) @@ -288,7 +294,7 @@ async def stream_claims( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[ClaimStreamClaimsResponse]: """ Stream Claims @@ -316,7 +322,7 @@ async def stream_claims( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/reports/factcheck/claims/stream", body=await async_maybe_transform( @@ -336,7 +342,11 @@ async def stream_claims( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ClaimStreamClaimsResponse + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[ClaimStreamClaimsResponse], ) diff --git a/src/profound/resources/reports/factcheck/factcheck.py b/src/profound/resources/reports/factcheck/factcheck.py index 48ab187a..b748ca0f 100644 --- a/src/profound/resources/reports/factcheck/factcheck.py +++ b/src/profound/resources/reports/factcheck/factcheck.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import Any, List, Optional, cast from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ ClaimsResourceWithStreamingResponse, AsyncClaimsResourceWithStreamingResponse, ) -from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -25,9 +25,11 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ...._streaming import Stream, AsyncStream from ...._base_client import make_request_options from ....types.reports import factcheck_query_scores_params, factcheck_stream_scores_params from ....types.reports.factcheck_query_scores_response import FactcheckQueryScoresResponse +from ....types.reports.factcheck_stream_scores_response import FactcheckStreamScoresResponse __all__ = ["FactcheckResource", "AsyncFactcheckResource"] @@ -139,7 +141,7 @@ def stream_scores( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[FactcheckStreamScoresResponse]: """ Stream Scores @@ -165,7 +167,7 @@ def stream_scores( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/reports/factcheck/stream", body=maybe_transform( @@ -184,7 +186,11 @@ def stream_scores( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, FactcheckStreamScoresResponse + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[FactcheckStreamScoresResponse], ) @@ -295,7 +301,7 @@ async def stream_scores( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[FactcheckStreamScoresResponse]: """ Stream Scores @@ -321,7 +327,7 @@ async def stream_scores( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/reports/factcheck/stream", body=await async_maybe_transform( @@ -340,7 +346,11 @@ async def stream_scores( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, FactcheckStreamScoresResponse + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[FactcheckStreamScoresResponse], ) diff --git a/src/profound/resources/reports/reports.py b/src/profound/resources/reports/reports.py index e07a7b97..8fa84fd5 100644 --- a/src/profound/resources/reports/reports.py +++ b/src/profound/resources/reports/reports.py @@ -30,7 +30,7 @@ report_stream_visibility_v2_params, report_get_referrals_report_v2_params, ) -from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .accuracy import ( AccuracyResource, @@ -85,6 +85,10 @@ from ...types.report_stream_sentiment_response import ReportStreamSentimentResponse from ...types.report_stream_visibility_response import ReportStreamVisibilityResponse from ...types.report_query_query_fanouts_response import ReportQueryQueryFanoutsResponse +from ...types.report_stream_citations_v2_response import ReportStreamCitationsV2Response +from ...types.report_stream_sentiment_v2_response import ReportStreamSentimentV2Response +from ...types.report_stream_query_fanouts_response import ReportStreamQueryFanoutsResponse +from ...types.report_stream_visibility_v2_response import ReportStreamVisibilityV2Response __all__ = ["ReportsResource", "AsyncReportsResource"] @@ -1286,7 +1290,7 @@ def stream_citations_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[ReportStreamCitationsV2Response]: """ Stream Citations V2 @@ -1318,7 +1322,7 @@ def stream_citations_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/reports/citations/stream", body=maybe_transform( @@ -1341,7 +1345,11 @@ def stream_citations_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamCitationsV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[ReportStreamCitationsV2Response], ) def stream_query_fanouts( @@ -1365,7 +1373,7 @@ def stream_query_fanouts( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[ReportStreamQueryFanoutsResponse]: """ Stream Query Fanouts V2 @@ -1388,7 +1396,7 @@ def stream_query_fanouts( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/reports/query-fanouts/stream", body=maybe_transform( @@ -1410,7 +1418,11 @@ def stream_query_fanouts( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamQueryFanoutsResponse + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[ReportStreamQueryFanoutsResponse], ) def stream_sentiment( @@ -1543,7 +1555,7 @@ def stream_sentiment_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[ReportStreamSentimentV2Response]: """ Stream Sentiment V2 @@ -1574,7 +1586,7 @@ def stream_sentiment_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/reports/sentiment/stream", body=maybe_transform( @@ -1600,7 +1612,11 @@ def stream_sentiment_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamSentimentV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[ReportStreamSentimentV2Response], ) def stream_visibility( @@ -1726,7 +1742,7 @@ def stream_visibility_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> Stream[ReportStreamVisibilityV2Response]: """ Stream Visibility V2 @@ -1751,7 +1767,7 @@ def stream_visibility_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return self._post( "/v2/reports/visibility/stream", body=maybe_transform( @@ -1775,7 +1791,11 @@ def stream_visibility_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamVisibilityV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=Stream[ReportStreamVisibilityV2Response], ) def visibility( @@ -3072,7 +3092,7 @@ async def stream_citations_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[ReportStreamCitationsV2Response]: """ Stream Citations V2 @@ -3104,7 +3124,7 @@ async def stream_citations_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/reports/citations/stream", body=await async_maybe_transform( @@ -3127,7 +3147,11 @@ async def stream_citations_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamCitationsV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[ReportStreamCitationsV2Response], ) async def stream_query_fanouts( @@ -3151,7 +3175,7 @@ async def stream_query_fanouts( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[ReportStreamQueryFanoutsResponse]: """ Stream Query Fanouts V2 @@ -3174,7 +3198,7 @@ async def stream_query_fanouts( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/reports/query-fanouts/stream", body=await async_maybe_transform( @@ -3196,7 +3220,11 @@ async def stream_query_fanouts( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamQueryFanoutsResponse + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[ReportStreamQueryFanoutsResponse], ) async def stream_sentiment( @@ -3329,7 +3357,7 @@ async def stream_sentiment_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[ReportStreamSentimentV2Response]: """ Stream Sentiment V2 @@ -3360,7 +3388,7 @@ async def stream_sentiment_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/reports/sentiment/stream", body=await async_maybe_transform( @@ -3386,7 +3414,11 @@ async def stream_sentiment_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamSentimentV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[ReportStreamSentimentV2Response], ) async def stream_visibility( @@ -3512,7 +3544,7 @@ async def stream_visibility_v2( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> None: + ) -> AsyncStream[ReportStreamVisibilityV2Response]: """ Stream Visibility V2 @@ -3537,7 +3569,7 @@ async def stream_visibility_v2( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {"Accept": "text/event-stream", **(extra_headers or {})} return await self._post( "/v2/reports/visibility/stream", body=await async_maybe_transform( @@ -3561,7 +3593,11 @@ async def stream_visibility_v2( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=cast( + Any, ReportStreamVisibilityV2Response + ), # Union types cannot be passed in as arguments in the type system + stream=True, + stream_cls=AsyncStream[ReportStreamVisibilityV2Response], ) async def visibility( diff --git a/src/profound/types/__init__.py b/src/profound/types/__init__.py index 59a43853..b071faa7 100644 --- a/src/profound/types/__init__.py +++ b/src/profound/types/__init__.py @@ -97,6 +97,7 @@ from .report_stream_citations_response import ReportStreamCitationsResponse as ReportStreamCitationsResponse from .report_stream_sentiment_response import ReportStreamSentimentResponse as ReportStreamSentimentResponse from .organization_list_assets_response import OrganizationListAssetsResponse as OrganizationListAssetsResponse +from .prompt_stream_answers_v2_response import PromptStreamAnswersV2Response as PromptStreamAnswersV2Response from .report_query_query_fanouts_params import ReportQueryQueryFanoutsParams as ReportQueryQueryFanoutsParams from .report_stream_citations_v2_params import ReportStreamCitationsV2Params as ReportStreamCitationsV2Params from .report_stream_sentiment_v2_params import ReportStreamSentimentV2Params as ReportStreamSentimentV2Params @@ -106,4 +107,8 @@ from .report_stream_query_fanouts_params import ReportStreamQueryFanoutsParams as ReportStreamQueryFanoutsParams from .report_stream_visibility_v2_params import ReportStreamVisibilityV2Params as ReportStreamVisibilityV2Params from .report_query_query_fanouts_response import ReportQueryQueryFanoutsResponse as ReportQueryQueryFanoutsResponse +from .report_stream_citations_v2_response import ReportStreamCitationsV2Response as ReportStreamCitationsV2Response +from .report_stream_sentiment_v2_response import ReportStreamSentimentV2Response as ReportStreamSentimentV2Response +from .report_stream_query_fanouts_response import ReportStreamQueryFanoutsResponse as ReportStreamQueryFanoutsResponse +from .report_stream_visibility_v2_response import ReportStreamVisibilityV2Response as ReportStreamVisibilityV2Response from .report_get_referrals_report_v2_params import ReportGetReferralsReportV2Params as ReportGetReferralsReportV2Params diff --git a/src/profound/types/prompt_answers_v2_response.py b/src/profound/types/prompt_answers_v2_response.py index 270f72b4..b8712765 100644 --- a/src/profound/types/prompt_answers_v2_response.py +++ b/src/profound/types/prompt_answers_v2_response.py @@ -1,8 +1,118 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Dict, List, Optional -__all__ = ["PromptAnswersV2Response"] +from pydantic import Field as FieldInfo -PromptAnswersV2Response: TypeAlias = Dict[str, object] +from .._models import BaseModel + +__all__ = ["PromptAnswersV2Response", "Data", "DataModel", "Info"] + + +class DataModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class Data(BaseModel): + """One answer row. + + Present fields depend on `include`; `model` is an `{id, name}` reference. + """ + + analysis_types: Optional[List[str]] = None + + citations: Optional[List[str]] = None + + date: Optional[str] = None + + mentions: Optional[List[str]] = None + + model: Optional[DataModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + persona: Optional[str] = None + + prompt: Optional[str] = None + + prompt_id: Optional[str] = None + + region: Optional[str] = None + + response: Optional[str] = None + + run_id: Optional[str] = None + + search_queries: Optional[List[str]] = None + + sentiment_claims: Optional[List[Dict[str, object]]] = None + + tags: Optional[List[str]] = None + + topic: Optional[str] = None + + topic_id: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + include: List[str] + """Row fields returned (echoes `include`, or all fields when omitted).""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class PromptAnswersV2Response(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/prompt_stream_answers_v2_response.py b/src/profound/types/prompt_stream_answers_v2_response.py new file mode 100644 index 00000000..6b19e3d2 --- /dev/null +++ b/src/profound/types/prompt_stream_answers_v2_response.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["PromptStreamAnswersV2Response", "AnswersV2Info", "AnswerRow", "AnswerRowModel"] + + +class AnswersV2Info(BaseModel): + """`summary` event payload (the report `info` block).""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + include: List[str] + """Row fields returned (echoes `include`, or all fields when omitted).""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class AnswerRowModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class AnswerRow(BaseModel): + """`result` event payload — one answer row.""" + + analysis_types: Optional[List[str]] = None + + citations: Optional[List[str]] = None + + date: Optional[str] = None + + mentions: Optional[List[str]] = None + + model: Optional[AnswerRowModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + persona: Optional[str] = None + + prompt: Optional[str] = None + + prompt_id: Optional[str] = None + + region: Optional[str] = None + + response: Optional[str] = None + + run_id: Optional[str] = None + + search_queries: Optional[List[str]] = None + + sentiment_claims: Optional[List[Dict[str, object]]] = None + + tags: Optional[List[str]] = None + + topic: Optional[str] = None + + topic_id: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +PromptStreamAnswersV2Response: TypeAlias = Union[AnswersV2Info, AnswerRow] diff --git a/src/profound/types/report_query_citations_response.py b/src/profound/types/report_query_citations_response.py index 9eab76aa..6827ccf0 100644 --- a/src/profound/types/report_query_citations_response.py +++ b/src/profound/types/report_query_citations_response.py @@ -1,8 +1,182 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Dict, List, Optional -__all__ = ["ReportQueryCitationsResponse"] +from pydantic import Field as FieldInfo -ReportQueryCitationsResponse: TypeAlias = Dict[str, object] +from .._models import BaseModel + +__all__ = [ + "ReportQueryCitationsResponse", + "Data", + "DataModel", + "DataPersona", + "DataPrompt", + "DataRegion", + "DataTopic", + "Info", +] + + +class DataModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class Data(BaseModel): + """One (source x group) row. + + Each row carries `domain` or `page`; group dims/metrics vary. + """ + + citation_share: Optional[float] = None + + count: Optional[int] = None + + date: Optional[str] = None + + domain: Optional[str] = None + + first_cited_at: Optional[str] = None + """Pages only.""" + + model: Optional[DataModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + page: Optional[str] = None + + persona: Optional[DataPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[DataPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + rank: Optional[int] = None + + region: Optional[DataRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + topic: Optional[DataTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + analysis_types: List[str] + """Analysis types the citations were drawn from.""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + metrics: List[str] + """Metrics returned per row.""" + + models: List[str] + """Display names of the models the report covers.""" + + scope: str + """Citation scope: `all` or `owned`.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ReportQueryCitationsResponse(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/report_query_query_fanouts_response.py b/src/profound/types/report_query_query_fanouts_response.py index cd517ad7..793cf301 100644 --- a/src/profound/types/report_query_query_fanouts_response.py +++ b/src/profound/types/report_query_query_fanouts_response.py @@ -1,8 +1,95 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Dict, List, Optional -__all__ = ["ReportQueryQueryFanoutsResponse"] +from pydantic import Field as FieldInfo -ReportQueryQueryFanoutsResponse: TypeAlias = Dict[str, object] +from .._models import BaseModel + +__all__ = ["ReportQueryQueryFanoutsResponse", "Data", "Info"] + + +class Data(BaseModel): + """One row. + + Group dimensions are plain values (not `{id, name}`); metrics present depend on `metrics`. + """ + + date: Optional[str] = None + + fanouts_per_execution: Optional[float] = None + + model: Optional[str] = None + + prompt: Optional[str] = None + + query: Optional[str] = None + + query_variations: Optional[int] = None + + rank: Optional[int] = None + + region: Optional[str] = None + + share: Optional[float] = None + + total_fanouts: Optional[float] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + count: int + """Number of rows returned in `data` for this page.""" + + coverage_note: str + """Caveat about which runs the fanout metrics cover.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + metrics: List[str] + """Fanout metrics returned per row.""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ReportQueryQueryFanoutsResponse(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/report_query_sentiment_response.py b/src/profound/types/report_query_sentiment_response.py index 48876582..c0415c28 100644 --- a/src/profound/types/report_query_sentiment_response.py +++ b/src/profound/types/report_query_sentiment_response.py @@ -1,8 +1,295 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Dict, List, Optional -__all__ = ["ReportQuerySentimentResponse"] +from pydantic import Field as FieldInfo -ReportQuerySentimentResponse: TypeAlias = Dict[str, object] +from .._models import BaseModel + +__all__ = [ + "ReportQuerySentimentResponse", + "Data", + "DataClaim", + "DataCompetitor", + "DataModel", + "DataPersona", + "DataPrevious", + "DataPrompt", + "DataRegion", + "DataRun", + "DataTag", + "DataTheme", + "DataTopic", + "Info", +] + + +class DataClaim(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataCompetitor(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPrevious(BaseModel): + """Comparison-window metrics (when requested).""" + + negative_sentiment: Optional[float] = None + + occurrence: Optional[float] = None + + positive_sentiment: Optional[float] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class DataPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataRun(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTag(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTheme(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class Data(BaseModel): + """One group-combination row. + + Group dims and metrics present depend on `group_by`/`metrics`. + """ + + cited_websites: Optional[List[str]] = None + + claim: Optional[DataClaim] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + competitor: Optional[DataCompetitor] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + date: Optional[str] = None + + model: Optional[DataModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + negative_sentiment: Optional[float] = None + + occurrence: Optional[float] = None + + persona: Optional[DataPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + positive_sentiment: Optional[float] = None + + prev_date: Optional[str] = None + + previous: Optional[DataPrevious] = None + """Comparison-window metrics (when requested).""" + + prompt: Optional[DataPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + rank: Optional[int] = None + + region: Optional[DataRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + run: Optional[DataRun] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + tag: Optional[DataTag] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + theme: Optional[DataTheme] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + topic: Optional[DataTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + asset: str + """The analyzed brand name.""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + metrics: List[str] + """Sentiment metrics returned per row.""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + comparison_end_date: Optional[str] = None + """Comparison-window end (when requested).""" + + comparison_start_date: Optional[str] = None + """Comparison-window start (when requested).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ReportQuerySentimentResponse(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/report_query_visibility_response.py b/src/profound/types/report_query_visibility_response.py index 39f6ed1a..41c6221f 100644 --- a/src/profound/types/report_query_visibility_response.py +++ b/src/profound/types/report_query_visibility_response.py @@ -1,8 +1,185 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Dict, List, Union, Optional -__all__ = ["ReportQueryVisibilityResponse"] +from pydantic import Field as FieldInfo -ReportQueryVisibilityResponse: TypeAlias = Dict[str, object] +from .._models import BaseModel + +__all__ = [ + "ReportQueryVisibilityResponse", + "Data", + "DataAsset", + "DataModel", + "DataPersona", + "DataPrompt", + "DataRegion", + "DataTopic", + "Info", +] + + +class DataAsset(BaseModel): + name: Optional[str] = None + + owned: Optional[bool] = None + """Whether the asset is owned by the category.""" + + +class DataModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class Data(BaseModel): + """One (asset x group) row. + + Group dimensions and metrics present depend on `group_by`/`metrics`. + """ + + asset: Optional[DataAsset] = None + + average_position: Optional[float] = None + + date: Optional[str] = None + + model: Optional[DataModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + persona: Optional[DataPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[DataPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + rank: Optional[int] = None + """Asset rank (only when not grouped).""" + + region: Optional[DataRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + share_of_voice: Optional[float] = None + + topic: Optional[DataTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + visibility_score: Optional[float] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + models: List[str] + """Display names of the models the report covers.""" + + scope: str + """Asset scope: `all` or `owned`.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + asset_filter: Union[Dict[str, object], List[str], str, None] = None + """Echoed `assets` selection (filter clause, name, or list), or null.""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ReportQueryVisibilityResponse(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/report_stream_citations_v2_response.py b/src/profound/types/report_stream_citations_v2_response.py new file mode 100644 index 00000000..71cfefec --- /dev/null +++ b/src/profound/types/report_stream_citations_v2_response.py @@ -0,0 +1,179 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ReportStreamCitationsV2Response", + "CitationsV2Info", + "CitationRow", + "CitationRowModel", + "CitationRowPersona", + "CitationRowPrompt", + "CitationRowRegion", + "CitationRowTopic", +] + + +class CitationsV2Info(BaseModel): + """`summary` event payload (the report `info` block).""" + + analysis_types: List[str] + """Analysis types the citations were drawn from.""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + metrics: List[str] + """Metrics returned per row.""" + + models: List[str] + """Display names of the models the report covers.""" + + scope: str + """Citation scope: `all` or `owned`.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class CitationRowModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class CitationRowPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class CitationRowPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class CitationRowRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class CitationRowTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class CitationRow(BaseModel): + """`result` event payload — one citation row.""" + + citation_share: Optional[float] = None + + count: Optional[int] = None + + date: Optional[str] = None + + domain: Optional[str] = None + + first_cited_at: Optional[str] = None + """Pages only.""" + + model: Optional[CitationRowModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + page: Optional[str] = None + + persona: Optional[CitationRowPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[CitationRowPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + rank: Optional[int] = None + + region: Optional[CitationRowRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + topic: Optional[CitationRowTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ReportStreamCitationsV2Response: TypeAlias = Union[CitationsV2Info, CitationRow] diff --git a/src/profound/types/report_stream_query_fanouts_response.py b/src/profound/types/report_stream_query_fanouts_response.py new file mode 100644 index 00000000..054beb8a --- /dev/null +++ b/src/profound/types/report_stream_query_fanouts_response.py @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["ReportStreamQueryFanoutsResponse", "QueryFanoutsV2Info", "QueryFanoutRow"] + + +class QueryFanoutsV2Info(BaseModel): + """`summary` event payload (the report `info` block).""" + + count: int + """Number of rows returned in `data` for this page.""" + + coverage_note: str + """Caveat about which runs the fanout metrics cover.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + metrics: List[str] + """Fanout metrics returned per row.""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class QueryFanoutRow(BaseModel): + """`result` event payload — one query-fanout row.""" + + date: Optional[str] = None + + fanouts_per_execution: Optional[float] = None + + model: Optional[str] = None + + prompt: Optional[str] = None + + query: Optional[str] = None + + query_variations: Optional[int] = None + + rank: Optional[int] = None + + region: Optional[str] = None + + share: Optional[float] = None + + total_fanouts: Optional[float] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ReportStreamQueryFanoutsResponse: TypeAlias = Union[QueryFanoutsV2Info, QueryFanoutRow] diff --git a/src/profound/types/report_stream_sentiment_v2_response.py b/src/profound/types/report_stream_sentiment_v2_response.py new file mode 100644 index 00000000..2fc57aad --- /dev/null +++ b/src/profound/types/report_stream_sentiment_v2_response.py @@ -0,0 +1,292 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ReportStreamSentimentV2Response", + "SentimentV2Info", + "SentimentRow", + "SentimentRowClaim", + "SentimentRowCompetitor", + "SentimentRowModel", + "SentimentRowPersona", + "SentimentRowPrevious", + "SentimentRowPrompt", + "SentimentRowRegion", + "SentimentRowRun", + "SentimentRowTag", + "SentimentRowTheme", + "SentimentRowTopic", +] + + +class SentimentV2Info(BaseModel): + """`summary` event payload (the report `info` block).""" + + asset: str + """The analyzed brand name.""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + metrics: List[str] + """Sentiment metrics returned per row.""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + comparison_end_date: Optional[str] = None + """Comparison-window end (when requested).""" + + comparison_start_date: Optional[str] = None + """Comparison-window start (when requested).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class SentimentRowClaim(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowCompetitor(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowPrevious(BaseModel): + """Comparison-window metrics (when requested).""" + + negative_sentiment: Optional[float] = None + + occurrence: Optional[float] = None + + positive_sentiment: Optional[float] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class SentimentRowPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowRun(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowTag(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowTheme(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRowTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class SentimentRow(BaseModel): + """`result` event payload — one sentiment row.""" + + cited_websites: Optional[List[str]] = None + + claim: Optional[SentimentRowClaim] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + competitor: Optional[SentimentRowCompetitor] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + date: Optional[str] = None + + model: Optional[SentimentRowModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + negative_sentiment: Optional[float] = None + + occurrence: Optional[float] = None + + persona: Optional[SentimentRowPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + positive_sentiment: Optional[float] = None + + prev_date: Optional[str] = None + + previous: Optional[SentimentRowPrevious] = None + """Comparison-window metrics (when requested).""" + + prompt: Optional[SentimentRowPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + rank: Optional[int] = None + + region: Optional[SentimentRowRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + run: Optional[SentimentRowRun] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + tag: Optional[SentimentRowTag] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + theme: Optional[SentimentRowTheme] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + topic: Optional[SentimentRowTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ReportStreamSentimentV2Response: TypeAlias = Union[SentimentV2Info, SentimentRow] diff --git a/src/profound/types/report_stream_visibility_v2_response.py b/src/profound/types/report_stream_visibility_v2_response.py new file mode 100644 index 00000000..75b3e58e --- /dev/null +++ b/src/profound/types/report_stream_visibility_v2_response.py @@ -0,0 +1,182 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = [ + "ReportStreamVisibilityV2Response", + "VisibilityV2Info", + "VisibilityRow", + "VisibilityRowAsset", + "VisibilityRowModel", + "VisibilityRowPersona", + "VisibilityRowPrompt", + "VisibilityRowRegion", + "VisibilityRowTopic", +] + + +class VisibilityV2Info(BaseModel): + """`summary` event payload (the report `info` block).""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + models: List[str] + """Display names of the models the report covers.""" + + scope: str + """Asset scope: `all` or `owned`.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + asset_filter: Union[Dict[str, object], List[str], str, None] = None + """Echoed `assets` selection (filter clause, name, or list), or null.""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class VisibilityRowAsset(BaseModel): + name: Optional[str] = None + + owned: Optional[bool] = None + """Whether the asset is owned by the category.""" + + +class VisibilityRowModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class VisibilityRowPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class VisibilityRowPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class VisibilityRowRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class VisibilityRowTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class VisibilityRow(BaseModel): + """`result` event payload — one visibility row.""" + + asset: Optional[VisibilityRowAsset] = None + + average_position: Optional[float] = None + + date: Optional[str] = None + + model: Optional[VisibilityRowModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + persona: Optional[VisibilityRowPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[VisibilityRowPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + rank: Optional[int] = None + """Asset rank (only when not grouped).""" + + region: Optional[VisibilityRowRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + share_of_voice: Optional[float] = None + + topic: Optional[VisibilityRowTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + visibility_score: Optional[float] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ReportStreamVisibilityV2Response: TypeAlias = Union[VisibilityV2Info, VisibilityRow] diff --git a/src/profound/types/reports/__init__.py b/src/profound/types/reports/__init__.py index 9ad2e13a..ba3ddac3 100644 --- a/src/profound/types/reports/__init__.py +++ b/src/profound/types/reports/__init__.py @@ -21,6 +21,7 @@ from .web_search_result_stream_params import WebSearchResultStreamParams as WebSearchResultStreamParams from .accuracy_create_breakdown_params import AccuracyCreateBreakdownParams as AccuracyCreateBreakdownParams from .accuracy_create_topic_ids_params import AccuracyCreateTopicIDsParams as AccuracyCreateTopicIDsParams +from .factcheck_stream_scores_response import FactcheckStreamScoresResponse as FactcheckStreamScoresResponse from .shopping_merchant_share_response import ShoppingMerchantShareResponse as ShoppingMerchantShareResponse from .web_search_result_query_response import WebSearchResultQueryResponse as WebSearchResultQueryResponse from .accuracy_create_overview_response import AccuracyCreateOverviewResponse as AccuracyCreateOverviewResponse diff --git a/src/profound/types/reports/factcheck/__init__.py b/src/profound/types/reports/factcheck/__init__.py index d159fea5..0285e14a 100644 --- a/src/profound/types/reports/factcheck/__init__.py +++ b/src/profound/types/reports/factcheck/__init__.py @@ -5,3 +5,4 @@ from .claim_query_claims_params import ClaimQueryClaimsParams as ClaimQueryClaimsParams from .claim_stream_claims_params import ClaimStreamClaimsParams as ClaimStreamClaimsParams from .claim_query_claims_response import ClaimQueryClaimsResponse as ClaimQueryClaimsResponse +from .claim_stream_claims_response import ClaimStreamClaimsResponse as ClaimStreamClaimsResponse diff --git a/src/profound/types/reports/factcheck/claim_query_claims_response.py b/src/profound/types/reports/factcheck/claim_query_claims_response.py index 232a7e48..aae68bb6 100644 --- a/src/profound/types/reports/factcheck/claim_query_claims_response.py +++ b/src/profound/types/reports/factcheck/claim_query_claims_response.py @@ -1,8 +1,322 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict +from typing import TYPE_CHECKING, Dict, List, Union, Optional from typing_extensions import TypeAlias -__all__ = ["ClaimQueryClaimsResponse"] +from pydantic import Field as FieldInfo -ClaimQueryClaimsResponse: TypeAlias = Dict[str, object] +from ...._models import BaseModel + +__all__ = [ + "ClaimQueryClaimsResponse", + "Data", + "DataCitationSource", + "DataClaim", + "DataClaimCitationSource", + "DataClaimEvidence", + "DataClaimModel", + "DataEvidence", + "DataModel", + "DataPersona", + "DataPrompt", + "DataRegion", + "DataTag", + "DataTheme", + "DataThemeDimensionRef", + "DataTopic", + "Info", +] + + +class DataCitationSource(BaseModel): + citation_category: Optional[str] = None + + citation_share: Optional[float] = None + + domain_category: Optional[str] = None + + hostname: Optional[str] = None + + href: Optional[str] = None + + snippet: Optional[str] = None + + +class DataClaimCitationSource(BaseModel): + citation_category: Optional[str] = None + + citation_share: Optional[float] = None + + domain_category: Optional[str] = None + + hostname: Optional[str] = None + + href: Optional[str] = None + + snippet: Optional[str] = None + + +class DataClaimEvidence(BaseModel): + id: Optional[str] = None + + kb_path: Optional[str] = None + + kb_snippet: Optional[str] = None + + source_updated_at: Optional[str] = None + + +class DataClaimModel(BaseModel): + id: Optional[str] = None + + name: Optional[str] = None + + occurrence: Optional[float] = None + + +class DataClaim(BaseModel): + """One inaccurate claim. + + `theme`/`reasoning`/`models`/`evidence`/`citation_sources` follow `include`. + """ + + citation_sources: Optional[List[DataClaimCitationSource]] = None + + claim: Optional[str] = None + + cluster_id: Optional[str] = None + + evidence: Optional[List[DataClaimEvidence]] = None + + models: Optional[List[DataClaimModel]] = None + + occurrence: Optional[float] = None + + reasoning: Optional[str] = None + + theme: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class DataEvidence(BaseModel): + id: Optional[str] = None + + kb_path: Optional[str] = None + + kb_snippet: Optional[str] = None + + source_updated_at: Optional[str] = None + + +class DataModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTag(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataThemeDimensionRef(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +DataTheme: TypeAlias = Union[str, DataThemeDimensionRef, None] + + +class DataTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class Data(BaseModel): + """ + A flat claim, or (with `group_by`) a section: a dimension + accuracy rollup + its `claims`. + + Present fields depend on `group_by`/`include`. + """ + + accuracy: Optional[float] = None + + accurate: Optional[int] = None + + citation_sources: Optional[List[DataCitationSource]] = None + + claim: Optional[str] = None + + claims: Optional[List[DataClaim]] = None + + cluster_id: Optional[str] = None + + evidence: Optional[List[DataEvidence]] = None + + inaccurate: Optional[int] = None + + model: Optional[DataModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + models: Optional[List[DataModel]] = None + + occurrence: Optional[float] = None + + persona: Optional[DataPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[DataPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + reasoning: Optional[str] = None + + region: Optional[DataRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + tag: Optional[DataTag] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + theme: Optional[DataTheme] = None + """Claim theme (string), or an `{id, name}` ref when sectioning by `theme`.""" + + topic: Optional[DataTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + total_claims: Optional[int] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + group_by: List[str] + """Dimension the claims are sectioned by (empty → one flat list).""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + include: Optional[List[str]] = None + """Per-claim detail fields requested.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ClaimQueryClaimsResponse(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/reports/factcheck/claim_stream_claims_response.py b/src/profound/types/reports/factcheck/claim_stream_claims_response.py new file mode 100644 index 00000000..bac661f2 --- /dev/null +++ b/src/profound/types/reports/factcheck/claim_stream_claims_response.py @@ -0,0 +1,317 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "ClaimStreamClaimsResponse", + "FactcheckClaimsInfo", + "FactcheckClaimsRow", + "FactcheckClaimsRowCitationSource", + "FactcheckClaimsRowClaim", + "FactcheckClaimsRowClaimCitationSource", + "FactcheckClaimsRowClaimEvidence", + "FactcheckClaimsRowClaimModel", + "FactcheckClaimsRowEvidence", + "FactcheckClaimsRowModel", + "FactcheckClaimsRowPersona", + "FactcheckClaimsRowPrompt", + "FactcheckClaimsRowRegion", + "FactcheckClaimsRowTag", + "FactcheckClaimsRowTheme", + "FactcheckClaimsRowThemeDimensionRef", + "FactcheckClaimsRowTopic", +] + + +class FactcheckClaimsInfo(BaseModel): + """`summary` event payload (the report `info` block).""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + group_by: List[str] + """Dimension the claims are sectioned by (empty → one flat list).""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + include: Optional[List[str]] = None + """Per-claim detail fields requested.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class FactcheckClaimsRowCitationSource(BaseModel): + citation_category: Optional[str] = None + + citation_share: Optional[float] = None + + domain_category: Optional[str] = None + + hostname: Optional[str] = None + + href: Optional[str] = None + + snippet: Optional[str] = None + + +class FactcheckClaimsRowClaimCitationSource(BaseModel): + citation_category: Optional[str] = None + + citation_share: Optional[float] = None + + domain_category: Optional[str] = None + + hostname: Optional[str] = None + + href: Optional[str] = None + + snippet: Optional[str] = None + + +class FactcheckClaimsRowClaimEvidence(BaseModel): + id: Optional[str] = None + + kb_path: Optional[str] = None + + kb_snippet: Optional[str] = None + + source_updated_at: Optional[str] = None + + +class FactcheckClaimsRowClaimModel(BaseModel): + id: Optional[str] = None + + name: Optional[str] = None + + occurrence: Optional[float] = None + + +class FactcheckClaimsRowClaim(BaseModel): + """One inaccurate claim. + + `theme`/`reasoning`/`models`/`evidence`/`citation_sources` follow `include`. + """ + + citation_sources: Optional[List[FactcheckClaimsRowClaimCitationSource]] = None + + claim: Optional[str] = None + + cluster_id: Optional[str] = None + + evidence: Optional[List[FactcheckClaimsRowClaimEvidence]] = None + + models: Optional[List[FactcheckClaimsRowClaimModel]] = None + + occurrence: Optional[float] = None + + reasoning: Optional[str] = None + + theme: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class FactcheckClaimsRowEvidence(BaseModel): + id: Optional[str] = None + + kb_path: Optional[str] = None + + kb_snippet: Optional[str] = None + + source_updated_at: Optional[str] = None + + +class FactcheckClaimsRowModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckClaimsRowPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckClaimsRowPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckClaimsRowRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckClaimsRowTag(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckClaimsRowThemeDimensionRef(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +FactcheckClaimsRowTheme: TypeAlias = Union[str, FactcheckClaimsRowThemeDimensionRef, None] + + +class FactcheckClaimsRowTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckClaimsRow(BaseModel): + """`result` event payload — one inaccurate claim.""" + + accuracy: Optional[float] = None + + accurate: Optional[int] = None + + citation_sources: Optional[List[FactcheckClaimsRowCitationSource]] = None + + claim: Optional[str] = None + + claims: Optional[List[FactcheckClaimsRowClaim]] = None + + cluster_id: Optional[str] = None + + evidence: Optional[List[FactcheckClaimsRowEvidence]] = None + + inaccurate: Optional[int] = None + + model: Optional[FactcheckClaimsRowModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + models: Optional[List[FactcheckClaimsRowModel]] = None + + occurrence: Optional[float] = None + + persona: Optional[FactcheckClaimsRowPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[FactcheckClaimsRowPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + reasoning: Optional[str] = None + + region: Optional[FactcheckClaimsRowRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + tag: Optional[FactcheckClaimsRowTag] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + theme: Optional[FactcheckClaimsRowTheme] = None + """Claim theme (string), or an `{id, name}` ref when sectioning by `theme`.""" + + topic: Optional[FactcheckClaimsRowTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + total_claims: Optional[int] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +ClaimStreamClaimsResponse: TypeAlias = Union[FactcheckClaimsInfo, FactcheckClaimsRow] diff --git a/src/profound/types/reports/factcheck_query_scores_response.py b/src/profound/types/reports/factcheck_query_scores_response.py index 2e91d4b1..d199cf1e 100644 --- a/src/profound/types/reports/factcheck_query_scores_response.py +++ b/src/profound/types/reports/factcheck_query_scores_response.py @@ -1,8 +1,211 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict -from typing_extensions import TypeAlias +from typing import TYPE_CHECKING, Dict, List, Optional -__all__ = ["FactcheckQueryScoresResponse"] +from pydantic import Field as FieldInfo -FactcheckQueryScoresResponse: TypeAlias = Dict[str, object] +from ..._models import BaseModel + +__all__ = [ + "FactcheckQueryScoresResponse", + "Data", + "DataCitation", + "DataModel", + "DataPersona", + "DataPrompt", + "DataRegion", + "DataTag", + "DataTheme", + "DataTopic", + "Info", +] + + +class DataCitation(BaseModel): + citation_category: Optional[str] = None + + url: Optional[str] = None + + +class DataModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTag(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTheme(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class DataTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class Data(BaseModel): + """ + An accuracy score row: the headline (no dims), a daily point, or a per-dimension breakdown. + """ + + accuracy: Optional[float] = None + + accurate: Optional[int] = None + + citation: Optional[DataCitation] = None + + date: Optional[str] = None + + inaccurate: Optional[int] = None + + model: Optional[DataModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + persona: Optional[DataPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[DataPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + region: Optional[DataRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + tag: Optional[DataTag] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + theme: Optional[DataTheme] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + topic: Optional[DataTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class Info(BaseModel): + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + group_by: List[str] + """Dimensions the scores are sliced by (empty → headline).""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class FactcheckQueryScoresResponse(BaseModel): + data: List[Data] + + info: Info diff --git a/src/profound/types/reports/factcheck_stream_scores_response.py b/src/profound/types/reports/factcheck_stream_scores_response.py new file mode 100644 index 00000000..8e84473b --- /dev/null +++ b/src/profound/types/reports/factcheck_stream_scores_response.py @@ -0,0 +1,209 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = [ + "FactcheckStreamScoresResponse", + "FactcheckScoresInfo", + "FactcheckScoreRow", + "FactcheckScoreRowCitation", + "FactcheckScoreRowModel", + "FactcheckScoreRowPersona", + "FactcheckScoreRowPrompt", + "FactcheckScoreRowRegion", + "FactcheckScoreRowTag", + "FactcheckScoreRowTheme", + "FactcheckScoreRowTopic", +] + + +class FactcheckScoresInfo(BaseModel): + """`summary` event payload (the report `info` block).""" + + count: int + """Number of rows returned in `data` for this page.""" + + end_date: str + """Echoed request end date (YYYY-MM-DD, ET).""" + + group_by: List[str] + """Dimensions the scores are sliced by (empty → headline).""" + + models: List[str] + """Display names of the models the report covers.""" + + start_date: str + """Echoed request start date (YYYY-MM-DD, ET).""" + + filter: Optional[Dict[str, object]] = None + """Echoed normalized filter tree, or null when no filter was sent.""" + + next_cursor: Optional[str] = None + """Opaque cursor for the next page; null on the last page.""" + + total_results: Optional[int] = None + """Total rows matching the query before pagination (null when not computed).""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class FactcheckScoreRowCitation(BaseModel): + citation_category: Optional[str] = None + + url: Optional[str] = None + + +class FactcheckScoreRowModel(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRowPersona(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRowPrompt(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRowRegion(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRowTag(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRowTheme(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRowTopic(BaseModel): + """ + An ``{id, name}`` reference for a grouped dimension value (model, topic, region, …). + """ + + id: Optional[str] = None + + name: Optional[str] = None + + +class FactcheckScoreRow(BaseModel): + """`result` event payload — one accuracy score row.""" + + accuracy: Optional[float] = None + + accurate: Optional[int] = None + + citation: Optional[FactcheckScoreRowCitation] = None + + date: Optional[str] = None + + inaccurate: Optional[int] = None + + model: Optional[FactcheckScoreRowModel] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + persona: Optional[FactcheckScoreRowPersona] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + prompt: Optional[FactcheckScoreRowPrompt] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + region: Optional[FactcheckScoreRowRegion] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + tag: Optional[FactcheckScoreRowTag] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + theme: Optional[FactcheckScoreRowTheme] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + topic: Optional[FactcheckScoreRowTopic] = None + """ + An `{id, name}` reference for a grouped dimension value (model, topic, region, + …). + """ + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +FactcheckStreamScoresResponse: TypeAlias = Union[FactcheckScoresInfo, FactcheckScoreRow] diff --git a/tests/api_resources/reports/factcheck/test_claims.py b/tests/api_resources/reports/factcheck/test_claims.py index d86839a8..47250a39 100644 --- a/tests/api_resources/reports/factcheck/test_claims.py +++ b/tests/api_resources/reports/factcheck/test_claims.py @@ -23,7 +23,7 @@ class TestClaims: @parametrize def test_method_query_claims(self, client: Profound) -> None: claim = client.reports.factcheck.claims.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -33,7 +33,7 @@ def test_method_query_claims(self, client: Profound) -> None: @parametrize def test_method_query_claims_with_all_params(self, client: Profound) -> None: claim = client.reports.factcheck.claims.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -55,7 +55,7 @@ def test_method_query_claims_with_all_params(self, client: Profound) -> None: @parametrize def test_raw_response_query_claims(self, client: Profound) -> None: response = client.reports.factcheck.claims.with_raw_response.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -69,7 +69,7 @@ def test_raw_response_query_claims(self, client: Profound) -> None: @parametrize def test_streaming_response_query_claims(self, client: Profound) -> None: with client.reports.factcheck.claims.with_streaming_response.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -84,18 +84,18 @@ def test_streaming_response_query_claims(self, client: Profound) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_claims(self, client: Profound) -> None: - claim = client.reports.factcheck.claims.stream_claims( - category_id="category_id", + claim_stream = client.reports.factcheck.claims.stream_claims( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert claim is None + claim_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_claims_with_all_params(self, client: Profound) -> None: - claim = client.reports.factcheck.claims.stream_claims( - category_id="category_id", + claim_stream = client.reports.factcheck.claims.stream_claims( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -111,35 +111,34 @@ def test_method_stream_claims_with_all_params(self, client: Profound) -> None: limit=1, max_results=1, ) - assert claim is None + claim_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stream_claims(self, client: Profound) -> None: response = client.reports.factcheck.claims.with_raw_response.stream_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - claim = response.parse() - assert claim is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stream_claims(self, client: Profound) -> None: with client.reports.factcheck.claims.with_streaming_response.stream_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - claim = response.parse() - assert claim is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -153,7 +152,7 @@ class TestAsyncClaims: @parametrize async def test_method_query_claims(self, async_client: AsyncProfound) -> None: claim = await async_client.reports.factcheck.claims.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -163,7 +162,7 @@ async def test_method_query_claims(self, async_client: AsyncProfound) -> None: @parametrize async def test_method_query_claims_with_all_params(self, async_client: AsyncProfound) -> None: claim = await async_client.reports.factcheck.claims.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -185,7 +184,7 @@ async def test_method_query_claims_with_all_params(self, async_client: AsyncProf @parametrize async def test_raw_response_query_claims(self, async_client: AsyncProfound) -> None: response = await async_client.reports.factcheck.claims.with_raw_response.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -199,7 +198,7 @@ async def test_raw_response_query_claims(self, async_client: AsyncProfound) -> N @parametrize async def test_streaming_response_query_claims(self, async_client: AsyncProfound) -> None: async with async_client.reports.factcheck.claims.with_streaming_response.query_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -214,18 +213,18 @@ async def test_streaming_response_query_claims(self, async_client: AsyncProfound @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_claims(self, async_client: AsyncProfound) -> None: - claim = await async_client.reports.factcheck.claims.stream_claims( - category_id="category_id", + claim_stream = await async_client.reports.factcheck.claims.stream_claims( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert claim is None + await claim_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_claims_with_all_params(self, async_client: AsyncProfound) -> None: - claim = await async_client.reports.factcheck.claims.stream_claims( - category_id="category_id", + claim_stream = await async_client.reports.factcheck.claims.stream_claims( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -241,34 +240,33 @@ async def test_method_stream_claims_with_all_params(self, async_client: AsyncPro limit=1, max_results=1, ) - assert claim is None + await claim_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stream_claims(self, async_client: AsyncProfound) -> None: response = await async_client.reports.factcheck.claims.with_raw_response.stream_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - claim = await response.parse() - assert claim is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stream_claims(self, async_client: AsyncProfound) -> None: async with async_client.reports.factcheck.claims.with_streaming_response.stream_claims( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - claim = await response.parse() - assert claim is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/reports/test_factcheck.py b/tests/api_resources/reports/test_factcheck.py index 075d48d2..68576b17 100644 --- a/tests/api_resources/reports/test_factcheck.py +++ b/tests/api_resources/reports/test_factcheck.py @@ -23,7 +23,7 @@ class TestFactcheck: @parametrize def test_method_query_scores(self, client: Profound) -> None: factcheck = client.reports.factcheck.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -33,7 +33,7 @@ def test_method_query_scores(self, client: Profound) -> None: @parametrize def test_method_query_scores_with_all_params(self, client: Profound) -> None: factcheck = client.reports.factcheck.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -54,7 +54,7 @@ def test_method_query_scores_with_all_params(self, client: Profound) -> None: @parametrize def test_raw_response_query_scores(self, client: Profound) -> None: response = client.reports.factcheck.with_raw_response.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -68,7 +68,7 @@ def test_raw_response_query_scores(self, client: Profound) -> None: @parametrize def test_streaming_response_query_scores(self, client: Profound) -> None: with client.reports.factcheck.with_streaming_response.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -83,18 +83,18 @@ def test_streaming_response_query_scores(self, client: Profound) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_scores(self, client: Profound) -> None: - factcheck = client.reports.factcheck.stream_scores( - category_id="category_id", + factcheck_stream = client.reports.factcheck.stream_scores( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert factcheck is None + factcheck_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_scores_with_all_params(self, client: Profound) -> None: - factcheck = client.reports.factcheck.stream_scores( - category_id="category_id", + factcheck_stream = client.reports.factcheck.stream_scores( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -109,35 +109,34 @@ def test_method_stream_scores_with_all_params(self, client: Profound) -> None: limit=1, max_results=1, ) - assert factcheck is None + factcheck_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stream_scores(self, client: Profound) -> None: response = client.reports.factcheck.with_raw_response.stream_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - factcheck = response.parse() - assert factcheck is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stream_scores(self, client: Profound) -> None: with client.reports.factcheck.with_streaming_response.stream_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - factcheck = response.parse() - assert factcheck is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -151,7 +150,7 @@ class TestAsyncFactcheck: @parametrize async def test_method_query_scores(self, async_client: AsyncProfound) -> None: factcheck = await async_client.reports.factcheck.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -161,7 +160,7 @@ async def test_method_query_scores(self, async_client: AsyncProfound) -> None: @parametrize async def test_method_query_scores_with_all_params(self, async_client: AsyncProfound) -> None: factcheck = await async_client.reports.factcheck.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -182,7 +181,7 @@ async def test_method_query_scores_with_all_params(self, async_client: AsyncProf @parametrize async def test_raw_response_query_scores(self, async_client: AsyncProfound) -> None: response = await async_client.reports.factcheck.with_raw_response.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -196,7 +195,7 @@ async def test_raw_response_query_scores(self, async_client: AsyncProfound) -> N @parametrize async def test_streaming_response_query_scores(self, async_client: AsyncProfound) -> None: async with async_client.reports.factcheck.with_streaming_response.query_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -211,18 +210,18 @@ async def test_streaming_response_query_scores(self, async_client: AsyncProfound @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_scores(self, async_client: AsyncProfound) -> None: - factcheck = await async_client.reports.factcheck.stream_scores( - category_id="category_id", + factcheck_stream = await async_client.reports.factcheck.stream_scores( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert factcheck is None + await factcheck_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_scores_with_all_params(self, async_client: AsyncProfound) -> None: - factcheck = await async_client.reports.factcheck.stream_scores( - category_id="category_id", + factcheck_stream = await async_client.reports.factcheck.stream_scores( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -237,34 +236,33 @@ async def test_method_stream_scores_with_all_params(self, async_client: AsyncPro limit=1, max_results=1, ) - assert factcheck is None + await factcheck_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stream_scores(self, async_client: AsyncProfound) -> None: response = await async_client.reports.factcheck.with_raw_response.stream_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - factcheck = await response.parse() - assert factcheck is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stream_scores(self, async_client: AsyncProfound) -> None: async with async_client.reports.factcheck.with_streaming_response.stream_scores( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - factcheck = await response.parse() - assert factcheck is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_prompts.py b/tests/api_resources/test_prompts.py index 8950cabd..b59bcb1e 100644 --- a/tests/api_resources/test_prompts.py +++ b/tests/api_resources/test_prompts.py @@ -112,7 +112,7 @@ def test_streaming_response_answers(self, client: Profound) -> None: @parametrize def test_method_answers_v2(self, client: Profound) -> None: prompt = client.prompts.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -122,7 +122,7 @@ def test_method_answers_v2(self, client: Profound) -> None: @parametrize def test_method_answers_v2_with_all_params(self, client: Profound) -> None: prompt = client.prompts.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -143,7 +143,7 @@ def test_method_answers_v2_with_all_params(self, client: Profound) -> None: @parametrize def test_raw_response_answers_v2(self, client: Profound) -> None: response = client.prompts.with_raw_response.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -157,7 +157,7 @@ def test_raw_response_answers_v2(self, client: Profound) -> None: @parametrize def test_streaming_response_answers_v2(self, client: Profound) -> None: with client.prompts.with_streaming_response.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -172,18 +172,18 @@ def test_streaming_response_answers_v2(self, client: Profound) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_answers_v2(self, client: Profound) -> None: - prompt = client.prompts.stream_answers_v2( - category_id="category_id", + prompt_stream = client.prompts.stream_answers_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert prompt is None + prompt_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_answers_v2_with_all_params(self, client: Profound) -> None: - prompt = client.prompts.stream_answers_v2( - category_id="category_id", + prompt_stream = client.prompts.stream_answers_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -198,35 +198,34 @@ def test_method_stream_answers_v2_with_all_params(self, client: Profound) -> Non limit=1, max_results=1, ) - assert prompt is None + prompt_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stream_answers_v2(self, client: Profound) -> None: response = client.prompts.with_raw_response.stream_answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prompt = response.parse() - assert prompt is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stream_answers_v2(self, client: Profound) -> None: with client.prompts.with_streaming_response.stream_answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prompt = response.parse() - assert prompt is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -327,7 +326,7 @@ async def test_streaming_response_answers(self, async_client: AsyncProfound) -> @parametrize async def test_method_answers_v2(self, async_client: AsyncProfound) -> None: prompt = await async_client.prompts.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -337,7 +336,7 @@ async def test_method_answers_v2(self, async_client: AsyncProfound) -> None: @parametrize async def test_method_answers_v2_with_all_params(self, async_client: AsyncProfound) -> None: prompt = await async_client.prompts.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -358,7 +357,7 @@ async def test_method_answers_v2_with_all_params(self, async_client: AsyncProfou @parametrize async def test_raw_response_answers_v2(self, async_client: AsyncProfound) -> None: response = await async_client.prompts.with_raw_response.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -372,7 +371,7 @@ async def test_raw_response_answers_v2(self, async_client: AsyncProfound) -> Non @parametrize async def test_streaming_response_answers_v2(self, async_client: AsyncProfound) -> None: async with async_client.prompts.with_streaming_response.answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -387,18 +386,18 @@ async def test_streaming_response_answers_v2(self, async_client: AsyncProfound) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_answers_v2(self, async_client: AsyncProfound) -> None: - prompt = await async_client.prompts.stream_answers_v2( - category_id="category_id", + prompt_stream = await async_client.prompts.stream_answers_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert prompt is None + await prompt_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_answers_v2_with_all_params(self, async_client: AsyncProfound) -> None: - prompt = await async_client.prompts.stream_answers_v2( - category_id="category_id", + prompt_stream = await async_client.prompts.stream_answers_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -413,34 +412,33 @@ async def test_method_stream_answers_v2_with_all_params(self, async_client: Asyn limit=1, max_results=1, ) - assert prompt is None + await prompt_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stream_answers_v2(self, async_client: AsyncProfound) -> None: response = await async_client.prompts.with_raw_response.stream_answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prompt = await response.parse() - assert prompt is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stream_answers_v2(self, async_client: AsyncProfound) -> None: async with async_client.prompts.with_streaming_response.stream_answers_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - prompt = await response.parse() - assert prompt is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_reports.py b/tests/api_resources/test_reports.py index 0457add7..d684f4fe 100644 --- a/tests/api_resources/test_reports.py +++ b/tests/api_resources/test_reports.py @@ -392,7 +392,7 @@ def test_streaming_response_get_referrals_report_v2(self, client: Profound) -> N @parametrize def test_method_query_citations(self, client: Profound) -> None: report = client.reports.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -402,7 +402,7 @@ def test_method_query_citations(self, client: Profound) -> None: @parametrize def test_method_query_citations_with_all_params(self, client: Profound) -> None: report = client.reports.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -427,7 +427,7 @@ def test_method_query_citations_with_all_params(self, client: Profound) -> None: @parametrize def test_raw_response_query_citations(self, client: Profound) -> None: response = client.reports.with_raw_response.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -441,7 +441,7 @@ def test_raw_response_query_citations(self, client: Profound) -> None: @parametrize def test_streaming_response_query_citations(self, client: Profound) -> None: with client.reports.with_streaming_response.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -525,7 +525,7 @@ def test_streaming_response_query_fanouts(self, client: Profound) -> None: @parametrize def test_method_query_query_fanouts(self, client: Profound) -> None: report = client.reports.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -535,7 +535,7 @@ def test_method_query_query_fanouts(self, client: Profound) -> None: @parametrize def test_method_query_query_fanouts_with_all_params(self, client: Profound) -> None: report = client.reports.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -562,7 +562,7 @@ def test_method_query_query_fanouts_with_all_params(self, client: Profound) -> N @parametrize def test_raw_response_query_query_fanouts(self, client: Profound) -> None: response = client.reports.with_raw_response.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -576,7 +576,7 @@ def test_raw_response_query_query_fanouts(self, client: Profound) -> None: @parametrize def test_streaming_response_query_query_fanouts(self, client: Profound) -> None: with client.reports.with_streaming_response.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -940,18 +940,18 @@ def test_streaming_response_stream_citations(self, client: Profound) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_citations_v2(self, client: Profound) -> None: - report = client.reports.stream_citations_v2( - category_id="category_id", + report_stream = client.reports.stream_citations_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_citations_v2_with_all_params(self, client: Profound) -> None: - report = client.reports.stream_citations_v2( - category_id="category_id", + report_stream = client.reports.stream_citations_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -970,53 +970,52 @@ def test_method_stream_citations_v2_with_all_params(self, client: Profound) -> N metrics=["count"], scope="all", ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stream_citations_v2(self, client: Profound) -> None: response = client.reports.with_raw_response.stream_citations_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stream_citations_v2(self, client: Profound) -> None: with client.reports.with_streaming_response.stream_citations_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_query_fanouts(self, client: Profound) -> None: - report = client.reports.stream_query_fanouts( - category_id="category_id", + report_stream = client.reports.stream_query_fanouts( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_query_fanouts_with_all_params(self, client: Profound) -> None: - report = client.reports.stream_query_fanouts( - category_id="category_id", + report_stream = client.reports.stream_query_fanouts( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -1037,35 +1036,34 @@ def test_method_stream_query_fanouts_with_all_params(self, client: Profound) -> "dir": "asc", }, ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_stream_query_fanouts(self, client: Profound) -> None: response = client.reports.with_raw_response.stream_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_stream_query_fanouts(self, client: Profound) -> None: with client.reports.with_streaming_response.stream_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -1139,18 +1137,18 @@ def test_streaming_response_stream_sentiment(self, client: Profound) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_sentiment_v2(self, client: Profound) -> None: - report = client.reports.stream_sentiment_v2( + report_stream = client.reports.stream_sentiment_v2( asset="asset", category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_sentiment_v2_with_all_params(self, client: Profound) -> None: - report = client.reports.stream_sentiment_v2( + report_stream = client.reports.stream_sentiment_v2( asset="asset", category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", @@ -1176,7 +1174,7 @@ def test_method_stream_sentiment_v2_with_all_params(self, client: Profound) -> N "field": "occurrence", }, ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -1188,10 +1186,9 @@ def test_raw_response_stream_sentiment_v2(self, client: Profound) -> None: start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -1205,8 +1202,8 @@ def test_streaming_response_stream_sentiment_v2(self, client: Profound) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -1280,17 +1277,17 @@ def test_streaming_response_stream_visibility(self, client: Profound) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_visibility_v2(self, client: Profound) -> None: - report = client.reports.stream_visibility_v2( + report_stream = client.reports.stream_visibility_v2( category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_stream_visibility_v2_with_all_params(self, client: Profound) -> None: - report = client.reports.stream_visibility_v2( + report_stream = client.reports.stream_visibility_v2( category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", @@ -1311,7 +1308,7 @@ def test_method_stream_visibility_v2_with_all_params(self, client: Profound) -> scope="owned", sort={"field": "visibility_score"}, ) - assert report is None + report_stream.response.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -1322,10 +1319,9 @@ def test_raw_response_stream_visibility_v2(self, client: Profound) -> None: start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -1338,8 +1334,8 @@ def test_streaming_response_stream_visibility_v2(self, client: Profound) -> None assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = response.parse() - assert report is None + stream = response.parse() + stream.close() assert cast(Any, response.is_closed) is True @@ -1783,7 +1779,7 @@ async def test_streaming_response_get_referrals_report_v2(self, async_client: As @parametrize async def test_method_query_citations(self, async_client: AsyncProfound) -> None: report = await async_client.reports.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -1793,7 +1789,7 @@ async def test_method_query_citations(self, async_client: AsyncProfound) -> None @parametrize async def test_method_query_citations_with_all_params(self, async_client: AsyncProfound) -> None: report = await async_client.reports.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -1818,7 +1814,7 @@ async def test_method_query_citations_with_all_params(self, async_client: AsyncP @parametrize async def test_raw_response_query_citations(self, async_client: AsyncProfound) -> None: response = await async_client.reports.with_raw_response.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -1832,7 +1828,7 @@ async def test_raw_response_query_citations(self, async_client: AsyncProfound) - @parametrize async def test_streaming_response_query_citations(self, async_client: AsyncProfound) -> None: async with async_client.reports.with_streaming_response.query_citations( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -1916,7 +1912,7 @@ async def test_streaming_response_query_fanouts(self, async_client: AsyncProfoun @parametrize async def test_method_query_query_fanouts(self, async_client: AsyncProfound) -> None: report = await async_client.reports.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -1926,7 +1922,7 @@ async def test_method_query_query_fanouts(self, async_client: AsyncProfound) -> @parametrize async def test_method_query_query_fanouts_with_all_params(self, async_client: AsyncProfound) -> None: report = await async_client.reports.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -1953,7 +1949,7 @@ async def test_method_query_query_fanouts_with_all_params(self, async_client: As @parametrize async def test_raw_response_query_query_fanouts(self, async_client: AsyncProfound) -> None: response = await async_client.reports.with_raw_response.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) @@ -1967,7 +1963,7 @@ async def test_raw_response_query_query_fanouts(self, async_client: AsyncProfoun @parametrize async def test_streaming_response_query_query_fanouts(self, async_client: AsyncProfound) -> None: async with async_client.reports.with_streaming_response.query_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: @@ -2331,18 +2327,18 @@ async def test_streaming_response_stream_citations(self, async_client: AsyncProf @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_citations_v2(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_citations_v2( - category_id="category_id", + report_stream = await async_client.reports.stream_citations_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_citations_v2_with_all_params(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_citations_v2( - category_id="category_id", + report_stream = await async_client.reports.stream_citations_v2( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -2361,53 +2357,52 @@ async def test_method_stream_citations_v2_with_all_params(self, async_client: As metrics=["count"], scope="all", ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stream_citations_v2(self, async_client: AsyncProfound) -> None: response = await async_client.reports.with_raw_response.stream_citations_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stream_citations_v2(self, async_client: AsyncProfound) -> None: async with async_client.reports.with_streaming_response.stream_citations_v2( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_query_fanouts(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_query_fanouts( - category_id="category_id", + report_stream = await async_client.reports.stream_query_fanouts( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_query_fanouts_with_all_params(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_query_fanouts( - category_id="category_id", + report_stream = await async_client.reports.stream_query_fanouts( + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", cursor="cursor", @@ -2428,35 +2423,34 @@ async def test_method_stream_query_fanouts_with_all_params(self, async_client: A "dir": "asc", }, ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_stream_query_fanouts(self, async_client: AsyncProfound) -> None: response = await async_client.reports.with_raw_response.stream_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_stream_query_fanouts(self, async_client: AsyncProfound) -> None: async with async_client.reports.with_streaming_response.stream_query_fanouts( - category_id="category_id", + category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True @@ -2530,18 +2524,18 @@ async def test_streaming_response_stream_sentiment(self, async_client: AsyncProf @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_sentiment_v2(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_sentiment_v2( + report_stream = await async_client.reports.stream_sentiment_v2( asset="asset", category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_sentiment_v2_with_all_params(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_sentiment_v2( + report_stream = await async_client.reports.stream_sentiment_v2( asset="asset", category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", @@ -2567,7 +2561,7 @@ async def test_method_stream_sentiment_v2_with_all_params(self, async_client: As "field": "occurrence", }, ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -2579,10 +2573,9 @@ async def test_raw_response_stream_sentiment_v2(self, async_client: AsyncProfoun start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -2596,8 +2589,8 @@ async def test_streaming_response_stream_sentiment_v2(self, async_client: AsyncP assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True @@ -2671,17 +2664,17 @@ async def test_streaming_response_stream_visibility(self, async_client: AsyncPro @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_visibility_v2(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_visibility_v2( + report_stream = await async_client.reports.stream_visibility_v2( category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_stream_visibility_v2_with_all_params(self, async_client: AsyncProfound) -> None: - report = await async_client.reports.stream_visibility_v2( + report_stream = await async_client.reports.stream_visibility_v2( category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", end_date="end_date", start_date="start_date", @@ -2702,7 +2695,7 @@ async def test_method_stream_visibility_v2_with_all_params(self, async_client: A scope="owned", sort={"field": "visibility_score"}, ) - assert report is None + await report_stream.response.aclose() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -2713,10 +2706,9 @@ async def test_raw_response_stream_visibility_v2(self, async_client: AsyncProfou start_date="start_date", ) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -2729,8 +2721,8 @@ async def test_streaming_response_stream_visibility_v2(self, async_client: Async assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - report = await response.parse() - assert report is None + stream = await response.parse() + await stream.close() assert cast(Any, response.is_closed) is True From 9d1cd64e81f9b3f653ef36d79432f5a21130bb0b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 21:21:49 +0000 Subject: [PATCH 25/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f92de618..7ba4cea0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-52ba02a24f99396c26b151bbf7a65fbcd9d12a49b997f79b43234ec5594f3ce6.yml -openapi_spec_hash: 74344fe8287b4d42268ecf5764ff5bf7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-0de0774504a73fb885f840fc341b5a07de5aa55f899d4458ef41bc8863320d28.yml +openapi_spec_hash: bb589c86eb1a5d758c3f13797d1aedf7 config_hash: 48130b77367435ca80edf565b73c49f9 From 1a31395016eb3259c6b8b7939542f9e955556b08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 22:17:28 +0000 Subject: [PATCH 26/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7ba4cea0..f92de618 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-0de0774504a73fb885f840fc341b5a07de5aa55f899d4458ef41bc8863320d28.yml -openapi_spec_hash: bb589c86eb1a5d758c3f13797d1aedf7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-52ba02a24f99396c26b151bbf7a65fbcd9d12a49b997f79b43234ec5594f3ce6.yml +openapi_spec_hash: 74344fe8287b4d42268ecf5764ff5bf7 config_hash: 48130b77367435ca80edf565b73c49f9 From edd5fb6d807dd72234eeda6f0effddbed4086c9e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 22:39:37 +0000 Subject: [PATCH 27/32] feat(api): api update --- .stats.yml | 4 ++-- .../resources/organizations/categories.py | 20 +++++++++++++------ .../organizations/category_prompts_params.py | 5 ++++- .../organizations/test_categories.py | 2 ++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index f92de618..64b19f50 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-52ba02a24f99396c26b151bbf7a65fbcd9d12a49b997f79b43234ec5594f3ce6.yml -openapi_spec_hash: 74344fe8287b4d42268ecf5764ff5bf7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-e8c127e7004c24e3a8cac67ca7d7c1848f260f78b76c4398e5e3be2f83863e52.yml +openapi_spec_hash: 60ae3bc4842a89235799df9e13b26b6e config_hash: 48130b77367435ca80edf565b73c49f9 diff --git a/src/profound/resources/organizations/categories.py b/src/profound/resources/organizations/categories.py index 3a0c6009..a25f99a4 100644 --- a/src/profound/resources/organizations/categories.py +++ b/src/profound/resources/organizations/categories.py @@ -111,7 +111,7 @@ def assets( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryAssetsResponse: """ - Assets + Get Assets Args: extra_headers: Send extra headers @@ -193,7 +193,7 @@ def get_category_personas( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryGetCategoryPersonasResponse: """ - Personas + Get Personas Args: extra_headers: Send extra headers @@ -221,6 +221,7 @@ def prompts( analysis_type: List[Literal["visibility", "sentiment", "sentiment_v2", "accuracy"]] | Omit = omit, cursor: Optional[str] | Omit = omit, limit: int | Omit = omit, + order_by: Literal["created_at", "prompt"] | Omit = omit, order_dir: Literal["asc", "desc"] | Omit = omit, persona_id: SequenceNotStr[str] | Omit = omit, platform_id: SequenceNotStr[str] | Omit = omit, @@ -247,7 +248,9 @@ def prompts( limit: Maximum number of prompts to return. - order_dir: Sort direction by creation date. + order_by: Field used to order prompts. + + order_dir: Sort direction for the selected order field. persona_id: Filter by persona IDs. @@ -285,6 +288,7 @@ def prompts( "analysis_type": analysis_type, "cursor": cursor, "limit": limit, + "order_by": order_by, "order_dir": order_dir, "persona_id": persona_id, "platform_id": platform_id, @@ -583,7 +587,7 @@ async def assets( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryAssetsResponse: """ - Assets + Get Assets Args: extra_headers: Send extra headers @@ -665,7 +669,7 @@ async def get_category_personas( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryGetCategoryPersonasResponse: """ - Personas + Get Personas Args: extra_headers: Send extra headers @@ -693,6 +697,7 @@ async def prompts( analysis_type: List[Literal["visibility", "sentiment", "sentiment_v2", "accuracy"]] | Omit = omit, cursor: Optional[str] | Omit = omit, limit: int | Omit = omit, + order_by: Literal["created_at", "prompt"] | Omit = omit, order_dir: Literal["asc", "desc"] | Omit = omit, persona_id: SequenceNotStr[str] | Omit = omit, platform_id: SequenceNotStr[str] | Omit = omit, @@ -719,7 +724,9 @@ async def prompts( limit: Maximum number of prompts to return. - order_dir: Sort direction by creation date. + order_by: Field used to order prompts. + + order_dir: Sort direction for the selected order field. persona_id: Filter by persona IDs. @@ -757,6 +764,7 @@ async def prompts( "analysis_type": analysis_type, "cursor": cursor, "limit": limit, + "order_by": order_by, "order_dir": order_dir, "persona_id": persona_id, "platform_id": platform_id, diff --git a/src/profound/types/organizations/category_prompts_params.py b/src/profound/types/organizations/category_prompts_params.py index 19cc5952..d463ebf2 100644 --- a/src/profound/types/organizations/category_prompts_params.py +++ b/src/profound/types/organizations/category_prompts_params.py @@ -20,8 +20,11 @@ class CategoryPromptsParams(TypedDict, total=False): limit: int """Maximum number of prompts to return.""" + order_by: Literal["created_at", "prompt"] + """Field used to order prompts.""" + order_dir: Literal["asc", "desc"] - """Sort direction by creation date.""" + """Sort direction for the selected order field.""" persona_id: SequenceNotStr[str] """Filter by persona IDs.""" diff --git a/tests/api_resources/organizations/test_categories.py b/tests/api_resources/organizations/test_categories.py index 5b927599..421745b6 100644 --- a/tests/api_resources/organizations/test_categories.py +++ b/tests/api_resources/organizations/test_categories.py @@ -291,6 +291,7 @@ def test_method_prompts_with_all_params(self, client: Profound) -> None: analysis_type=["visibility"], cursor="cursor", limit=1, + order_by="created_at", order_dir="asc", persona_id=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], platform_id=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], @@ -888,6 +889,7 @@ async def test_method_prompts_with_all_params(self, async_client: AsyncProfound) analysis_type=["visibility"], cursor="cursor", limit=1, + order_by="created_at", order_dir="asc", persona_id=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], platform_id=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], From f07594299fc6faa11bc35f3a11201c989e3d302a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:17:27 +0000 Subject: [PATCH 28/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 64b19f50..96370c39 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-e8c127e7004c24e3a8cac67ca7d7c1848f260f78b76c4398e5e3be2f83863e52.yml -openapi_spec_hash: 60ae3bc4842a89235799df9e13b26b6e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-1b440ce2509c92978ccae11996aa136f92287f02a4e5ee10cb81bc2dfc0cfe5b.yml +openapi_spec_hash: c8de013f888229691cf6cae8f6cdc94a config_hash: 48130b77367435ca80edf565b73c49f9 From deaac7ba6787c216e492ee6451ffb7f3437e981e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 03:17:26 +0000 Subject: [PATCH 29/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 96370c39..c201c20c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-1b440ce2509c92978ccae11996aa136f92287f02a4e5ee10cb81bc2dfc0cfe5b.yml -openapi_spec_hash: c8de013f888229691cf6cae8f6cdc94a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-fc78c05ebb88ecc90836254044f9102e3ff1dbfb3b07115ca65bf47c48eac1a2.yml +openapi_spec_hash: 92f644d92617e063e3b82cd082a2673e config_hash: 48130b77367435ca80edf565b73c49f9 From 37c41ce6b0ddc937a526f3946dd83618a55d4a50 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 14:17:33 +0000 Subject: [PATCH 30/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c201c20c..0590ca2d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-fc78c05ebb88ecc90836254044f9102e3ff1dbfb3b07115ca65bf47c48eac1a2.yml -openapi_spec_hash: 92f644d92617e063e3b82cd082a2673e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-664efb98ce917b49d162643dbd8f8ce08c41e26aecd133d1583f47b84190aaba.yml +openapi_spec_hash: 19ff0a56fdf82e13e7e51b9b3391a4c1 config_hash: 48130b77367435ca80edf565b73c49f9 From ea3d3347c15c9641ab55c7693c1a31b259335a8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:17:39 +0000 Subject: [PATCH 31/32] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0590ca2d..b636c14e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-664efb98ce917b49d162643dbd8f8ce08c41e26aecd133d1583f47b84190aaba.yml -openapi_spec_hash: 19ff0a56fdf82e13e7e51b9b3391a4c1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/profound/profound-5f34810928a953e7787f5d7dff3a0da1e67ef9ac237d01b9aa4a9e596b0f2a0a.yml +openapi_spec_hash: e4a76a9d25f44d1dfbd509828504e762 config_hash: 48130b77367435ca80edf565b73c49f9 From be96ee526344ad652bb978dfcbb16f592505e30b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:18:18 +0000 Subject: [PATCH 32/32] release: 0.54.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 21 +++++++++++++++++++++ pyproject.toml | 2 +- src/profound/_version.py | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c3e01e1e..21fa4455 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.53.0" + ".": "0.54.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c85f2e8..6bfffd4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 0.54.0 (2026-07-22) + +Full Changelog: [v0.53.0...v0.54.0](https://github.com/cooper-square-technologies/profound-python-sdk/compare/v0.53.0...v0.54.0) + +### Features + +* **api:** api update ([edd5fb6](https://github.com/cooper-square-technologies/profound-python-sdk/commit/edd5fb6d807dd72234eeda6f0effddbed4086c9e)) +* **api:** api update ([79dcecf](https://github.com/cooper-square-technologies/profound-python-sdk/commit/79dcecf0ac4be6dbb3ec556677e21c6688818e5b)) +* **api:** api update ([949c8c4](https://github.com/cooper-square-technologies/profound-python-sdk/commit/949c8c4aecea50ff7fdf56dc3b3ab74a032aa2bb)) +* **api:** api update ([ee476f4](https://github.com/cooper-square-technologies/profound-python-sdk/commit/ee476f40439fd739ac8b3e97b028e55b98135a5d)) +* **api:** api update ([641081e](https://github.com/cooper-square-technologies/profound-python-sdk/commit/641081e222e99a24287f76aca3888d4752b4a07a)) +* **api:** api update ([dcd95d9](https://github.com/cooper-square-technologies/profound-python-sdk/commit/dcd95d9e47d35660760d6590073613d4ef0fc510)) +* **api:** api update ([7aa69a6](https://github.com/cooper-square-technologies/profound-python-sdk/commit/7aa69a6761298ead98c4092ce427303f0343b626)) +* **api:** api update ([bedb038](https://github.com/cooper-square-technologies/profound-python-sdk/commit/bedb0380d42036914f5b548f24d3e056a7672f19)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([02477bf](https://github.com/cooper-square-technologies/profound-python-sdk/commit/02477bf17e69c20b0132cfafe82e54949e0fe960)) + + +### Bug Fixes + +* **internal:** resolve build failures ([a3e6d1f](https://github.com/cooper-square-technologies/profound-python-sdk/commit/a3e6d1f6665d12629d8c16e90bcc946b18b089bb)) + ## 0.53.0 (2026-07-13) Full Changelog: [v0.52.0...v0.53.0](https://github.com/cooper-square-technologies/profound-python-sdk/compare/v0.52.0...v0.53.0) diff --git a/pyproject.toml b/pyproject.toml index bd5d6bb6..ac99ab4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "profound" -version = "0.53.0" +version = "0.54.0" description = "The official Python library for the profound API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/profound/_version.py b/src/profound/_version.py index fa206d86..735d55b2 100644 --- a/src/profound/_version.py +++ b/src/profound/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "profound" -__version__ = "0.53.0" # x-release-please-version +__version__ = "0.54.0" # x-release-please-version