Skip to content

Commit

Permalink
added variable evaluation for non structure output
Browse files Browse the repository at this point in the history
  • Loading branch information
tzhao committed Oct 10, 2018
1 parent 8e7c345 commit 4cf725b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion model/repeater.go
Expand Up @@ -62,13 +62,14 @@ func (r *Repeater) runOnce(service *endly.AbstractService, callerInfo string, co
extractableOutput, structuredOutput := util.AsExtractable(out)

if len(structuredOutput) > 0 {

if len(r.Variables) > 0 {
err = r.Variables.Apply(structuredOutput, extracted)
}
if extractableOutput == "" {
extractableOutput, _ = toolbox.AsJSONText(structuredOutput)
}
} else {
err = r.Variables.Apply(extracted, extracted)
}

err = r.Extraction.Extract(context, extracted, extractableOutput)
Expand Down

0 comments on commit 4cf725b

Please sign in to comment.