Skip to content

Commit 1fef23b

Browse files
authored
Fixing type Error on Temperature Value (#12)
1 parent cbda32b commit 1fef23b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Conversation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public extension Conversation {
395395
/// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
396396
///
397397
/// We generally recommend altering this or `top_p` but not both.
398-
public var temperature: Int?
398+
public var temperature: Double?
399399

400400
/// Configuration options for a text response from the model. Can be plain text or structured JSON data.
401401
///
@@ -480,7 +480,7 @@ public extension Conversation {
480480
/// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
481481
///
482482
/// We generally recommend altering this or `top_p` but not both.
483-
@MainActor var temperature: Int? {
483+
@MainActor var temperature: Double? {
484484
get { config.temperature }
485485
set { config.temperature = newValue }
486486
}

src/Models/Request.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import MetaCodable
6262
/// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
6363
///
6464
/// We generally recommend altering this or `top_p` but not both.
65-
public var temperature: Int?
65+
public var temperature: Double?
6666

6767
/// Configuration options for a text response from the model. Can be plain text or structured JSON data.
6868
/// - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
@@ -125,7 +125,7 @@ import MetaCodable
125125
reasoning: ReasoningConfig? = nil,
126126
store: Bool? = nil,
127127
stream: Bool? = nil,
128-
temperature: Int? = nil,
128+
temperature: Double? = nil,
129129
text: TextConfig? = nil,
130130
toolChoice: Tool.Choice? = nil,
131131
tools: [Tool]? = nil,

src/Models/Response.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ import HelperCoders
169169
/// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
170170
///
171171
/// We generally recommend altering this or `topP` but not both.
172-
public var temperature: Int
172+
public var temperature: Double
173173

174174
/// Configuration options for a text response from the model. Can be plain text or structured JSON data.
175175
/// - [Text inputs and outputs](https://platform.openai.com/docs/guides/text)
@@ -259,7 +259,7 @@ import HelperCoders
259259
previousResponseId: String? = nil,
260260
reasoning: ReasoningConfig,
261261
status: Status,
262-
temperature: Int,
262+
temperature: Double,
263263
text: TextConfig,
264264
toolChoice: Tool.Choice,
265265
tools: [Tool] = [],

0 commit comments

Comments
 (0)