Skip to content

Commit f6ac663

Browse files
committed
Update API
1 parent 3111e63 commit f6ac663

File tree

1 file changed

+8
-8
lines changed
  • examples-kotlin/src/main/kotlin/com/embabel/example/factchecker

1 file changed

+8
-8
lines changed

examples-kotlin/src/main/kotlin/com/embabel/example/factchecker/factChecker.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ data class FactualAssertions(val factualAssertions: List<FactualAssertion>)
3939

4040
data class RationalizedFactualAssertions(
4141
val factualAssertions: List<FactualAssertion>,
42-
@JsonPropertyDescription("factual assertions that were merged")
42+
@param:JsonPropertyDescription("factual assertions that were merged")
4343
val numberMerged: Int,
4444
)
4545

4646
data class AssertionCheck(
4747
val assertion: String,
4848
val isTrue: Boolean,
49-
@JsonPropertyDescription("confidence in your judgment as to whether the assertion true or false. From 0-1")
49+
@param:JsonPropertyDescription("confidence in your judgment as to whether the assertion true or false. From 0-1")
5050
val confidence: ZeroToOne,
51-
@JsonPropertyDescription("reasoning for your scoring")
51+
@param:JsonPropertyDescription("reasoning for your scoring")
5252
val reasoning: String,
5353
override val links: List<InternetResource>,
5454
) : InternetResources
@@ -104,8 +104,6 @@ fun factCheckerAgent(
104104

105105
flow {
106106

107-
// referencedAgentAction<UserInput, ResearchReport>(agentName = Researcher::class.java.name)
108-
109107
aggregate<UserInput, FactualAssertions, RationalizedFactualAssertions>(
110108
transforms = llms.map { llm ->
111109
{ context ->
@@ -138,9 +136,11 @@ fun factCheckerAgent(
138136
}
139137

140138
transformation<RationalizedFactualAssertions, FactCheck> { operationContext ->
141-
val promptRunner = operationContext.ai().withAutoLlm().withToolGroups(
142-
setOf(CoreToolGroups.WEB, CoreToolGroups.BROWSER_AUTOMATION),
143-
)
139+
val promptRunner = operationContext.ai()
140+
.withAutoLlm()
141+
.withTools(
142+
CoreToolGroups.WEB, CoreToolGroups.BROWSER_AUTOMATION,
143+
)
144144
val checks = operationContext.input.factualAssertions.parallelMap(operationContext) { assertion ->
145145
promptRunner.createObject<AssertionCheck>(
146146
"""

0 commit comments

Comments
 (0)