Skip to content

Commit 7946110

Browse files
Update api spec (#177)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent adadb7f commit 7946110

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

examples_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kittycad.go.patch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
{
3535
"value": {
36-
"example": "// CreateTextToCad: Generate a CAD model from text.\n// \n// 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.\n// \n// 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.\n// \n// 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`.\n// \n// \n// Parameters\n// \n// \t- `outputFormat`: The valid types of output file formats.\n// \t- `kcl`\n// \t- `body`: Body for generating models from text.\n// \n// CreateTextToCad: Generate a CAD model from text.\n// 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.\n//\n// 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.\n//\n// 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`.\n//\n// Parameters\n//\n// - `outputFormat`: The valid types of output file formats.\n// - `kcl`\n// - `body`: Body for generating models from text.\nfunc ExampleMlService_CreateTextToCad() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ml.CreateTextToCad(\"\", true, kittycad.TextToCadCreateBody{Prompt: \"some-string\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
36+
"example": "// CreateTextToCad: Generate a CAD model from text.\n// \n// 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.\n// \n// 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.\n// \n// 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`.\n// \n// \n// Parameters\n// \n// \t- `outputFormat`: The valid types of output file formats.\n// \t- `kcl`\n// \t- `body`: Body for generating models from text.\n// \n// CreateTextToCad: Generate a CAD model from text.\n// 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.\n//\n// 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.\n//\n// 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`.\n//\n// Parameters\n//\n// - `outputFormat`: The valid types of output file formats.\n// - `kcl`\n// - `body`: Body for generating models from text.\nfunc ExampleMlService_CreateTextToCad() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ml.CreateTextToCad(\"\", true, kittycad.TextToCadCreateBody{KclVersion: \"some-string\", ProjectName: \"some-string\", Prompt: \"some-string\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
3737
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MlService.CreateTextToCad"
3838
},
3939
"op": "add",
@@ -257,7 +257,7 @@
257257
},
258258
{
259259
"value": {
260-
"example": "// CreateTextToCadIteration: Iterate on a CAD model with a prompt.\n// \n// 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// \n// You always get the whole code back, even if you only changed a small part of it.\n// \n// 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.\n// \n// 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`.\n// \n// \n// Parameters\n// \n// \t- `body`: Body for generating models from text.\n// \n// CreateTextToCadIteration: Iterate on a CAD model with a prompt.\n// 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//\n// You always get the whole code back, even if you only changed a small part of it.\n//\n// 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.\n//\n// 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`.\n//\n// Parameters\n//\n// - `body`: Body for generating models from text.\nfunc ExampleMlService_CreateTextToCadIteration() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ml.CreateTextToCadIteration(kittycad.TextToCadIterationBody{OriginalSourceCode: \"some-string\", Prompt: \"some-string\", SourceRanges: []kittycad.SourceRangePrompt{kittycad.SourceRangePrompt{File: \"some-string\", Prompt: \"some-string\", Range: kittycad.SourceRange{End: kittycad.SourcePosition{Column: 123, Line: 123}, Start: kittycad.SourcePosition{Column: 123, Line: 123}}}}})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
260+
"example": "// CreateTextToCadIteration: Iterate on a CAD model with a prompt.\n// \n// 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// \n// You always get the whole code back, even if you only changed a small part of it.\n// \n// 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.\n// \n// 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`.\n// \n// \n// Parameters\n// \n// \t- `body`: Body for generating models from text.\n// \n// CreateTextToCadIteration: Iterate on a CAD model with a prompt.\n// 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//\n// You always get the whole code back, even if you only changed a small part of it.\n//\n// 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.\n//\n// 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`.\n//\n// Parameters\n//\n// - `body`: Body for generating models from text.\nfunc ExampleMlService_CreateTextToCadIteration() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Ml.CreateTextToCadIteration(kittycad.TextToCadIterationBody{KclVersion: \"some-string\", OriginalSourceCode: \"some-string\", ProjectName: \"some-string\", Prompt: \"some-string\", SourceRanges: []kittycad.SourceRangePrompt{kittycad.SourceRangePrompt{File: \"some-string\", Prompt: \"some-string\", Range: kittycad.SourceRange{End: kittycad.SourcePosition{Column: 123, Line: 123}, Start: kittycad.SourcePosition{Column: 123, Line: 123}}}}})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
261261
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MlService.CreateTextToCadIteration"
262262
},
263263
"op": "add",

spec.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21540,6 +21540,11 @@
2154021540
}
2154121541
]
2154221542
},
21543+
"kcl_version": {
21544+
"nullable": true,
21545+
"description": "The KCL version being used.",
21546+
"type": "string"
21547+
},
2154321548
"metadata": {
2154421549
"nullable": true,
2154521550
"description": "The metadata for the prompt.",
@@ -21558,6 +21563,11 @@
2155821563
"description": "The output file. In the case of TextToCad this is a link to a file in a GCP bucket.",
2155921564
"type": "string"
2156021565
},
21566+
"project_name": {
21567+
"nullable": true,
21568+
"description": "The name of the project, if any. This allows us to group prompts together that come from the same project and user.",
21569+
"type": "string"
21570+
},
2156121571
"prompt": {
2156221572
"description": "The prompt.",
2156321573
"type": "string"
@@ -30806,6 +30816,16 @@
3080630816
"description": "Body for generating models from text.",
3080730817
"type": "object",
3080830818
"properties": {
30819+
"kcl_version": {
30820+
"nullable": true,
30821+
"description": "The version of kcl to use. If empty, the latest version will be used.",
30822+
"type": "string"
30823+
},
30824+
"project_name": {
30825+
"nullable": true,
30826+
"description": "The project name. This is used to tie the prompt to a project. Which helps us make our models better over time.",
30827+
"type": "string"
30828+
},
3080930829
"prompt": {
3081030830
"description": "The prompt for the model.",
3081130831
"type": "string"
@@ -30933,10 +30953,20 @@
3093330953
"description": "Body for generating models from text.",
3093430954
"type": "object",
3093530955
"properties": {
30956+
"kcl_version": {
30957+
"nullable": true,
30958+
"description": "The version of kcl to use. If empty, the latest version will be used.",
30959+
"type": "string"
30960+
},
3093630961
"original_source_code": {
3093730962
"description": "The source code for the model (in kcl) that is to be edited.",
3093830963
"type": "string"
3093930964
},
30965+
"project_name": {
30966+
"nullable": true,
30967+
"description": "The project name. This is used to tie the prompt to a project. Which helps us make our models better over time.",
30968+
"type": "string"
30969+
},
3094030970
"prompt": {
3094130971
"nullable": true,
3094230972
"description": "The prompt for the model, if not using source ranges.",
@@ -31091,6 +31121,16 @@
3109131121
"description": "Body for generating models from text.",
3109231122
"type": "object",
3109331123
"properties": {
31124+
"kcl_version": {
31125+
"nullable": true,
31126+
"description": "The version of kcl to use. If empty, the latest version will be used.",
31127+
"type": "string"
31128+
},
31129+
"project_name": {
31130+
"nullable": true,
31131+
"description": "The project name. This is used to tie the prompt to a project. Which helps us make our models better over time.",
31132+
"type": "string"
31133+
},
3109431134
"source_ranges": {
3109531135
"description": "The source ranges the user suggested to change. If empty, the prompt will be used and is required.",
3109631136
"type": "array",

types.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)