Repository navigation
Isolate local summary inference per article - #240
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 17590816-0a13-4b19-990e-8aae72213acc
| temperature: 0.0, | ||
| max_tokens: 120, | ||
| top_p: 0.8, | ||
| response_format: { "type" => "json_object" } |
| temperature: 0.0, | ||
| max_tokens: 120, | ||
| top_p: 0.8, | ||
| response_format: { "type" => "json_object" } |
| end | ||
| if facts.empty? | ||
| { facts: [], error: "Summary generation failed - no grounded facts returned." } | ||
| { facts: [], error: errors.first || "Summary generation failed - no grounded facts returned." } |
| saved_endpoint ? ENV['AI_API_ENDPOINT'] = saved_endpoint : ENV.delete('AI_API_ENDPOINT') | ||
| end | ||
|
|
||
| def test_generate_grounded_facts_retries_when_server_rejects_response_format |
| saved_endpoint ? ENV['AI_API_ENDPOINT'] = saved_endpoint : ENV.delete('AI_API_ENDPOINT') | ||
| end | ||
|
|
||
| def test_generate_grounded_facts_retries_when_server_rejects_response_format |
| end | ||
| responses = [ | ||
| response_class.new('unsupported response_format', 400), | ||
| response_class.new({ choices: [{ message: { content: '{"facts":[{"item":1,"sentence":"Council approved the plan."}]}' } }] }.to_json, 200) |
| saved_endpoint ? ENV['AI_API_ENDPOINT'] = saved_endpoint : ENV.delete('AI_API_ENDPOINT') | ||
| end | ||
|
|
||
| def test_generate_grounded_facts_isolates_each_item_request |
| saved_endpoint ? ENV['AI_API_ENDPOINT'] = saved_endpoint : ENV.delete('AI_API_ENDPOINT') | ||
| end | ||
|
|
||
| def test_generate_grounded_facts_isolates_each_item_request |
| end | ||
| end | ||
| responses = [ | ||
| response_class.new({ choices: [{ message: { content: '{"facts":[{"item":1,"sentence":"Water service continues."}]}' } }] }.to_json, 200), |
| end | ||
| responses = [ | ||
| response_class.new({ choices: [{ message: { content: '{"facts":[{"item":1,"sentence":"Water service continues."}]}' } }] }.to_json, 200), | ||
| response_class.new({ choices: [{ message: { content: '{"facts":[{"item":1,"sentence":"Candidate filing closes November 3."}]}' } }] }.to_json, 200) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each article now receives its own local model request, preventing the 2.6B model from borrowing names or context from neighboring items. Responses remain JSON-validated and are assembled deterministically. The cache pipeline version is bumped. All 80 tests and 273 assertions pass.