1717from ..core .serialization import convert_and_respect_annotation_metadata
1818from ..types .synthesis_response import SynthesisResponse
1919from ..types .synthesize_circuit_response import SynthesizeCircuitResponse
20- from ..types .generate_code_response import GenerateCodeResponse
21- from ..types .refine_code_response import RefineCodeResponse
20+ from ..types .generate_component_code_response import GenerateComponentCodeResponse
21+ from ..types .refine_component_code_response import RefineComponentCodeResponse
2222from ..types .netlist import Netlist
2323from ..types .statement import Statement
2424from ..types .measurement import Measurement
@@ -489,9 +489,11 @@ def synthesize_circuit_from_text(
489489 raise ApiError (status_code = _response .status_code , body = _response .text )
490490 raise ApiError (status_code = _response .status_code , body = _response_json )
491491
492- def generate (self , * , query : str , request_options : typing .Optional [RequestOptions ] = None ) -> GenerateCodeResponse :
492+ def generate (
493+ self , * , query : str , request_options : typing .Optional [RequestOptions ] = None
494+ ) -> GenerateComponentCodeResponse :
493495 """
494- Generate GDS factory code to create a circuit
496+ Generate GDS factory code to create a PIC component
495497
496498 Parameters
497499 ----------
@@ -502,7 +504,7 @@ def generate(self, *, query: str, request_options: typing.Optional[RequestOption
502504
503505 Returns
504506 -------
505- GenerateCodeResponse
507+ GenerateComponentCodeResponse
506508 Successful Response
507509
508510 Examples
@@ -517,20 +519,23 @@ def generate(self, *, query: str, request_options: typing.Optional[RequestOption
517519 )
518520 """
519521 _response = self ._client_wrapper .httpx_client .request (
520- "pic/code /generate" ,
522+ "pic/component /generate" ,
521523 method = "POST" ,
522524 json = {
523525 "query" : query ,
524526 },
527+ headers = {
528+ "content-type" : "application/json" ,
529+ },
525530 request_options = request_options ,
526531 omit = OMIT ,
527532 )
528533 try :
529534 if 200 <= _response .status_code < 300 :
530535 return typing .cast (
531- GenerateCodeResponse ,
536+ GenerateComponentCodeResponse ,
532537 parse_obj_as (
533- type_ = GenerateCodeResponse , # type: ignore
538+ type_ = GenerateComponentCodeResponse , # type: ignore
534539 object_ = _response .json (),
535540 ),
536541 )
@@ -556,7 +561,7 @@ def refine(
556561 feedback : typing .Optional [str ] = OMIT ,
557562 code : typing .Optional [str ] = OMIT ,
558563 request_options : typing .Optional [RequestOptions ] = None ,
559- ) -> RefineCodeResponse :
564+ ) -> RefineComponentCodeResponse :
560565 """
561566 Refine GDS factory code to create a circuit
562567
@@ -573,7 +578,7 @@ def refine(
573578
574579 Returns
575580 -------
576- RefineCodeResponse
581+ RefineComponentCodeResponse
577582 Successful Response
578583
579584 Examples
@@ -588,22 +593,25 @@ def refine(
588593 )
589594 """
590595 _response = self ._client_wrapper .httpx_client .request (
591- "pic/code /refine" ,
596+ "pic/component /refine" ,
592597 method = "POST" ,
593598 json = {
594599 "query" : query ,
595600 "feedback" : feedback ,
596601 "code" : code ,
597602 },
603+ headers = {
604+ "content-type" : "application/json" ,
605+ },
598606 request_options = request_options ,
599607 omit = OMIT ,
600608 )
601609 try :
602610 if 200 <= _response .status_code < 300 :
603611 return typing .cast (
604- RefineCodeResponse ,
612+ RefineComponentCodeResponse ,
605613 parse_obj_as (
606- type_ = RefineCodeResponse , # type: ignore
614+ type_ = RefineComponentCodeResponse , # type: ignore
607615 object_ = _response .json (),
608616 ),
609617 )
@@ -1346,9 +1354,9 @@ async def main() -> None:
13461354
13471355 async def generate (
13481356 self , * , query : str , request_options : typing .Optional [RequestOptions ] = None
1349- ) -> GenerateCodeResponse :
1357+ ) -> GenerateComponentCodeResponse :
13501358 """
1351- Generate GDS factory code to create a circuit
1359+ Generate GDS factory code to create a PIC component
13521360
13531361 Parameters
13541362 ----------
@@ -1359,7 +1367,7 @@ async def generate(
13591367
13601368 Returns
13611369 -------
1362- GenerateCodeResponse
1370+ GenerateComponentCodeResponse
13631371 Successful Response
13641372
13651373 Examples
@@ -1382,20 +1390,23 @@ async def main() -> None:
13821390 asyncio.run(main())
13831391 """
13841392 _response = await self ._client_wrapper .httpx_client .request (
1385- "pic/code /generate" ,
1393+ "pic/component /generate" ,
13861394 method = "POST" ,
13871395 json = {
13881396 "query" : query ,
13891397 },
1398+ headers = {
1399+ "content-type" : "application/json" ,
1400+ },
13901401 request_options = request_options ,
13911402 omit = OMIT ,
13921403 )
13931404 try :
13941405 if 200 <= _response .status_code < 300 :
13951406 return typing .cast (
1396- GenerateCodeResponse ,
1407+ GenerateComponentCodeResponse ,
13971408 parse_obj_as (
1398- type_ = GenerateCodeResponse , # type: ignore
1409+ type_ = GenerateComponentCodeResponse , # type: ignore
13991410 object_ = _response .json (),
14001411 ),
14011412 )
@@ -1421,7 +1432,7 @@ async def refine(
14211432 feedback : typing .Optional [str ] = OMIT ,
14221433 code : typing .Optional [str ] = OMIT ,
14231434 request_options : typing .Optional [RequestOptions ] = None ,
1424- ) -> RefineCodeResponse :
1435+ ) -> RefineComponentCodeResponse :
14251436 """
14261437 Refine GDS factory code to create a circuit
14271438
@@ -1438,7 +1449,7 @@ async def refine(
14381449
14391450 Returns
14401451 -------
1441- RefineCodeResponse
1452+ RefineComponentCodeResponse
14421453 Successful Response
14431454
14441455 Examples
@@ -1461,22 +1472,25 @@ async def main() -> None:
14611472 asyncio.run(main())
14621473 """
14631474 _response = await self ._client_wrapper .httpx_client .request (
1464- "pic/code /refine" ,
1475+ "pic/component /refine" ,
14651476 method = "POST" ,
14661477 json = {
14671478 "query" : query ,
14681479 "feedback" : feedback ,
14691480 "code" : code ,
14701481 },
1482+ headers = {
1483+ "content-type" : "application/json" ,
1484+ },
14711485 request_options = request_options ,
14721486 omit = OMIT ,
14731487 )
14741488 try :
14751489 if 200 <= _response .status_code < 300 :
14761490 return typing .cast (
1477- RefineCodeResponse ,
1491+ RefineComponentCodeResponse ,
14781492 parse_obj_as (
1479- type_ = RefineCodeResponse , # type: ignore
1493+ type_ = RefineComponentCodeResponse , # type: ignore
14801494 object_ = _response .json (),
14811495 ),
14821496 )
0 commit comments