Skip to content

Commit 6721d0b

Browse files
feat(api): api update
1 parent 713964b commit 6721d0b

26 files changed

Lines changed: 533 additions & 23 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 25
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7002d4e40fb0a8dc4454b7f72f86d6068245cb367ddf7c784f00e35f6f75de1f.yml
3-
openapi_spec_hash: da6f7b8ab297306b97ed9fe8df9ad1a0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b84f53b1a92511eff85645f287ec08d43adcdcc589367c015770bde836422a65.yml
3+
openapi_spec_hash: 71e317da7bc58cfc3bc2e4180f5b6267
44
config_hash: f86a4e06ae5ed725aa79d58d7a8dc27c

‎src/context/dev/types/ai_ai_query_response.py‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from .._models import BaseModel
66

7-
__all__ = ["AIAIQueryResponse", "DataExtracted"]
7+
__all__ = ["AIAIQueryResponse", "DataExtracted", "KeyMetadata"]
88

99

1010
class DataExtracted(BaseModel):
@@ -19,13 +19,33 @@ class DataExtracted(BaseModel):
1919
"""
2020

2121

22+
class KeyMetadata(BaseModel):
23+
"""Metadata about the API key used for the request.
24+
25+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
26+
"""
27+
28+
credits_consumed: int
29+
"""The number of credits consumed by this request."""
30+
31+
credits_remaining: int
32+
"""The number of credits remaining for your organization after this request."""
33+
34+
2235
class AIAIQueryResponse(BaseModel):
2336
data_extracted: Optional[List[DataExtracted]] = None
2437
"""Array of extracted data points"""
2538

2639
domain: Optional[str] = None
2740
"""The domain that was analyzed"""
2841

42+
key_metadata: Optional[KeyMetadata] = None
43+
"""Metadata about the API key used for the request.
44+
45+
Included in every response whenever a valid API key is provided, even when the
46+
response status is not 200.
47+
"""
48+
2949
status: Optional[str] = None
3050
"""Status of the response, e.g., 'ok'"""
3151

‎src/context/dev/types/ai_extract_product_response.py‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@
55

66
from .._models import BaseModel
77

8-
__all__ = ["AIExtractProductResponse", "Product"]
8+
__all__ = ["AIExtractProductResponse", "KeyMetadata", "Product"]
9+
10+
11+
class KeyMetadata(BaseModel):
12+
"""Metadata about the API key used for the request.
13+
14+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
15+
"""
16+
17+
credits_consumed: int
18+
"""The number of credits consumed by this request."""
19+
20+
credits_remaining: int
21+
"""The number of credits remaining for your organization after this request."""
922

1023

1124
class Product(BaseModel):
@@ -58,6 +71,13 @@ class AIExtractProductResponse(BaseModel):
5871
is_product_page: Optional[bool] = None
5972
"""Whether the given URL is a product detail page"""
6073

74+
key_metadata: Optional[KeyMetadata] = None
75+
"""Metadata about the API key used for the request.
76+
77+
Included in every response whenever a valid API key is provided, even when the
78+
response status is not 200.
79+
"""
80+
6181
platform: Optional[Literal["amazon", "tiktok_shop", "etsy", "generic"]] = None
6282
"""The detected ecommerce platform, or null if not a product page"""
6383

‎src/context/dev/types/ai_extract_products_response.py‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@
55

66
from .._models import BaseModel
77

8-
__all__ = ["AIExtractProductsResponse", "Product"]
8+
__all__ = ["AIExtractProductsResponse", "KeyMetadata", "Product"]
9+
10+
11+
class KeyMetadata(BaseModel):
12+
"""Metadata about the API key used for the request.
13+
14+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
15+
"""
16+
17+
credits_consumed: int
18+
"""The number of credits consumed by this request."""
19+
20+
credits_remaining: int
21+
"""The number of credits remaining for your organization after this request."""
922

1023

1124
class Product(BaseModel):
@@ -53,5 +66,12 @@ class Product(BaseModel):
5366

5467

5568
class AIExtractProductsResponse(BaseModel):
69+
key_metadata: Optional[KeyMetadata] = None
70+
"""Metadata about the API key used for the request.
71+
72+
Included in every response whenever a valid API key is provided, even when the
73+
response status is not 200.
74+
"""
75+
5676
products: Optional[List[Product]] = None
5777
"""Array of products extracted from the website"""

‎src/context/dev/types/brand_identify_from_transaction_response.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"BrandLogoResolution",
2222
"BrandSocial",
2323
"BrandStock",
24+
"KeyMetadata",
2425
]
2526

2627

@@ -650,12 +651,32 @@ class Brand(BaseModel):
650651
"""The title or name of the brand"""
651652

652653

654+
class KeyMetadata(BaseModel):
655+
"""Metadata about the API key used for the request.
656+
657+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
658+
"""
659+
660+
credits_consumed: int
661+
"""The number of credits consumed by this request."""
662+
663+
credits_remaining: int
664+
"""The number of credits remaining for your organization after this request."""
665+
666+
653667
class BrandIdentifyFromTransactionResponse(BaseModel):
654668
brand: Optional[Brand] = None
655669
"""Detailed brand information"""
656670

657671
code: Optional[int] = None
658672
"""HTTP status code"""
659673

674+
key_metadata: Optional[KeyMetadata] = None
675+
"""Metadata about the API key used for the request.
676+
677+
Included in every response whenever a valid API key is provided, even when the
678+
response status is not 200.
679+
"""
680+
660681
status: Optional[str] = None
661682
"""Status of the response, e.g., 'ok'"""

‎src/context/dev/types/brand_retrieve_by_email_response.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"BrandLogoResolution",
2222
"BrandSocial",
2323
"BrandStock",
24+
"KeyMetadata",
2425
]
2526

2627

@@ -650,12 +651,32 @@ class Brand(BaseModel):
650651
"""The title or name of the brand"""
651652

652653

654+
class KeyMetadata(BaseModel):
655+
"""Metadata about the API key used for the request.
656+
657+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
658+
"""
659+
660+
credits_consumed: int
661+
"""The number of credits consumed by this request."""
662+
663+
credits_remaining: int
664+
"""The number of credits remaining for your organization after this request."""
665+
666+
653667
class BrandRetrieveByEmailResponse(BaseModel):
654668
brand: Optional[Brand] = None
655669
"""Detailed brand information"""
656670

657671
code: Optional[int] = None
658672
"""HTTP status code"""
659673

674+
key_metadata: Optional[KeyMetadata] = None
675+
"""Metadata about the API key used for the request.
676+
677+
Included in every response whenever a valid API key is provided, even when the
678+
response status is not 200.
679+
"""
680+
660681
status: Optional[str] = None
661682
"""Status of the response, e.g., 'ok'"""

‎src/context/dev/types/brand_retrieve_by_isin_response.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"BrandLogoResolution",
2222
"BrandSocial",
2323
"BrandStock",
24+
"KeyMetadata",
2425
]
2526

2627

@@ -650,12 +651,32 @@ class Brand(BaseModel):
650651
"""The title or name of the brand"""
651652

652653

654+
class KeyMetadata(BaseModel):
655+
"""Metadata about the API key used for the request.
656+
657+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
658+
"""
659+
660+
credits_consumed: int
661+
"""The number of credits consumed by this request."""
662+
663+
credits_remaining: int
664+
"""The number of credits remaining for your organization after this request."""
665+
666+
653667
class BrandRetrieveByIsinResponse(BaseModel):
654668
brand: Optional[Brand] = None
655669
"""Detailed brand information"""
656670

657671
code: Optional[int] = None
658672
"""HTTP status code"""
659673

674+
key_metadata: Optional[KeyMetadata] = None
675+
"""Metadata about the API key used for the request.
676+
677+
Included in every response whenever a valid API key is provided, even when the
678+
response status is not 200.
679+
"""
680+
660681
status: Optional[str] = None
661682
"""Status of the response, e.g., 'ok'"""

‎src/context/dev/types/brand_retrieve_by_name_response.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"BrandLogoResolution",
2222
"BrandSocial",
2323
"BrandStock",
24+
"KeyMetadata",
2425
]
2526

2627

@@ -650,12 +651,32 @@ class Brand(BaseModel):
650651
"""The title or name of the brand"""
651652

652653

654+
class KeyMetadata(BaseModel):
655+
"""Metadata about the API key used for the request.
656+
657+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
658+
"""
659+
660+
credits_consumed: int
661+
"""The number of credits consumed by this request."""
662+
663+
credits_remaining: int
664+
"""The number of credits remaining for your organization after this request."""
665+
666+
653667
class BrandRetrieveByNameResponse(BaseModel):
654668
brand: Optional[Brand] = None
655669
"""Detailed brand information"""
656670

657671
code: Optional[int] = None
658672
"""HTTP status code"""
659673

674+
key_metadata: Optional[KeyMetadata] = None
675+
"""Metadata about the API key used for the request.
676+
677+
Included in every response whenever a valid API key is provided, even when the
678+
response status is not 200.
679+
"""
680+
660681
status: Optional[str] = None
661682
"""Status of the response, e.g., 'ok'"""

‎src/context/dev/types/brand_retrieve_by_ticker_response.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"BrandLogoResolution",
2222
"BrandSocial",
2323
"BrandStock",
24+
"KeyMetadata",
2425
]
2526

2627

@@ -650,12 +651,32 @@ class Brand(BaseModel):
650651
"""The title or name of the brand"""
651652

652653

654+
class KeyMetadata(BaseModel):
655+
"""Metadata about the API key used for the request.
656+
657+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
658+
"""
659+
660+
credits_consumed: int
661+
"""The number of credits consumed by this request."""
662+
663+
credits_remaining: int
664+
"""The number of credits remaining for your organization after this request."""
665+
666+
653667
class BrandRetrieveByTickerResponse(BaseModel):
654668
brand: Optional[Brand] = None
655669
"""Detailed brand information"""
656670

657671
code: Optional[int] = None
658672
"""HTTP status code"""
659673

674+
key_metadata: Optional[KeyMetadata] = None
675+
"""Metadata about the API key used for the request.
676+
677+
Included in every response whenever a valid API key is provided, even when the
678+
response status is not 200.
679+
"""
680+
660681
status: Optional[str] = None
661682
"""Status of the response, e.g., 'ok'"""

‎src/context/dev/types/brand_retrieve_response.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"BrandLogoResolution",
2222
"BrandSocial",
2323
"BrandStock",
24+
"KeyMetadata",
2425
]
2526

2627

@@ -650,12 +651,32 @@ class Brand(BaseModel):
650651
"""The title or name of the brand"""
651652

652653

654+
class KeyMetadata(BaseModel):
655+
"""Metadata about the API key used for the request.
656+
657+
Included in every response whenever a valid API key is provided, even when the response status is not 200.
658+
"""
659+
660+
credits_consumed: int
661+
"""The number of credits consumed by this request."""
662+
663+
credits_remaining: int
664+
"""The number of credits remaining for your organization after this request."""
665+
666+
653667
class BrandRetrieveResponse(BaseModel):
654668
brand: Optional[Brand] = None
655669
"""Detailed brand information"""
656670

657671
code: Optional[int] = None
658672
"""HTTP status code"""
659673

674+
key_metadata: Optional[KeyMetadata] = None
675+
"""Metadata about the API key used for the request.
676+
677+
Included in every response whenever a valid API key is provided, even when the
678+
response status is not 200.
679+
"""
680+
660681
status: Optional[str] = None
661682
"""Status of the response, e.g., 'ok'"""

0 commit comments

Comments
 (0)