File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
main/kotlin/com/google/firebase/ai/type
test/java/com/google/firebase/ai/type Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ private constructor(
4747 this .includeThoughts = includeThoughts
4848 }
4949
50- public fun build (): ThinkingConfig = ThinkingConfig (thinkingBudget = thinkingBudget)
50+ public fun build (): ThinkingConfig =
51+ ThinkingConfig (thinkingBudget = thinkingBudget, includeThoughts = includeThoughts)
5152 }
5253
5354 internal fun toInternal () = Internal (thinkingBudget, includeThoughts)
Original file line number Diff line number Diff line change @@ -39,6 +39,21 @@ internal class ThinkingConfigTest {
3939 Json .encodeToString(thinkingConfig.toInternal()).shouldEqualJson(expectedJson)
4040 }
4141
42+ @Test
43+ fun `Include though thinkingConfig` () {
44+ val thinkingConfig = ThinkingConfig .Builder ().setIncludeThoughts(true ).build()
45+ // CamelCase or snake_case work equally fine
46+ val expectedJson =
47+ """
48+ {
49+ "includeThoughts": true
50+ }
51+ """
52+ .trimIndent()
53+
54+ Json .encodeToString(thinkingConfig.toInternal()).shouldEqualJson(expectedJson)
55+ }
56+
4257 @Test
4358 fun `thinkingConfig DSL correctly delegates to ThinkingConfig#Builder` () {
4459 val thinkingConfig = ThinkingConfig .Builder ().setThinkingBudget(1024 ).build()
You can’t perform that action at this time.
0 commit comments