-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: box-sdk-build <box-sdk-build@box.com>
- Loading branch information
1 parent
4bcf843
commit 36ee37d
Showing
11 changed files
with
134 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "2efc8ab", "specHash": "e798cb1", "version": "0.5.0" } | ||
{ "engineHash": "2efc8ab", "specHash": "90cf4e4", "version": "0.5.0" } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
Sources/Schemas/AiLlmEndpointParamsAws/AiLlmEndpointParamsAws.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Foundation | ||
|
||
/// AI LLM endpoint params AWS object | ||
public class AiLlmEndpointParamsAws: Codable { | ||
private enum CodingKeys: String, CodingKey { | ||
case type | ||
case temperature | ||
case topP = "top_p" | ||
} | ||
|
||
/// The type of the AI LLM endpoint params object for AWS. | ||
/// This parameter is **required**. | ||
public let type: AiLlmEndpointParamsAwsTypeField | ||
|
||
/// What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output more random, | ||
/// while lower values like 0.2 will make it more focused and deterministic. | ||
/// We generally recommend altering this or `top_p` but not both. | ||
public let temperature: Double? | ||
|
||
/// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results | ||
/// of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability | ||
/// mass are considered. We generally recommend altering this or temperature but not both. | ||
public let topP: Double? | ||
|
||
/// Initializer for a AiLlmEndpointParamsAws. | ||
/// | ||
/// - Parameters: | ||
/// - type: The type of the AI LLM endpoint params object for AWS. | ||
/// This parameter is **required**. | ||
/// - temperature: What sampling temperature to use, between 0 and 1. Higher values like 0.8 will make the output more random, | ||
/// while lower values like 0.2 will make it more focused and deterministic. | ||
/// We generally recommend altering this or `top_p` but not both. | ||
/// - topP: An alternative to sampling with temperature, called nucleus sampling, where the model considers the results | ||
/// of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability | ||
/// mass are considered. We generally recommend altering this or temperature but not both. | ||
public init(type: AiLlmEndpointParamsAwsTypeField = AiLlmEndpointParamsAwsTypeField.awsParams, temperature: Double? = nil, topP: Double? = nil) { | ||
self.type = type | ||
self.temperature = temperature | ||
self.topP = topP | ||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
type = try container.decode(AiLlmEndpointParamsAwsTypeField.self, forKey: .type) | ||
temperature = try container.decodeIfPresent(Double.self, forKey: .temperature) | ||
topP = try container.decodeIfPresent(Double.self, forKey: .topP) | ||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encode(type, forKey: .type) | ||
try container.encodeIfPresent(temperature, forKey: .temperature) | ||
try container.encodeIfPresent(topP, forKey: .topP) | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
Sources/Schemas/AiLlmEndpointParamsAws/AiLlmEndpointParamsAwsTypeField.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Foundation | ||
|
||
public enum AiLlmEndpointParamsAwsTypeField: String, CodableStringEnum { | ||
case awsParams = "aws_params" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters