Update api spec (#375)

* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
zoo-github-actions-auth[bot]
2025-02-10 16:55:38 -08:00
committed by GitHub
parent 3ff3519d68
commit 4aa6b69d5c
13 changed files with 1602 additions and 816 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@ from ...models.file_surface_area import FileSurfaceArea
from ...models.file_volume import FileVolume from ...models.file_volume import FileVolume
from ...models.text_to_cad import TextToCad from ...models.text_to_cad import TextToCad
from ...models.text_to_cad_iteration import TextToCadIteration from ...models.text_to_cad_iteration import TextToCadIteration
from ...models.text_to_cad_multi_file_iteration import TextToCadMultiFileIteration
from ...types import Response from ...types import Response
@ -48,6 +49,7 @@ def _parse_response(
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
]: ]:
@ -121,6 +123,17 @@ def _parse_response(
raise TypeError() raise TypeError()
option_text_to_cad_iteration = TextToCadIteration(**data) option_text_to_cad_iteration = TextToCadIteration(**data)
return option_text_to_cad_iteration return option_text_to_cad_iteration
except ValueError:
pass
except TypeError:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option_text_to_cad_multi_file_iteration = TextToCadMultiFileIteration(
**data
)
return option_text_to_cad_multi_file_iteration
except ValueError: except ValueError:
raise raise
except TypeError: except TypeError:
@ -147,6 +160,7 @@ def _build_response(
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] ]
@ -174,6 +188,7 @@ def sync_detailed(
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] ]
@ -205,6 +220,7 @@ def sync(
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
]: ]:
@ -237,6 +253,7 @@ async def asyncio_detailed(
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] ]
@ -266,6 +283,7 @@ async def asyncio(
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
]: ]:

View File

@ -83,7 +83,9 @@ def sync(
You always get the whole code back, even if you only changed a small part of it. You always get the whole code back, even if you only changed a small part of it.
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.""" # noqa: E501 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 endpoint will soon be deprecated in favor of the `/ml/text-to-cad/multi-file/iteration` endpoint. In that the endpoint path will remain but it will have the same behavior as `ml/text-to-cad/multi-file/iteration`.""" # noqa: E501
return sync_detailed( return sync_detailed(
body=body, body=body,
@ -116,7 +118,9 @@ async def asyncio(
You always get the whole code back, even if you only changed a small part of it. You always get the whole code back, even if you only changed a small part of it.
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.""" # noqa: E501 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 endpoint will soon be deprecated in favor of the `/ml/text-to-cad/multi-file/iteration` endpoint. In that the endpoint path will remain but it will have the same behavior as `ml/text-to-cad/multi-file/iteration`.""" # noqa: E501
return ( return (
await asyncio_detailed( await asyncio_detailed(

View File

@ -0,0 +1,132 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.text_to_cad_multi_file_iteration import TextToCadMultiFileIteration
from ...models.text_to_cad_multi_file_iteration_body import (
TextToCadMultiFileIterationBody,
)
from ...types import Response
def _get_kwargs(
body: TextToCadMultiFileIterationBody,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/ml/text-to-cad/multi-file/iteration".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[TextToCadMultiFileIteration, Error]]:
if response.status_code == 201:
response_201 = TextToCadMultiFileIteration(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[TextToCadMultiFileIteration, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: TextToCadMultiFileIterationBody,
*,
client: Client,
) -> Response[Optional[Union[TextToCadMultiFileIteration, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: TextToCadMultiFileIterationBody,
*,
client: Client,
) -> Optional[Union[TextToCadMultiFileIteration, Error]]:
"""This endpoint can iterate on multi-file models.
Even if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.
You always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.
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.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: TextToCadMultiFileIterationBody,
*,
client: Client,
) -> Response[Optional[Union[TextToCadMultiFileIteration, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: TextToCadMultiFileIterationBody,
*,
client: Client,
) -> Optional[Union[TextToCadMultiFileIteration, Error]]:
"""This endpoint can iterate on multi-file models.
Even if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.
You always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.
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.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -59,6 +59,7 @@ from kittycad.api.ml import (
create_text_to_cad, create_text_to_cad,
create_text_to_cad_iteration, create_text_to_cad_iteration,
create_text_to_cad_model_feedback, create_text_to_cad_model_feedback,
create_text_to_cad_multi_file_iteration,
get_ml_prompt, get_ml_prompt,
get_text_to_cad_model_for_user, get_text_to_cad_model_for_user,
list_ml_prompts, list_ml_prompts,
@ -205,6 +206,7 @@ from kittycad.models import (
ShortlinkResultsPage, ShortlinkResultsPage,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
TextToCadResultsPage, TextToCadResultsPage,
UnitAngleConversion, UnitAngleConversion,
UnitAreaConversion, UnitAreaConversion,
@ -272,6 +274,9 @@ from kittycad.models.source_range_prompt import SourceRangePrompt
from kittycad.models.store_coupon_params import StoreCouponParams from kittycad.models.store_coupon_params import StoreCouponParams
from kittycad.models.text_to_cad_create_body import TextToCadCreateBody from kittycad.models.text_to_cad_create_body import TextToCadCreateBody
from kittycad.models.text_to_cad_iteration_body import TextToCadIterationBody from kittycad.models.text_to_cad_iteration_body import TextToCadIterationBody
from kittycad.models.text_to_cad_multi_file_iteration_body import (
TextToCadMultiFileIterationBody,
)
from kittycad.models.unit_angle import UnitAngle from kittycad.models.unit_angle import UnitAngle
from kittycad.models.unit_area import UnitArea from kittycad.models.unit_area import UnitArea
from kittycad.models.unit_current import UnitCurrent from kittycad.models.unit_current import UnitCurrent
@ -836,6 +841,7 @@ def test_get_async_operation():
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] = get_async_operation.sync( ] = get_async_operation.sync(
@ -856,6 +862,7 @@ def test_get_async_operation():
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
] = result ] = result
print(body) print(body)
@ -871,6 +878,7 @@ def test_get_async_operation():
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] ]
@ -897,6 +905,7 @@ async def test_get_async_operation_async():
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] = await get_async_operation.asyncio( ] = await get_async_operation.asyncio(
@ -916,6 +925,7 @@ async def test_get_async_operation_async():
FileSurfaceArea, FileSurfaceArea,
TextToCad, TextToCad,
TextToCadIteration, TextToCadIteration,
TextToCadMultiFileIteration,
Error, Error,
] ]
] ]
@ -2095,6 +2105,121 @@ async def test_create_text_to_cad_iteration_async():
) )
@pytest.mark.skip
def test_create_text_to_cad_multi_file_iteration():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[TextToCadMultiFileIteration, Error]] = (
create_text_to_cad_multi_file_iteration.sync(
client=client,
body=TextToCadMultiFileIterationBody(
source_ranges=[
SourceRangePrompt(
prompt="<string>",
range=SourceRange(
end=SourcePosition(
column=10,
line=10,
),
start=SourcePosition(
column=10,
line=10,
),
),
)
],
),
)
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: TextToCadMultiFileIteration = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Union[TextToCadMultiFileIteration, Error]]] = (
create_text_to_cad_multi_file_iteration.sync_detailed(
client=client,
body=TextToCadMultiFileIterationBody(
source_ranges=[
SourceRangePrompt(
prompt="<string>",
range=SourceRange(
end=SourcePosition(
column=10,
line=10,
),
start=SourcePosition(
column=10,
line=10,
),
),
)
],
),
)
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_create_text_to_cad_multi_file_iteration_async():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[TextToCadMultiFileIteration, Error]
] = await create_text_to_cad_multi_file_iteration.asyncio(
client=client,
body=TextToCadMultiFileIterationBody(
source_ranges=[
SourceRangePrompt(
prompt="<string>",
range=SourceRange(
end=SourcePosition(
column=10,
line=10,
),
start=SourcePosition(
column=10,
line=10,
),
),
)
],
),
)
# OR run async with more info
response: Response[
Optional[Union[TextToCadMultiFileIteration, Error]]
] = await create_text_to_cad_multi_file_iteration.asyncio_detailed(
client=client,
body=TextToCadMultiFileIterationBody(
source_ranges=[
SourceRangePrompt(
prompt="<string>",
range=SourceRange(
end=SourcePosition(
column=10,
line=10,
),
start=SourcePosition(
column=10,
line=10,
),
),
)
],
),
)
@pytest.mark.skip @pytest.mark.skip
def test_get_org(): def test_get_org():
# Create our client. # Create our client.

View File

@ -312,6 +312,8 @@ from .text_to_cad_create_body import TextToCadCreateBody
from .text_to_cad_iteration import TextToCadIteration from .text_to_cad_iteration import TextToCadIteration
from .text_to_cad_iteration_body import TextToCadIterationBody from .text_to_cad_iteration_body import TextToCadIterationBody
from .text_to_cad_model import TextToCadModel from .text_to_cad_model import TextToCadModel
from .text_to_cad_multi_file_iteration import TextToCadMultiFileIteration
from .text_to_cad_multi_file_iteration_body import TextToCadMultiFileIterationBody
from .text_to_cad_results_page import TextToCadResultsPage from .text_to_cad_results_page import TextToCadResultsPage
from .token_revoke_request_form import TokenRevokeRequestForm from .token_revoke_request_form import TokenRevokeRequestForm
from .transform import Transform from .transform import Transform

View File

@ -290,6 +290,42 @@ class OptionTextToCadIteration(BaseModel):
model_config = ConfigDict(protected_namespaces=()) model_config = ConfigDict(protected_namespaces=())
class OptionTextToCadMultiFileIteration(BaseModel):
"""Text to CAD multi-file iteration."""
completed_at: Optional[datetime.datetime] = None
created_at: datetime.datetime
error: Optional[str] = None
feedback: Optional[MlFeedback] = None
id: Uuid
model: TextToCadModel
model_version: str
outputs: Optional[Dict[str, str]] = None
source_ranges: List[SourceRangePrompt]
started_at: Optional[datetime.datetime] = None
status: ApiCallStatus
type: Literal["text_to_cad_multi_file_iteration"] = (
"text_to_cad_multi_file_iteration"
)
updated_at: datetime.datetime
user_id: Uuid
model_config = ConfigDict(protected_namespaces=())
AsyncApiCallOutput = RootModel[ AsyncApiCallOutput = RootModel[
Annotated[ Annotated[
Union[ Union[
@ -301,6 +337,7 @@ AsyncApiCallOutput = RootModel[
OptionFileSurfaceArea, OptionFileSurfaceArea,
OptionTextToCad, OptionTextToCad,
OptionTextToCadIteration, OptionTextToCadIteration,
OptionTextToCadMultiFileIteration,
], ],
Field(discriminator="type"), Field(discriminator="type"),
] ]

View File

@ -20,6 +20,8 @@ class AsyncApiCallType(str, Enum):
TEXT_TO_CAD = "text_to_cad" TEXT_TO_CAD = "text_to_cad"
"""# Text to CAD iteration. """ # noqa: E501 """# Text to CAD iteration. """ # noqa: E501
TEXT_TO_CAD_ITERATION = "text_to_cad_iteration" TEXT_TO_CAD_ITERATION = "text_to_cad_iteration"
"""# Text to CAD multi-file iteration. """ # noqa: E501
TEXT_TO_CAD_MULTI_FILE_ITERATION = "text_to_cad_multi_file_iteration"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -8,8 +8,10 @@ class MlPromptType(str, Enum):
TEXT_TO_CAD = "text_to_cad" TEXT_TO_CAD = "text_to_cad"
"""# Text to KCL. """ # noqa: E501 """# Text to KCL. """ # noqa: E501
TEXT_TO_KCL = "text_to_kcl" TEXT_TO_KCL = "text_to_kcl"
"""# Text to Kcl iteration, """ # noqa: E501 """# Text to KCL iteration. """ # noqa: E501
TEXT_TO_KCL_ITERATION = "text_to_kcl_iteration" TEXT_TO_KCL_ITERATION = "text_to_kcl_iteration"
"""# Text to KCL iteration with multiple files. """ # noqa: E501
TEXT_TO_KCL_MULTI_FILE_ITERATION = "text_to_kcl_multi_file_iteration"
def __str__(self) -> str: def __str__(self) -> str:
return str(self.value) return str(self.value)

View File

@ -1,3 +1,5 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict from pydantic import BaseModel, ConfigDict
from ..models.source_range import SourceRange from ..models.source_range import SourceRange
@ -6,6 +8,8 @@ from ..models.source_range import SourceRange
class SourceRangePrompt(BaseModel): class SourceRangePrompt(BaseModel):
"""A source range and prompt for a text to CAD iteration.""" """A source range and prompt for a text to CAD iteration."""
file: Optional[str] = None
prompt: str prompt: str
range: SourceRange range: SourceRange

View File

@ -0,0 +1,42 @@
import datetime
from typing import Dict, List, Optional
from pydantic import BaseModel, ConfigDict
from ..models.api_call_status import ApiCallStatus
from ..models.ml_feedback import MlFeedback
from ..models.source_range_prompt import SourceRangePrompt
from ..models.text_to_cad_model import TextToCadModel
from ..models.uuid import Uuid
class TextToCadMultiFileIteration(BaseModel):
"""A response from a text to CAD multi-file iteration."""
completed_at: Optional[datetime.datetime] = None
created_at: datetime.datetime
error: Optional[str] = None
feedback: Optional[MlFeedback] = None
id: Uuid
model: TextToCadModel
model_version: str
outputs: Optional[Dict[str, str]] = None
source_ranges: List[SourceRangePrompt]
started_at: Optional[datetime.datetime] = None
status: ApiCallStatus
updated_at: datetime.datetime
user_id: Uuid
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,13 @@
from typing import List
from pydantic import BaseModel, ConfigDict
from ..models.source_range_prompt import SourceRangePrompt
class TextToCadMultiFileIterationBody(BaseModel):
"""Body for generating models from text."""
source_ranges: List[SourceRangePrompt]
model_config = ConfigDict(protected_namespaces=())

403
spec.json
View File

@ -3708,7 +3708,7 @@
"beta" "beta"
], ],
"summary": "Iterate on a CAD model with a prompt.", "summary": "Iterate on a CAD model with a prompt.",
"description": "Even if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n\nYou always get the whole code back, even if you only changed a small part of it.\n\nThis 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.", "description": "Even if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n\nYou always get the whole code back, even if you only changed a small part of it.\n\nThis 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.\n\nThis endpoint will soon be deprecated in favor of the `/ml/text-to-cad/multi-file/iteration` endpoint. In that the endpoint path will remain but it will have the same behavior as `ml/text-to-cad/multi-file/iteration`.",
"operationId": "create_text_to_cad_iteration", "operationId": "create_text_to_cad_iteration",
"requestBody": { "requestBody": {
"content": { "content": {
@ -3843,6 +3843,149 @@
} }
} }
}, },
"/ml/text-to-cad/multi-file/iteration": {
"post": {
"tags": [
"ml",
"beta"
],
"summary": "Iterate on a CAD model with a prompt.",
"description": "This endpoint can iterate on multi-file models.\n\nEven if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n\nYou always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.\n\nThis 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.",
"operationId": "create_text_to_cad_multi_file_iteration",
"requestBody": {
"description": "Iteration on a multi-file CAD model",
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/TextToCadMultiFileIterationBody"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "successful creation",
"headers": {
"Access-Control-Allow-Credentials": {
"description": "Access-Control-Allow-Credentials header.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"Access-Control-Allow-Headers": {
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"Access-Control-Allow-Methods": {
"description": "Access-Control-Allow-Methods header.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"Access-Control-Allow-Origin": {
"description": "Access-Control-Allow-Origin header.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"X-Api-Call-Id": {
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TextToCadMultiFileIteration"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
"options": {
"tags": [
"hidden"
],
"summary": "OPTIONS endpoint.",
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
"operationId": "options_text_to_cad_multi_file_iteration",
"responses": {
"204": {
"description": "resource updated",
"headers": {
"Access-Control-Allow-Credentials": {
"description": "Access-Control-Allow-Credentials header.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"Access-Control-Allow-Headers": {
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"Access-Control-Allow-Methods": {
"description": "Access-Control-Allow-Methods header.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"Access-Control-Allow-Origin": {
"description": "Access-Control-Allow-Origin header.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
},
"X-Api-Call-Id": {
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/oauth2/device/auth": { "/oauth2/device/auth": {
"post": { "post": {
"tags": [ "tags": [
@ -16427,6 +16570,119 @@
"updated_at", "updated_at",
"user_id" "user_id"
] ]
},
{
"description": "Text to CAD multi-file iteration.",
"type": "object",
"properties": {
"completed_at": {
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed.",
"type": "string",
"format": "date-time"
},
"created_at": {
"title": "DateTime",
"description": "The time and date the API call was created.",
"type": "string",
"format": "date-time"
},
"error": {
"nullable": true,
"description": "The error the function returned, if any.",
"type": "string"
},
"feedback": {
"nullable": true,
"description": "Feedback from the user, if any.",
"allOf": [
{
"$ref": "#/components/schemas/MlFeedback"
}
]
},
"id": {
"description": "The unique identifier of the API call.\n\nThis is the same as the API call ID.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"model": {
"description": "The model being used.",
"allOf": [
{
"$ref": "#/components/schemas/TextToCadModel"
}
]
},
"model_version": {
"description": "The version of the model.",
"type": "string"
},
"outputs": {
"description": "The output files. Returns a map of the file name to the file contents. The file contents are not encoded since kcl files are not binary.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"source_ranges": {
"description": "The source ranges the user suggested to change.",
"type": "array",
"items": {
"$ref": "#/components/schemas/SourceRangePrompt"
}
},
"started_at": {
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started.",
"type": "string",
"format": "date-time"
},
"status": {
"description": "The status of the API call.",
"allOf": [
{
"$ref": "#/components/schemas/ApiCallStatus"
}
]
},
"type": {
"type": "string",
"enum": [
"text_to_cad_multi_file_iteration"
]
},
"updated_at": {
"title": "DateTime",
"description": "The time and date the API call was last updated.",
"type": "string",
"format": "date-time"
},
"user_id": {
"description": "The user ID of the user who created the API call.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
}
},
"required": [
"created_at",
"id",
"model",
"model_version",
"source_ranges",
"status",
"type",
"updated_at",
"user_id"
]
} }
] ]
}, },
@ -16509,6 +16765,13 @@
"enum": [ "enum": [
"text_to_cad_iteration" "text_to_cad_iteration"
] ]
},
{
"description": "Text to CAD multi-file iteration.",
"type": "string",
"enum": [
"text_to_cad_multi_file_iteration"
]
} }
] ]
}, },
@ -21410,11 +21673,18 @@
] ]
}, },
{ {
"description": "Text to Kcl iteration,", "description": "Text to KCL iteration.",
"type": "string", "type": "string",
"enum": [ "enum": [
"text_to_kcl_iteration" "text_to_kcl_iteration"
] ]
},
{
"description": "Text to KCL iteration with multiple files.",
"type": "string",
"enum": [
"text_to_kcl_multi_file_iteration"
]
} }
] ]
}, },
@ -30060,12 +30330,17 @@
"description": "A source range and prompt for a text to CAD iteration.", "description": "A source range and prompt for a text to CAD iteration.",
"type": "object", "type": "object",
"properties": { "properties": {
"file": {
"nullable": true,
"description": "The name of the file the source range applies to. This only applies to multi-file iterations.",
"type": "string"
},
"prompt": { "prompt": {
"description": "The prompt for the changes.", "description": "The prompt for the changes.",
"type": "string" "type": "string"
}, },
"range": { "range": {
"description": "The range of the source code to change.", "description": "The range of the source code to change. If you want to apply the prompt to the whole file, set the start to 0 and the end to the end of the file.",
"allOf": [ "allOf": [
{ {
"$ref": "#/components/schemas/SourceRange" "$ref": "#/components/schemas/SourceRange"
@ -30706,6 +30981,128 @@
} }
] ]
}, },
"TextToCadMultiFileIteration": {
"description": "A response from a text to CAD multi-file iteration.",
"type": "object",
"properties": {
"completed_at": {
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed.",
"type": "string",
"format": "date-time"
},
"created_at": {
"title": "DateTime",
"description": "The time and date the API call was created.",
"type": "string",
"format": "date-time"
},
"error": {
"nullable": true,
"description": "The error the function returned, if any.",
"type": "string"
},
"feedback": {
"nullable": true,
"description": "Feedback from the user, if any.",
"allOf": [
{
"$ref": "#/components/schemas/MlFeedback"
}
]
},
"id": {
"description": "The unique identifier of the API call.\n\nThis is the same as the API call ID.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"model": {
"description": "The model being used.",
"allOf": [
{
"$ref": "#/components/schemas/TextToCadModel"
}
]
},
"model_version": {
"description": "The version of the model.",
"type": "string"
},
"outputs": {
"description": "The output files. Returns a map of the file name to the file contents. The file contents are not encoded since kcl files are not binary.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"source_ranges": {
"description": "The source ranges the user suggested to change.",
"type": "array",
"items": {
"$ref": "#/components/schemas/SourceRangePrompt"
}
},
"started_at": {
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started.",
"type": "string",
"format": "date-time"
},
"status": {
"description": "The status of the API call.",
"allOf": [
{
"$ref": "#/components/schemas/ApiCallStatus"
}
]
},
"updated_at": {
"title": "DateTime",
"description": "The time and date the API call was last updated.",
"type": "string",
"format": "date-time"
},
"user_id": {
"description": "The user ID of the user who created the API call.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
}
},
"required": [
"created_at",
"id",
"model",
"model_version",
"source_ranges",
"status",
"updated_at",
"user_id"
]
},
"TextToCadMultiFileIterationBody": {
"description": "Body for generating models from text.",
"type": "object",
"properties": {
"source_ranges": {
"description": "The source ranges the user suggested to change. If empty, the prompt will be used and is required.",
"type": "array",
"items": {
"$ref": "#/components/schemas/SourceRangePrompt"
}
}
},
"required": [
"source_ranges"
]
},
"TextToCadResultsPage": { "TextToCadResultsPage": {
"description": "A single page of results", "description": "A single page of results",
"type": "object", "type": "object",