Skip to content

Commit 3b051ad

Browse files
algolia-botFluf22
andcommitted
feat(specs): add transformation copilot to ingestion (generated)
algolia/api-clients-automation#3479 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent 4881704 commit 3b051ad

File tree

3 files changed

+141
-0
lines changed

3 files changed

+141
-0
lines changed

Sources/Ingestion/IngestionClient.swift

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,46 @@ open class IngestionClient {
23192319
)
23202320
}
23212321

2322+
/// - returns: TransformationModels
2323+
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
2324+
open func listTransformationModels(requestOptions: RequestOptions? = nil) async throws -> TransformationModels {
2325+
let response: Response<TransformationModels> =
2326+
try await listTransformationModelsWithHTTPInfo(requestOptions: requestOptions)
2327+
2328+
guard let body = response.body else {
2329+
throw AlgoliaError.missingData
2330+
}
2331+
2332+
return body
2333+
}
2334+
2335+
// Retrieves a list of existing LLM transformation helpers.
2336+
// Required API Key ACLs:
2337+
// - addObject
2338+
// - deleteIndex
2339+
// - editSettings
2340+
// - returns: RequestBuilder<TransformationModels>
2341+
2342+
open func listTransformationModelsWithHTTPInfo(
2343+
requestOptions userRequestOptions: RequestOptions? =
2344+
nil
2345+
) async throws -> Response<TransformationModels> {
2346+
let resourcePath = "/1/transformations/copilot"
2347+
let body: AnyCodable? = nil
2348+
let queryParameters: [String: Any?]? = nil
2349+
2350+
let nillableHeaders: [String: Any?]? = nil
2351+
2352+
let headers = APIHelper.rejectNilHeaders(nillableHeaders)
2353+
2354+
return try await self.transporter.send(
2355+
method: "GET",
2356+
path: resourcePath,
2357+
data: body,
2358+
requestOptions: RequestOptions(headers: headers, queryParameters: queryParameters) + userRequestOptions
2359+
)
2360+
}
2361+
23222362
/// - parameter itemsPerPage: (query) Number of items per page. (optional, default to 10)
23232363
/// - parameter page: (query) Page number of the paginated API response. (optional)
23242364
/// - parameter sort: (query) Property by which to sort the list. (optional)

Sources/Ingestion/Models/Model.swift

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
import Foundation
5+
#if canImport(Core)
6+
import Core
7+
#endif
8+
9+
public struct Model: Codable, JSONEncodable {
10+
public var fullname: String
11+
public var modelName: String
12+
public var systemPrompt: String
13+
public var id: String
14+
public var provider: String
15+
16+
public init(fullname: String, modelName: String, systemPrompt: String, id: String, provider: String) {
17+
self.fullname = fullname
18+
self.modelName = modelName
19+
self.systemPrompt = systemPrompt
20+
self.id = id
21+
self.provider = provider
22+
}
23+
24+
public enum CodingKeys: String, CodingKey, CaseIterable {
25+
case fullname
26+
case modelName
27+
case systemPrompt
28+
case id
29+
case provider
30+
}
31+
32+
// Encodable protocol methods
33+
34+
public func encode(to encoder: Encoder) throws {
35+
var container = encoder.container(keyedBy: CodingKeys.self)
36+
try container.encode(self.fullname, forKey: .fullname)
37+
try container.encode(self.modelName, forKey: .modelName)
38+
try container.encode(self.systemPrompt, forKey: .systemPrompt)
39+
try container.encode(self.id, forKey: .id)
40+
try container.encode(self.provider, forKey: .provider)
41+
}
42+
}
43+
44+
extension Model: Equatable {
45+
public static func ==(lhs: Model, rhs: Model) -> Bool {
46+
lhs.fullname == rhs.fullname &&
47+
lhs.modelName == rhs.modelName &&
48+
lhs.systemPrompt == rhs.systemPrompt &&
49+
lhs.id == rhs.id &&
50+
lhs.provider == rhs.provider
51+
}
52+
}
53+
54+
extension Model: Hashable {
55+
public func hash(into hasher: inout Hasher) {
56+
hasher.combine(self.fullname.hashValue)
57+
hasher.combine(self.modelName.hashValue)
58+
hasher.combine(self.systemPrompt.hashValue)
59+
hasher.combine(self.id.hashValue)
60+
hasher.combine(self.provider.hashValue)
61+
}
62+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
import Foundation
5+
#if canImport(Core)
6+
import Core
7+
#endif
8+
9+
/// List of available AI models for transformation purposes.
10+
public struct TransformationModels: Codable, JSONEncodable {
11+
public var llms: [Model]
12+
13+
public init(llms: [Model]) {
14+
self.llms = llms
15+
}
16+
17+
public enum CodingKeys: String, CodingKey, CaseIterable {
18+
case llms
19+
}
20+
21+
// Encodable protocol methods
22+
23+
public func encode(to encoder: Encoder) throws {
24+
var container = encoder.container(keyedBy: CodingKeys.self)
25+
try container.encode(self.llms, forKey: .llms)
26+
}
27+
}
28+
29+
extension TransformationModels: Equatable {
30+
public static func ==(lhs: TransformationModels, rhs: TransformationModels) -> Bool {
31+
lhs.llms == rhs.llms
32+
}
33+
}
34+
35+
extension TransformationModels: Hashable {
36+
public func hash(into hasher: inout Hasher) {
37+
hasher.combine(self.llms.hashValue)
38+
}
39+
}

0 commit comments

Comments
 (0)