(path: &Path, value: &Value)
| 416 | } |
| 417 | |
| 418 | fn session_id_from_transcript(path: &Path, value: &Value) -> String { |
| 419 | string_field(value, &["sessionId", "conversationId", "workflowId", "id"]) |
| 420 | .or_else(|| { |
| 421 | value |
| 422 | .get("metadata") |
| 423 | .and_then(|meta| string_field(meta, &["workflowId", "sessionId"])) |
| 424 | }) |
| 425 | .unwrap_or_else(|| { |
| 426 | path.file_stem() |
| 427 | .and_then(|stem| stem.to_str()) |
| 428 | .unwrap_or("unknown") |
| 429 | .to_string() |
| 430 | }) |
| 431 | } |
| 432 | |
| 433 | fn model_from_transcript(value: &Value) -> Option<String> { |
| 434 | string_field(value, &["modelId", "modelID", "modelName", "model"]).or_else(|| { |
no test coverage detected