(rng: &mut Rng)
| 230 | } |
| 231 | |
| 232 | fn gen_content_block(rng: &mut Rng) -> ContentBlock { |
| 233 | match rng.below(4) { |
| 234 | 0 => ContentBlock::Text { text: rng.string() }, |
| 235 | 1 => ContentBlock::Image { |
| 236 | source: gen_image_source(rng), |
| 237 | }, |
| 238 | 2 => ContentBlock::ToolUse { |
| 239 | id: rng.string(), |
| 240 | name: rng.string(), |
| 241 | input: rng.json_value(2), |
| 242 | }, |
| 243 | _ => ContentBlock::ToolResult { |
| 244 | tool_use_id: rng.string(), |
| 245 | content: gen_tool_result_field(rng), |
| 246 | is_error: if rng.boolean() { |
| 247 | Some(rng.boolean()) |
| 248 | } else { |
| 249 | None |
| 250 | }, |
| 251 | }, |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | fn gen_message(rng: &mut Rng) -> Message { |
| 256 | let roles = ["user", "assistant", "system", "tool"]; |
no test coverage detected