Skip to content

Commit 63d9bdf

Browse files
feat(api): manual updates
1 parent 95505a7 commit 63d9bdf

28 files changed

Lines changed: 1290 additions & 7533 deletions

‎.stats.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 36
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-654e47d50a02e8b12f4f035b1a8ec6e864557fed57b744c909ca85127739cc30.yml
1+
configured_endpoints: 29
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2e40370ce4d7d019b30d43020674bb02aaaf2a67a8916772084815c874f99950.yml
33
openapi_spec_hash: a44b7d4172c8c7cd395237738867d5cb
4-
config_hash: 7ec4851ee8d93177947e95df5ae897b5
4+
config_hash: 472cc1adb51663e5b3d8dce16f6d29d9

‎README.md‎

Lines changed: 69 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ client = ContextDev(
4141
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
4242
)
4343

44-
brand = client.brand.retrieve(
45-
domain="REPLACE_ME",
44+
response = client.web.extract(
45+
schema={
46+
"type": "bar",
47+
"properties": "bar",
48+
"required": "bar",
49+
"additionalProperties": "bar",
50+
},
51+
url="https://example.com",
4652
)
47-
print(brand.brand)
53+
print(response.data)
4854
```
4955

5056
While you can provide an `api_key` keyword argument,
@@ -67,10 +73,16 @@ client = AsyncContextDev(
6773

6874

6975
async def main() -> None:
70-
brand = await client.brand.retrieve(
71-
domain="REPLACE_ME",
76+
response = await client.web.extract(
77+
schema={
78+
"type": "bar",
79+
"properties": "bar",
80+
"required": "bar",
81+
"additionalProperties": "bar",
82+
},
83+
url="https://example.com",
7284
)
73-
print(brand.brand)
85+
print(response.data)
7486

7587

7688
asyncio.run(main())
@@ -103,10 +115,16 @@ async def main() -> None:
103115
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
104116
http_client=DefaultAioHttpClient(),
105117
) as client:
106-
brand = await client.brand.retrieve(
107-
domain="REPLACE_ME",
118+
response = await client.web.extract(
119+
schema={
120+
"type": "bar",
121+
"properties": "bar",
122+
"required": "bar",
123+
"additionalProperties": "bar",
124+
},
125+
url="https://example.com",
108126
)
109-
print(brand.brand)
127+
print(response.data)
110128

111129

112130
asyncio.run(main())
@@ -159,8 +177,14 @@ from context.dev import ContextDev
159177
client = ContextDev()
160178

161179
try:
162-
client.brand.retrieve(
163-
domain="REPLACE_ME",
180+
client.web.extract(
181+
schema={
182+
"type": "bar",
183+
"properties": "bar",
184+
"required": "bar",
185+
"additionalProperties": "bar",
186+
},
187+
url="https://example.com",
164188
)
165189
except context.dev.APIConnectionError as e:
166190
print("The server could not be reached")
@@ -204,8 +228,14 @@ client = ContextDev(
204228
)
205229

206230
# Or, configure per-request:
207-
client.with_options(max_retries=5).brand.retrieve(
208-
domain="REPLACE_ME",
231+
client.with_options(max_retries=5).web.extract(
232+
schema={
233+
"type": "bar",
234+
"properties": "bar",
235+
"required": "bar",
236+
"additionalProperties": "bar",
237+
},
238+
url="https://example.com",
209239
)
210240
```
211241

@@ -229,8 +259,14 @@ client = ContextDev(
229259
)
230260

231261
# Override per-request:
232-
client.with_options(timeout=5.0).brand.retrieve(
233-
domain="REPLACE_ME",
262+
client.with_options(timeout=5.0).web.extract(
263+
schema={
264+
"type": "bar",
265+
"properties": "bar",
266+
"required": "bar",
267+
"additionalProperties": "bar",
268+
},
269+
url="https://example.com",
234270
)
235271
```
236272

@@ -272,13 +308,19 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
272308
from context.dev import ContextDev
273309

274310
client = ContextDev()
275-
response = client.brand.with_raw_response.retrieve(
276-
domain="REPLACE_ME",
311+
response = client.web.with_raw_response.extract(
312+
schema={
313+
"type": "bar",
314+
"properties": "bar",
315+
"required": "bar",
316+
"additionalProperties": "bar",
317+
},
318+
url="https://example.com",
277319
)
278320
print(response.headers.get('X-My-Header'))
279321

280-
brand = response.parse() # get the object that `brand.retrieve()` would have returned
281-
print(brand.brand)
322+
web = response.parse() # get the object that `web.extract()` would have returned
323+
print(web.data)
282324
```
283325

284326
These methods return an [`APIResponse`](https://github.com/context-dot-dev/context-python-sdk/tree/main/src/context/dev/_response.py) object.
@@ -292,8 +334,14 @@ The above interface eagerly reads the full response body when you make the reque
292334
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
293335

294336
```python
295-
with client.brand.with_streaming_response.retrieve(
296-
domain="REPLACE_ME",
337+
with client.web.with_streaming_response.extract(
338+
schema={
339+
"type": "bar",
340+
"properties": "bar",
341+
"required": "bar",
342+
"additionalProperties": "bar",
343+
},
344+
url="https://example.com",
297345
) as response:
298346
print(response.headers.get("X-My-Header"))
299347

‎api.md‎

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ Methods:
3737
Types:
3838

3939
```python
40-
from context.dev.types import AIAIQueryResponse, AIExtractProductResponse, AIExtractProductsResponse
40+
from context.dev.types import AIExtractProductResponse, AIExtractProductsResponse
4141
```
4242

4343
Methods:
4444

45-
- <code title="post /brand/ai/query">client.ai.<a href="./src/context/dev/resources/ai.py">ai_query</a>(\*\*<a href="src/context/dev/types/ai_ai_query_params.py">params</a>) -> <a href="./src/context/dev/types/ai_ai_query_response.py">AIAIQueryResponse</a></code>
4645
- <code title="post /brand/ai/product">client.ai.<a href="./src/context/dev/resources/ai.py">extract_product</a>(\*\*<a href="src/context/dev/types/ai_extract_product_params.py">params</a>) -> <a href="./src/context/dev/types/ai_extract_product_response.py">AIExtractProductResponse</a></code>
4746
- <code title="post /brand/ai/products">client.ai.<a href="./src/context/dev/resources/ai.py">extract_products</a>(\*\*<a href="src/context/dev/types/ai_extract_products_params.py">params</a>) -> <a href="./src/context/dev/types/ai_extract_products_response.py">AIExtractProductsResponse</a></code>
4847

@@ -51,25 +50,12 @@ Methods:
5150
Types:
5251

5352
```python
54-
from context.dev.types import (
55-
BrandRetrieveResponse,
56-
BrandIdentifyFromTransactionResponse,
57-
BrandRetrieveByEmailResponse,
58-
BrandRetrieveByIsinResponse,
59-
BrandRetrieveByNameResponse,
60-
BrandRetrieveByTickerResponse,
61-
BrandRetrieveSimplifiedResponse,
62-
)
53+
from context.dev.types import BrandRetrieveResponse, BrandRetrieveSimplifiedResponse
6354
```
6455

6556
Methods:
6657

67-
- <code title="get /brand/retrieve">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve</a>(\*\*<a href="src/context/dev/types/brand_retrieve_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_response.py">BrandRetrieveResponse</a></code>
68-
- <code title="get /brand/transaction_identifier">client.brand.<a href="./src/context/dev/resources/brand.py">identify_from_transaction</a>(\*\*<a href="src/context/dev/types/brand_identify_from_transaction_params.py">params</a>) -> <a href="./src/context/dev/types/brand_identify_from_transaction_response.py">BrandIdentifyFromTransactionResponse</a></code>
69-
- <code title="get /brand/retrieve-by-email">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_by_email</a>(\*\*<a href="src/context/dev/types/brand_retrieve_by_email_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_by_email_response.py">BrandRetrieveByEmailResponse</a></code>
70-
- <code title="get /brand/retrieve-by-isin">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_by_isin</a>(\*\*<a href="src/context/dev/types/brand_retrieve_by_isin_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_by_isin_response.py">BrandRetrieveByIsinResponse</a></code>
71-
- <code title="get /brand/retrieve-by-name">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_by_name</a>(\*\*<a href="src/context/dev/types/brand_retrieve_by_name_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_by_name_response.py">BrandRetrieveByNameResponse</a></code>
72-
- <code title="get /brand/retrieve-by-ticker">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_by_ticker</a>(\*\*<a href="src/context/dev/types/brand_retrieve_by_ticker_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_by_ticker_response.py">BrandRetrieveByTickerResponse</a></code>
58+
- <code title="post /brand/retrieve">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve</a>(\*\*<a href="src/context/dev/types/brand_retrieve_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_response.py">BrandRetrieveResponse</a></code>
7359
- <code title="get /brand/retrieve-simplified">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_simplified</a>(\*\*<a href="src/context/dev/types/brand_retrieve_simplified_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_simplified_response.py">BrandRetrieveSimplifiedResponse</a></code>
7460

7561
# Industry
@@ -90,13 +76,12 @@ Methods:
9076
Types:
9177

9278
```python
93-
from context.dev.types import UtilityPrefetchResponse, UtilityPrefetchByEmailResponse
79+
from context.dev.types import UtilityPrefetchResponse
9480
```
9581

9682
Methods:
9783

98-
- <code title="post /brand/prefetch">client.utility.<a href="./src/context/dev/resources/utility.py">prefetch</a>(\*\*<a href="src/context/dev/types/utility_prefetch_params.py">params</a>) -> <a href="./src/context/dev/types/utility_prefetch_response.py">UtilityPrefetchResponse</a></code>
99-
- <code title="post /brand/prefetch-by-email">client.utility.<a href="./src/context/dev/resources/utility.py">prefetch_by_email</a>(\*\*<a href="src/context/dev/types/utility_prefetch_by_email_params.py">params</a>) -> <a href="./src/context/dev/types/utility_prefetch_by_email_response.py">UtilityPrefetchByEmailResponse</a></code>
84+
- <code title="post /utility/prefetch">client.utility.<a href="./src/context/dev/resources/utility.py">prefetch</a>(\*\*<a href="src/context/dev/types/utility_prefetch_params.py">params</a>) -> <a href="./src/context/dev/types/utility_prefetch_response.py">UtilityPrefetchResponse</a></code>
10085

10186
# Monitors
10287

0 commit comments

Comments
 (0)