Skip to content

Commit fcdee03

Browse files
committed
Add docs for includeThoughts and isThought
1 parent d43f26e commit fcdee03

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

FirebaseAI/Sources/Types/Public/Part.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import Foundation
1919
/// Within a single value of ``Part``, different data types may not mix.
2020
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
2121
public protocol Part: PartsRepresentable, Codable, Sendable, Equatable {
22+
/// Indicates whether this `Part` is a summary of the model's internal thinking process.
23+
///
24+
/// When `includeThoughts` is set to `true` in ``ThinkingConfig``, the model may return one or
25+
/// more "thought" parts that provide insight into how it reasoned through the prompt to arrive
26+
/// at the final answer. These parts will have `isThought` set to `true`.
2227
var isThought: Bool { get }
2328
}
2429

FirebaseAI/Sources/Types/Public/ThinkingConfig.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,21 @@ public struct ThinkingConfig: Sendable {
3737
/// feature or if the specified budget is not within the model's supported range.
3838
let thinkingBudget: Int?
3939

40+
/// Whether summaries of the model's "thoughts" are included in responses.
41+
///
42+
/// When `includeThoughts` is set to `true`, the model will return a summary of its internal
43+
/// thinking process alongside the final answer. This can provide valuable insight into how the
44+
/// model arrived at its conclusion, which is particularly useful for complex or creative tasks.
45+
///
46+
/// If you don't specify a value for `includeThoughts` (`nil`), the model will use its default
47+
/// behavior (which is typically to not include thought summaries).
4048
let includeThoughts: Bool?
4149

4250
/// Initializes a new `ThinkingConfig`.
4351
///
4452
/// - Parameters:
4553
/// - thinkingBudget: The maximum number of tokens to be used for the model's thinking process.
54+
/// - includeThoughts: If true, summaries of the model's "thoughts" are included in responses.
4655
public init(thinkingBudget: Int? = nil, includeThoughts: Bool? = nil) {
4756
self.thinkingBudget = thinkingBudget
4857
self.includeThoughts = includeThoughts

0 commit comments

Comments
 (0)