Skip to content

SearchKnowledgeHit

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

A semantic search hit.

public sealed record SearchKnowledgeHit : IEquatable<SearchKnowledgeHit>

objectSearchKnowledgeHit

IEquatable<SearchKnowledgeHit>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

public SearchKnowledgeHit()

Sequence number within the source.

public required int ChunkIndex { get; init; }

int

The chunk’s text.

public required string Content { get; init; }

string

Cosine distance. A smaller value means closer.

public required double Distance { get; init; }

double

Optional metadata given at write time.

public IReadOnlyDictionary<string, string>? Metadata { get; init; }

IReadOnlyDictionary<string, string>?

Identifier of the source the chunk belongs to.

public required string SourceId { get; init; }

string

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(SearchKnowledgeHit? other)

other SearchKnowledgeHit?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(SearchKnowledgeHit?, SearchKnowledgeHit?)

Section titled “ operator ==(SearchKnowledgeHit?, SearchKnowledgeHit?)”
public static bool operator ==(SearchKnowledgeHit? left, SearchKnowledgeHit? right)

left SearchKnowledgeHit?

right SearchKnowledgeHit?

bool

operator !=(SearchKnowledgeHit?, SearchKnowledgeHit?)

Section titled “ operator !=(SearchKnowledgeHit?, SearchKnowledgeHit?)”
public static bool operator !=(SearchKnowledgeHit? left, SearchKnowledgeHit? right)

left SearchKnowledgeHit?

right SearchKnowledgeHit?

bool