mirror of
https://github.com/perstarkse/minne.git
synced 2026-05-30 03:10:45 +02:00
chore: rename get_id to id, add doc comments, pre-allocate format_history
This commit is contained in:
@@ -194,7 +194,7 @@ impl EvaluationCandidate {
|
||||
fn from_entity(entity: RetrievedEntity) -> Self {
|
||||
let entity_category = Some(format!("{:?}", entity.entity.entity_type));
|
||||
Self {
|
||||
entity_id: entity.entity.get_id().to_string(),
|
||||
entity_id: entity.entity.id().to_string(),
|
||||
source_id: entity.entity.source_id.clone(),
|
||||
entity_name: entity.entity.name.clone(),
|
||||
entity_description: Some(entity.entity.description.clone()),
|
||||
@@ -207,7 +207,7 @@ impl EvaluationCandidate {
|
||||
fn from_chunk(chunk: RetrievedChunk) -> Self {
|
||||
let snippet = chunk_snippet(&chunk.chunk.chunk);
|
||||
Self {
|
||||
entity_id: chunk.chunk.get_id().to_string(),
|
||||
entity_id: chunk.chunk.id().to_string(),
|
||||
source_id: chunk.chunk.source_id.clone(),
|
||||
entity_name: chunk.chunk.source_id.clone(),
|
||||
entity_description: Some(snippet),
|
||||
@@ -423,11 +423,11 @@ pub fn build_case_diagnostics(
|
||||
let mut chunk_entries = Vec::new();
|
||||
for chunk in &candidate.chunks {
|
||||
let contains_answer = text_contains_answer(&chunk.chunk.chunk, answers_lower);
|
||||
let expected_chunk = expected_set.contains(chunk.chunk.get_id());
|
||||
seen_chunks.insert(chunk.chunk.get_id().to_string());
|
||||
attached_chunk_ids.push(chunk.chunk.get_id().to_string());
|
||||
let expected_chunk = expected_set.contains(chunk.chunk.id());
|
||||
seen_chunks.insert(chunk.chunk.id().to_string());
|
||||
attached_chunk_ids.push(chunk.chunk.id().to_string());
|
||||
chunk_entries.push(ChunkDiagnosticsEntry {
|
||||
chunk_id: chunk.chunk.get_id().to_string(),
|
||||
chunk_id: chunk.chunk.id().to_string(),
|
||||
score: chunk.score,
|
||||
contains_answer,
|
||||
expected_chunk,
|
||||
|
||||
Reference in New Issue
Block a user