lib/kaba/test_runner.rb in kaba-0.3.0 vs lib/kaba/test_runner.rb in kaba-0.3.2
- old
+ new
@@ -44,18 +44,21 @@
target = <<~Markdown
```json
#{JSON.pretty_generate(JSON.parse(File.read(row.target_path)))}
```
Markdown
- output = Application.llm_client.chat(
+ output = ""
+ Application.llm_client.chat(
parameters: {
model: model,
messages: [ { role: 'user', content: input } ],
temperature: temperature,
+ stream: proc do |chunk, _bytesize|
+ output += chunk.dig("choices", 0, "delta", "content")
+ end
}
- ).dig("choices", 0, "message", "content")
-
+ )
output_json = JSON.parse_llm_response output
type_check_response = JSON.parse @validate.run(output_json).body
@type_right_total += 1 if type_check_response["success"]
@@ -104,6 +107,6 @@
def report_template_path=(path)
@report_template_path = path
end
end
-end
\ No newline at end of file
+end