Skip to content

Commit 04370fc

Browse files
committed
Release 0.0.6
1 parent a3be967 commit 04370fc

File tree

9 files changed

+471
-2
lines changed

9 files changed

+471
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "axiomatic"
3-
version = "0.0.5"
3+
version = "0.0.6"
44
description = ""
55
readme = "README.md"
66
authors = []

reference.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,76 @@ client.pic.synthesize_circuit_from_text(
545545
</dl>
546546

547547

548+
</dd>
549+
</dl>
550+
</details>
551+
552+
<details><summary><code>client.pic.<a href="src/axiomatic/pic/client.py">generate</a>(...)</code></summary>
553+
<dl>
554+
<dd>
555+
556+
#### 📝 Description
557+
558+
<dl>
559+
<dd>
560+
561+
<dl>
562+
<dd>
563+
564+
Generate GDS factory code to create a circuit
565+
</dd>
566+
</dl>
567+
</dd>
568+
</dl>
569+
570+
#### 🔌 Usage
571+
572+
<dl>
573+
<dd>
574+
575+
<dl>
576+
<dd>
577+
578+
```python
579+
from axiomatic import Axiomatic
580+
581+
client = Axiomatic(
582+
api_key="YOUR_API_KEY",
583+
)
584+
client.pic.generate(
585+
query="query",
586+
)
587+
588+
```
589+
</dd>
590+
</dl>
591+
</dd>
592+
</dl>
593+
594+
#### ⚙️ Parameters
595+
596+
<dl>
597+
<dd>
598+
599+
<dl>
600+
<dd>
601+
602+
**query:** `str`
603+
604+
</dd>
605+
</dl>
606+
607+
<dl>
608+
<dd>
609+
610+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
611+
612+
</dd>
613+
</dl>
614+
</dd>
615+
</dl>
616+
617+
548618
</dd>
549619
</dl>
550620
</details>
@@ -887,6 +957,84 @@ client.experimental.synthesize(
887957
</dl>
888958

889959

960+
</dd>
961+
</dl>
962+
</details>
963+
964+
<details><summary><code>client.experimental.<a href="src/axiomatic/experimental/client.py">magic_request</a>(...)</code></summary>
965+
<dl>
966+
<dd>
967+
968+
#### 📝 Description
969+
970+
<dl>
971+
<dd>
972+
973+
<dl>
974+
<dd>
975+
976+
Interactive assistant for IPython extension
977+
</dd>
978+
</dl>
979+
</dd>
980+
</dl>
981+
982+
#### 🔌 Usage
983+
984+
<dl>
985+
<dd>
986+
987+
<dl>
988+
<dd>
989+
990+
```python
991+
from axiomatic import Axiomatic
992+
993+
client = Axiomatic(
994+
api_key="YOUR_API_KEY",
995+
)
996+
client.experimental.magic_request(
997+
query="query",
998+
)
999+
1000+
```
1001+
</dd>
1002+
</dl>
1003+
</dd>
1004+
</dl>
1005+
1006+
#### ⚙️ Parameters
1007+
1008+
<dl>
1009+
<dd>
1010+
1011+
<dl>
1012+
<dd>
1013+
1014+
**query:** `str`
1015+
1016+
</dd>
1017+
</dl>
1018+
1019+
<dl>
1020+
<dd>
1021+
1022+
**cell:** `typing.Optional[str]`
1023+
1024+
</dd>
1025+
</dl>
1026+
1027+
<dl>
1028+
<dd>
1029+
1030+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1031+
1032+
</dd>
1033+
</dl>
1034+
</dd>
1035+
</dl>
1036+
1037+
8901038
</dd>
8911039
</dl>
8921040
</details>

src/axiomatic/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
ExtractResponse,
99
ExtractStatementsResponse,
1010
ExtractTitleResponse,
11+
GenerateCodeResponse,
1112
HttpValidationError,
1213
InteractiveResponse,
14+
MagicResponse,
1315
Statement,
1416
StatementInput,
1517
SynthesisResponse,
@@ -35,8 +37,10 @@
3537
"ExtractResponse",
3638
"ExtractStatementsResponse",
3739
"ExtractTitleResponse",
40+
"GenerateCodeResponse",
3841
"HttpValidationError",
3942
"InteractiveResponse",
43+
"MagicResponse",
4044
"Statement",
4145
"StatementInput",
4246
"SynthesisResponse",

src/axiomatic/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "axiomatic",
19-
"X-Fern-SDK-Version": "0.0.5",
19+
"X-Fern-SDK-Version": "0.0.6",
2020
}
2121
headers["x-api-key"] = self.api_key
2222
return headers

src/axiomatic/experimental/client.py

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from json.decoder import JSONDecodeError
1111
from ..core.api_error import ApiError
1212
from ..types.code_synthesis_response import CodeSynthesisResponse
13+
from ..types.magic_response import MagicResponse
1314
from ..core.client_wrapper import AsyncClientWrapper
1415

1516

@@ -143,6 +144,70 @@ def synthesize(
143144
raise ApiError(status_code=_response.status_code, body=_response.text)
144145
raise ApiError(status_code=_response.status_code, body=_response_json)
145146

147+
def magic_request(
148+
self, *, query: str, cell: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
149+
) -> MagicResponse:
150+
"""
151+
Interactive assistant for IPython extension
152+
153+
Parameters
154+
----------
155+
query : str
156+
157+
cell : typing.Optional[str]
158+
159+
request_options : typing.Optional[RequestOptions]
160+
Request-specific configuration.
161+
162+
Returns
163+
-------
164+
MagicResponse
165+
Successful Response
166+
167+
Examples
168+
--------
169+
from axiomatic import Axiomatic
170+
171+
client = Axiomatic(
172+
api_key="YOUR_API_KEY",
173+
)
174+
client.experimental.magic_request(
175+
query="query",
176+
)
177+
"""
178+
_response = self._client_wrapper.httpx_client.request(
179+
"experimental/circuit_assistant",
180+
method="POST",
181+
params={
182+
"query": query,
183+
"cell": cell,
184+
},
185+
request_options=request_options,
186+
)
187+
try:
188+
if 200 <= _response.status_code < 300:
189+
return typing.cast(
190+
MagicResponse,
191+
parse_obj_as(
192+
type_=MagicResponse, # type: ignore
193+
object_=_response.json(),
194+
),
195+
)
196+
if _response.status_code == 422:
197+
raise UnprocessableEntityError(
198+
typing.cast(
199+
HttpValidationError,
200+
parse_obj_as(
201+
type_=HttpValidationError, # type: ignore
202+
object_=_response.json(),
203+
),
204+
)
205+
)
206+
_response_json = _response.json()
207+
except JSONDecodeError:
208+
raise ApiError(status_code=_response.status_code, body=_response.text)
209+
raise ApiError(status_code=_response.status_code, body=_response_json)
210+
146211

147212
class AsyncExperimentalClient:
148213
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -289,3 +354,75 @@ async def main() -> None:
289354
except JSONDecodeError:
290355
raise ApiError(status_code=_response.status_code, body=_response.text)
291356
raise ApiError(status_code=_response.status_code, body=_response_json)
357+
358+
async def magic_request(
359+
self, *, query: str, cell: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None
360+
) -> MagicResponse:
361+
"""
362+
Interactive assistant for IPython extension
363+
364+
Parameters
365+
----------
366+
query : str
367+
368+
cell : typing.Optional[str]
369+
370+
request_options : typing.Optional[RequestOptions]
371+
Request-specific configuration.
372+
373+
Returns
374+
-------
375+
MagicResponse
376+
Successful Response
377+
378+
Examples
379+
--------
380+
import asyncio
381+
382+
from axiomatic import AsyncAxiomatic
383+
384+
client = AsyncAxiomatic(
385+
api_key="YOUR_API_KEY",
386+
)
387+
388+
389+
async def main() -> None:
390+
await client.experimental.magic_request(
391+
query="query",
392+
)
393+
394+
395+
asyncio.run(main())
396+
"""
397+
_response = await self._client_wrapper.httpx_client.request(
398+
"experimental/circuit_assistant",
399+
method="POST",
400+
params={
401+
"query": query,
402+
"cell": cell,
403+
},
404+
request_options=request_options,
405+
)
406+
try:
407+
if 200 <= _response.status_code < 300:
408+
return typing.cast(
409+
MagicResponse,
410+
parse_obj_as(
411+
type_=MagicResponse, # type: ignore
412+
object_=_response.json(),
413+
),
414+
)
415+
if _response.status_code == 422:
416+
raise UnprocessableEntityError(
417+
typing.cast(
418+
HttpValidationError,
419+
parse_obj_as(
420+
type_=HttpValidationError, # type: ignore
421+
object_=_response.json(),
422+
),
423+
)
424+
)
425+
_response_json = _response.json()
426+
except JSONDecodeError:
427+
raise ApiError(status_code=_response.status_code, body=_response.text)
428+
raise ApiError(status_code=_response.status_code, body=_response_json)

0 commit comments

Comments
 (0)