Skip to content

Commit 110b63e

Browse files
authored
Fix (#13)
1 parent 353de47 commit 110b63e

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
@@ -418,7 +418,7 @@ public extension Conversation {
418418
/// 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.
419419
///
420420
/// We generally recommend altering this or `temperature` but not both.
421-
public var topP: Int?
421+
public var topP: Double?
422422

423423
/// The truncation strategy to use for the model response.
424424
public var truncation: Truncation?
@@ -515,7 +515,7 @@ public extension Conversation {
515515
/// 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.
516516
///
517517
/// We generally recommend altering this or `temperature` but not both.
518-
@MainActor var topP: Int? {
518+
@MainActor var topP: Double? {
519519
get { config.topP }
520520
set { config.topP = newValue }
521521
}

src/Models/Request.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ import MetaCodable
8484
/// 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.
8585
///
8686
/// We generally recommend altering this or `temperature` but not both.
87-
public var topP: Int?
87+
public var topP: Double?
8888

8989
/// The truncation strategy to use for the model response.
9090
public var truncation: Truncation?
@@ -129,7 +129,7 @@ import MetaCodable
129129
text: TextConfig? = nil,
130130
toolChoice: Tool.Choice? = nil,
131131
tools: [Tool]? = nil,
132-
topP: Int? = nil,
132+
topP: Double? = nil,
133133
truncation: Truncation? = nil,
134134
user: String? = nil
135135
) {

src/Models/Response.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ import HelperCoders
193193
/// So 0.1 means only the tokens comprising the top 10% probability mass are considered.
194194
///
195195
/// We generally recommend altering this or `temperature` but not both.
196-
public var topP: Int
196+
public var topP: Double
197197

198198
/// The truncation strategy to use for the model response.
199199
public var truncation: Truncation
@@ -263,7 +263,7 @@ import HelperCoders
263263
text: TextConfig,
264264
toolChoice: Tool.Choice,
265265
tools: [Tool] = [],
266-
topP: Int,
266+
topP: Double,
267267
truncation: Truncation,
268268
usage: Usage? = nil,
269269
store: Bool,

0 commit comments

Comments
 (0)