|
43 | 43 | input: { answer:, answered: true, sources_used: %w[link_1], answer_completeness: "complete" }, |
44 | 44 | name: "output_schema", |
45 | 45 | ) |
46 | | - expected_llm_response = claude_messages_response( |
47 | | - content: [expected_content], |
48 | | - usage: { cache_read_input_tokens: 20 }, |
49 | | - stop_reason: :tool_use, |
50 | | - ).to_h |
| 46 | + expected_llm_response = { |
| 47 | + "response" => claude_messages_response( |
| 48 | + content: [expected_content], |
| 49 | + usage: { cache_read_input_tokens: 20 }, |
| 50 | + stop_reason: :tool_use, |
| 51 | + ).to_h.stringify_keys, |
| 52 | + "link_token_mapping" => { |
| 53 | + "link_1" => "https://www.test.gov.uk/vat-rates#vat-basics", |
| 54 | + "link_2" => "https://www.test.gov.uk/what-is-tax", |
| 55 | + }, |
| 56 | + } |
51 | 57 | expect(context.answer.llm_responses["structured_answer"]).to eq(expected_llm_response) |
52 | 58 | end |
53 | 59 |
|
|
139 | 145 | }, |
140 | 146 | name: "output_schema", |
141 | 147 | ) |
142 | | - expected_llm_response = claude_messages_response( |
143 | | - content: [expected_content], |
144 | | - usage: { cache_read_input_tokens: 20 }, |
145 | | - stop_reason: :tool_use, |
146 | | - ).to_h |
| 148 | + expected_llm_response = { |
| 149 | + "response" => claude_messages_response( |
| 150 | + content: [expected_content], |
| 151 | + usage: { cache_read_input_tokens: 20 }, |
| 152 | + stop_reason: :tool_use, |
| 153 | + ).to_h.stringify_keys, |
| 154 | + "link_token_mapping" => { |
| 155 | + "link_1" => "https://www.test.gov.uk/vat-rates#vat-basics", |
| 156 | + "link_2" => "https://www.test.gov.uk/what-is-tax", |
| 157 | + }, |
| 158 | + } |
147 | 159 | expect(context.answer.llm_responses["structured_answer"]).to eq(expected_llm_response) |
148 | 160 | end |
149 | 161 | end |
|
0 commit comments