Skip to content

Commit

Permalink
I have generated the latest API!
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 15, 2023
1 parent 97032f1 commit 502c7a7
Show file tree
Hide file tree
Showing 284 changed files with 22,227 additions and 24,891 deletions.
428 changes: 230 additions & 198 deletions kittycad.py.patch.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kittycad/api/ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """ # noqa: E501
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """ # noqa: E501
130 changes: 30 additions & 100 deletions kittycad/api/ai/create_text_to_cad.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,15 @@


def _get_kwargs(


output_format: FileExportFormat,



body: TextToCadCreateBody,


*,
client: Client,





) -> Dict[str, Any]:
url = "{}/ai/text-to-cad/{output_format}".format(client.base_url, output_format=output_format,) # noqa: E501






url = "{}/ai/text-to-cad/{output_format}".format(
client.base_url,
output_format=output_format,
) # noqa: E501

headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
Expand All @@ -48,23 +33,22 @@ def _get_kwargs(
}


def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]] :
if response.status_code == 201:
response_201 = TextToCad.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return Error.from_dict(response.json())

def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]:
if response.status_code == 201:
response_201 = TextToCad.from_dict(response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return Error.from_dict(response.json())


def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[TextToCad, Error]]]:
) -> Response[Optional[Union[TextToCad, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
Expand All @@ -74,29 +58,14 @@ def _build_response(


def sync_detailed(


output_format: FileExportFormat,



body: TextToCadCreateBody,


*,
client: Client,





) -> Response[Optional[Union[TextToCad, Error]]]:
) -> Response[Optional[Union[TextToCad, Error]]]:
kwargs = _get_kwargs(

output_format=output_format,

body=body,

client=client,
)

Expand All @@ -109,60 +78,33 @@ def sync_detailed(


def sync(


output_format: FileExportFormat,



body: TextToCadCreateBody,


*,
client: Client,





) -> Optional[Union[TextToCad, Error]] :
"""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.
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501
) -> Optional[Union[TextToCad, Error]]:
"""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.
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.
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.
""" # noqa: E501

return sync_detailed(

output_format=output_format,

body=body,

client=client,
).parsed


async def asyncio_detailed(


output_format: FileExportFormat,



body: TextToCadCreateBody,


*,
client: Client,





) -> Response[Optional[Union[TextToCad, Error]]]:
) -> Response[Optional[Union[TextToCad, Error]]]:
kwargs = _get_kwargs(

output_format=output_format,

body=body,

client=client,
)

Expand All @@ -173,33 +115,21 @@ async def asyncio_detailed(


async def asyncio(


output_format: FileExportFormat,



body: TextToCadCreateBody,


*,
client: Client,





) -> Optional[Union[TextToCad, Error]] :
"""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.
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.""" # noqa: E501
) -> Optional[Union[TextToCad, Error]]:
"""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.
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.
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.
""" # noqa: E501

return (
await asyncio_detailed(

output_format=output_format,

body=body,

client=client,
)
).parsed
Loading

0 comments on commit 502c7a7

Please sign in to comment.