Skip to content

Commit 108e3e2

Browse files
committed
bump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
1 parent 9cbda88 commit 108e3e2

11 files changed

+415
-367
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.venv

kittycad.py.patch.json

Lines changed: 366 additions & 366 deletions
Large diffs are not rendered by default.

kittycad/api/ai/create_text_to_cad.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@ def _get_kwargs(
1515
body: TextToCadCreateBody,
1616
*,
1717
client: Client,
18+
kcl: Optional[bool] = None,
1819
) -> Dict[str, Any]:
1920
url = "{}/ai/text-to-cad/{output_format}".format(
2021
client.base_url,
2122
output_format=output_format,
2223
) # noqa: E501
2324

25+
if kcl is not None:
26+
27+
if "?" in url:
28+
url = url + "&kcl=" + str(kcl)
29+
else:
30+
url = url + "?kcl=" + str(kcl)
31+
2432
headers: Dict[str, Any] = client.get_headers()
2533
cookies: Dict[str, Any] = client.get_cookies()
2634

@@ -62,9 +70,11 @@ def sync_detailed(
6270
body: TextToCadCreateBody,
6371
*,
6472
client: Client,
73+
kcl: Optional[bool] = None,
6574
) -> Response[Optional[Union[TextToCad, Error]]]:
6675
kwargs = _get_kwargs(
6776
output_format=output_format,
77+
kcl=kcl,
6878
body=body,
6979
client=client,
7080
)
@@ -82,6 +92,7 @@ def sync(
8292
body: TextToCadCreateBody,
8393
*,
8494
client: Client,
95+
kcl: Optional[bool] = None,
8596
) -> Optional[Union[TextToCad, Error]]:
8697
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
8798
This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.
@@ -90,6 +101,7 @@ def sync(
90101

91102
return sync_detailed(
92103
output_format=output_format,
104+
kcl=kcl,
93105
body=body,
94106
client=client,
95107
).parsed
@@ -100,9 +112,11 @@ async def asyncio_detailed(
100112
body: TextToCadCreateBody,
101113
*,
102114
client: Client,
115+
kcl: Optional[bool] = None,
103116
) -> Response[Optional[Union[TextToCad, Error]]]:
104117
kwargs = _get_kwargs(
105118
output_format=output_format,
119+
kcl=kcl,
106120
body=body,
107121
client=client,
108122
)
@@ -118,6 +132,7 @@ async def asyncio(
118132
body: TextToCadCreateBody,
119133
*,
120134
client: Client,
135+
kcl: Optional[bool] = None,
121136
) -> Optional[Union[TextToCad, Error]]:
122137
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
123138
This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.
@@ -127,6 +142,7 @@ async def asyncio(
127142
return (
128143
await asyncio_detailed(
129144
output_format=output_format,
145+
kcl=kcl,
130146
body=body,
131147
client=client,
132148
)

kittycad/client_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ def test_text_to_cad():
547547
body=TextToCadCreateBody(
548548
prompt="a 2x4 lego",
549549
),
550+
kcl=None,
550551
)
551552

552553
if isinstance(result, Error) or result is None:

kittycad/examples_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ def test_create_text_to_cad():
583583
result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(
584584
client=client,
585585
output_format=FileExportFormat.FBX,
586+
kcl=None, # Optional[bool]
586587
body=TextToCadCreateBody(
587588
prompt="<string>",
588589
),
@@ -600,6 +601,7 @@ def test_create_text_to_cad():
600601
create_text_to_cad.sync_detailed(
601602
client=client,
602603
output_format=FileExportFormat.FBX,
604+
kcl=None, # Optional[bool]
603605
body=TextToCadCreateBody(
604606
prompt="<string>",
605607
),
@@ -617,6 +619,7 @@ async def test_create_text_to_cad_async():
617619
result: Optional[Union[TextToCad, Error]] = await create_text_to_cad.asyncio(
618620
client=client,
619621
output_format=FileExportFormat.FBX,
622+
kcl=None, # Optional[bool]
620623
body=TextToCadCreateBody(
621624
prompt="<string>",
622625
),
@@ -627,6 +630,7 @@ async def test_create_text_to_cad_async():
627630
await create_text_to_cad.asyncio_detailed(
628631
client=client,
629632
output_format=FileExportFormat.FBX,
633+
kcl=None, # Optional[bool]
630634
body=TextToCadCreateBody(
631635
prompt="<string>",
632636
),

kittycad/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
from .take_snapshot import TakeSnapshot
227227
from .text_to_cad import TextToCad
228228
from .text_to_cad_create_body import TextToCadCreateBody
229+
from .text_to_cad_model import TextToCadModel
229230
from .text_to_cad_results_page import TextToCadResultsPage
230231
from .unit_angle import UnitAngle
231232
from .unit_angle_conversion import UnitAngleConversion

kittycad/models/ai_prompt_type.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ class AiPromptType(str, Enum):
66

77
"""# Text to CAD. """ # noqa: E501
88
TEXT_TO_CAD = "text_to_cad"
9+
"""# Text to KCL. """ # noqa: E501
10+
TEXT_TO_KCL = "text_to_kcl"
911

1012
def __str__(self) -> str:
1113
return str(self.value)

kittycad/models/async_api_call_output.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ..models.input_format import InputFormat
1212
from ..models.output_format import OutputFormat
1313
from ..models.point3d import Point3d
14+
from ..models.text_to_cad_model import TextToCadModel
1415
from ..models.unit_area import UnitArea
1516
from ..models.unit_density import UnitDensity
1617
from ..models.unit_length import UnitLength
@@ -215,6 +216,8 @@ class file_surface_area(BaseModel):
215216
class text_to_cad(BaseModel):
216217
"""Text to CAD."""
217218

219+
code: Optional[str] = None
220+
218221
completed_at: Optional[datetime.datetime] = None
219222

220223
created_at: datetime.datetime
@@ -225,6 +228,8 @@ class text_to_cad(BaseModel):
225228

226229
id: Uuid
227230

231+
model: TextToCadModel
232+
228233
model_version: str
229234

230235
output_format: FileExportFormat

kittycad/models/text_to_cad.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
from ..models.ai_feedback import AiFeedback
77
from ..models.api_call_status import ApiCallStatus
88
from ..models.file_export_format import FileExportFormat
9+
from ..models.text_to_cad_model import TextToCadModel
910
from ..models.uuid import Uuid
1011
from .base64data import Base64Data
1112

1213

1314
class TextToCad(BaseModel):
1415
"""A response from a text to CAD prompt."""
1516

17+
code: Optional[str] = None
18+
1619
completed_at: Optional[datetime.datetime] = None
1720

1821
created_at: datetime.datetime
@@ -23,6 +26,8 @@ class TextToCad(BaseModel):
2326

2427
id: Uuid
2528

29+
model: TextToCadModel
30+
2631
model_version: str
2732

2833
output_format: FileExportFormat

kittycad/models/text_to_cad_model.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from enum import Enum
2+
3+
4+
class TextToCadModel(str, Enum):
5+
"""A type of Text-to-CAD model.""" # noqa: E501
6+
7+
"""# CAD. """ # noqa: E501
8+
CAD = "cad"
9+
"""# KCL. """ # noqa: E501
10+
KCL = "kcl"
11+
12+
def __str__(self) -> str:
13+
return str(self.value)

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 = "kittycad"
3-
version = "0.6.17"
3+
version = "0.6.18"
44
description = "A client library for accessing KittyCAD"
55

66
authors = []

0 commit comments

Comments
 (0)