Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.12.0"
".": "2.13.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 41
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2c3f4e4b357ca78c019a3aacd006e2bb8b332d4172a300ee6c46c076a216ed3f.yml
openapi_spec_hash: b89be415cf6ee594b521885a9deb25ac
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-dc61df29e1b6282f9df685fadd65f3683afe352deccae94d0c080092e0eae4b3.yml
openapi_spec_hash: 258caa98cd0de5f7149f6937d071c912
config_hash: 0fb0ceca5946298c416cec0cca5260c7
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.13.0 (2026-08-27)

Full Changelog: [v2.12.0...v2.13.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.12.0...v2.13.0)

### Features

* **api:** api update ([7d3e630](https://github.com/context-dot-dev/context-python-sdk/commit/7d3e630c9a18cc3508700a7706860f9d12ae4a84))
* **api:** api update ([8a39a9f](https://github.com/context-dot-dev/context-python-sdk/commit/8a39a9f2b311acbd83fea47ac812f8d9c65eb6c5))

## 2.12.0 (2026-08-23)

Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-python-sdk/compare/v2.11.0...v2.12.0)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ brand = client.brand.retrieve(
domain="REPLACE_ME",
type="by_domain",
)
print(brand.brand)
print(brand.cache_metadata)
```

While you can provide an `api_key` keyword argument,
Expand All @@ -72,7 +72,7 @@ async def main() -> None:
domain="REPLACE_ME",
type="by_domain",
)
print(brand.brand)
print(brand.cache_metadata)


asyncio.run(main())
Expand Down Expand Up @@ -109,7 +109,7 @@ async def main() -> None:
domain="REPLACE_ME",
type="by_domain",
)
print(brand.brand)
print(brand.cache_metadata)


asyncio.run(main())
Expand Down Expand Up @@ -279,7 +279,7 @@ response = client.brand.with_raw_response.retrieve(
print(response.headers.get('X-My-Header'))

brand = response.parse() # get the object that `brand.retrieve()` would have returned
print(brand.brand)
print(brand.cache_metadata)
```

These methods return an [`APIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "context.dev"
version = "2.12.0"
version = "2.13.0"
description = "The official Python library for the context.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/context/dev/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "context.dev"
__version__ = "2.12.0" # x-release-please-version
__version__ = "2.13.0" # x-release-please-version
25 changes: 24 additions & 1 deletion src/context/dev/types/ai_extract_product_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@

from .._models import BaseModel

__all__ = ["AIExtractProductResponse", "KeyMetadata", "Product"]
__all__ = ["AIExtractProductResponse", "CacheMetadata", "KeyMetadata", "Product"]


class CacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class KeyMetadata(BaseModel):
Expand Down Expand Up @@ -83,6 +99,13 @@ class Product(BaseModel):


class AIExtractProductResponse(BaseModel):
cache_metadata: CacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

is_product_page: Optional[bool] = None
"""Whether the given URL is a product detail page"""

Expand Down
25 changes: 24 additions & 1 deletion src/context/dev/types/ai_extract_products_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@

from .._models import BaseModel

__all__ = ["AIExtractProductsResponse", "KeyMetadata", "Product"]
__all__ = ["AIExtractProductsResponse", "CacheMetadata", "KeyMetadata", "Product"]


class CacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class KeyMetadata(BaseModel):
Expand Down Expand Up @@ -81,6 +97,13 @@ class Product(BaseModel):


class AIExtractProductsResponse(BaseModel):
cache_metadata: CacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

key_metadata: Optional[KeyMetadata] = None
"""Metadata about the API key used for the request.

Expand Down
24 changes: 24 additions & 0 deletions src/context/dev/types/batch_get_results_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"BatchGetResultsResponse",
"Data",
"DataOk",
"DataOkCacheMetadata",
"DataOkMetadata",
"DataOkMetadataAlternate",
"DataOkMetadataHeading",
Expand All @@ -20,6 +21,22 @@
]


class DataOkCacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class DataOkMetadataAlternate(BaseModel):
href: str
"""Resolved alternate URL."""
Expand Down Expand Up @@ -115,6 +132,13 @@ class DataOkMetadata(BaseModel):
class DataOk(BaseModel):
"""A page the batch fetched successfully."""

cache_metadata: DataOkCacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

final_url: str
"""URL the content was read from, after redirects."""

Expand Down
25 changes: 24 additions & 1 deletion src/context/dev/types/batch_submit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@
from .._models import BaseModel
from .crawl_controls import CrawlControls

__all__ = ["BatchSubmitResponse", "Credits", "InvalidURL", "KeyMetadata"]
__all__ = ["BatchSubmitResponse", "CacheMetadata", "Credits", "InvalidURL", "KeyMetadata"]


class CacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class Credits(BaseModel):
Expand Down Expand Up @@ -42,6 +58,13 @@ class BatchSubmitResponse(BaseModel):
id: str
"""Batch ID. Poll GET /batch/{batch_id} with it."""

cache_metadata: CacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

crawl: Optional[CrawlControls] = None
"""
The crawl controls as submitted, so the limits requested can be compared against
Expand Down
30 changes: 29 additions & 1 deletion src/context/dev/types/brand_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

__all__ = [
"BrandRetrieveResponse",
"CacheMetadata",
"Brand",
"BrandAddress",
"BrandBackdrop",
Expand All @@ -26,6 +27,22 @@
]


class CacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class BrandAddress(BaseModel):
"""Physical address of the brand"""

Expand Down Expand Up @@ -525,7 +542,11 @@ class Brand(BaseModel):
"""Important website links for the brand"""

logos: Optional[List[BrandLogo]] = None
"""An array of logos associated with the brand"""
"""An array of logos associated with the brand.

When a similarly shaped SVG variant exists, it is returned ahead of its raster
equivalent; otherwise relevance order is preserved
"""

phone: Optional[str] = None
"""Company phone number"""
Expand Down Expand Up @@ -686,6 +707,13 @@ class KeyMetadata(BaseModel):


class BrandRetrieveResponse(BaseModel):
cache_metadata: CacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

brand: Optional[Brand] = None
"""Detailed brand information"""

Expand Down
24 changes: 24 additions & 0 deletions src/context/dev/types/brand_retrieve_simplified_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

__all__ = [
"BrandRetrieveSimplifiedResponse",
"CacheMetadata",
"Brand",
"BrandBackdrop",
"BrandBackdropColor",
Expand All @@ -19,6 +20,22 @@
]


class CacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class BrandBackdropColor(BaseModel):
hex: Optional[str] = None
"""Color in hexadecimal format"""
Expand Down Expand Up @@ -141,6 +158,13 @@ class KeyMetadata(BaseModel):


class BrandRetrieveSimplifiedResponse(BaseModel):
cache_metadata: CacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

brand: Optional[Brand] = None
"""Simplified brand information"""

Expand Down
25 changes: 24 additions & 1 deletion src/context/dev/types/web_extract_fonts_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@

from .._models import BaseModel

__all__ = ["WebExtractFontsResponse", "Font", "FontLinks", "KeyMetadata"]
__all__ = ["WebExtractFontsResponse", "CacheMetadata", "Font", "FontLinks", "KeyMetadata"]


class CacheMetadata(BaseModel):
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing to the output was a hit; age_ms is the oldest contributing hit.
"""

age_ms: int
"""Age of the cached data in milliseconds. Zero for miss and zdr responses."""

status: Literal["hit", "miss", "zdr"]
"""
Whether the response was served from cache, required fresh work, or honored
zero-data-retention cache bypass.
"""


class Font(BaseModel):
Expand Down Expand Up @@ -71,6 +87,13 @@ class KeyMetadata(BaseModel):


class WebExtractFontsResponse(BaseModel):
cache_metadata: CacheMetadata
"""Cache outcome for this response.

Composite responses are hits only when every cache-controlled fetch contributing
to the output was a hit; age_ms is the oldest contributing hit.
"""

code: int
"""HTTP status code, e.g., 200"""

Expand Down
Loading
Loading