Skip to content

Commit 00ae37f

Browse files
feat(specs): add generate code endpoint to ingestion specs (generated)
algolia/api-clients-automation#3489 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent fcfcbd2 commit 00ae37f

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

client/src/commonMain/kotlin/com/algolia/client/api/IngestionClient.kt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,28 @@ public class IngestionClient(
438438
)
439439
}
440440

441+
/**
442+
* Generates code for the selected model based on the given prompt.
443+
*
444+
* Required API Key ACLs:
445+
* - addObject
446+
* - deleteIndex
447+
* - editSettings
448+
* @param generateTransformationCodePayload
449+
* @param requestOptions additional request configuration.
450+
*/
451+
public suspend fun generateTransformationCode(generateTransformationCodePayload: GenerateTransformationCodePayload, requestOptions: RequestOptions? = null): GenerateTransformationCodeResponse {
452+
val requestConfig = RequestConfig(
453+
method = RequestMethod.POST,
454+
path = listOf("1", "transformations", "models"),
455+
body = generateTransformationCodePayload,
456+
)
457+
return requester.execute(
458+
requestConfig = requestConfig,
459+
requestOptions = requestOptions,
460+
)
461+
}
462+
441463
/**
442464
* Retrieves an authentication resource by its ID.
443465
*
@@ -888,7 +910,7 @@ public class IngestionClient(
888910
public suspend fun listTransformationModels(requestOptions: RequestOptions? = null): TransformationModels {
889911
val requestConfig = RequestConfig(
890912
method = RequestMethod.GET,
891-
path = listOf("1", "transformations", "copilot"),
913+
path = listOf("1", "transformations", "models"),
892914
)
893915
return requester.execute(
894916
requestConfig = requestConfig,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */
2+
package com.algolia.client.model.ingestion
3+
4+
import kotlinx.serialization.*
5+
import kotlinx.serialization.json.*
6+
7+
/**
8+
* GenerateTransformationCodePayload
9+
*
10+
* @param id
11+
* @param userPrompt
12+
* @param systemPrompt
13+
*/
14+
@Serializable
15+
public data class GenerateTransformationCodePayload(
16+
17+
@SerialName(value = "id") val id: String,
18+
19+
@SerialName(value = "userPrompt") val userPrompt: String,
20+
21+
@SerialName(value = "systemPrompt") val systemPrompt: String? = null,
22+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/** Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. */
2+
package com.algolia.client.model.ingestion
3+
4+
import kotlinx.serialization.*
5+
import kotlinx.serialization.json.*
6+
7+
/**
8+
* GenerateTransformationCodeResponse
9+
*
10+
* @param generatedCode
11+
*/
12+
@Serializable
13+
public data class GenerateTransformationCodeResponse(
14+
15+
@SerialName(value = "generatedCode") val generatedCode: String? = null,
16+
)

0 commit comments

Comments
 (0)