Skip to content

IRunScoreStore

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The store for run and message scores (RunScore).

public interface IRunScoreStore

Not added as a member to IRunStore: a score follows a different lifecycle (written rarely, whereas IRunStore is on the hot path written on every run), and a separate interface fits better with the rule that every extension point must be replaceable.

DeleteAsync(string, Guid, CancellationToken)

Section titled “ DeleteAsync(string, Guid, CancellationToken)”

Deletes a score.

ValueTask<bool> DeleteAsync(string tenantId, Guid scoreId, CancellationToken cancellationToken = default)

tenantId string

The tenant.

scoreId Guid

The score identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<bool>

true if deleted; false if no such score exists.

ListAsync(string, Guid, CancellationToken)

Section titled “ ListAsync(string, Guid, CancellationToken)”

Lists all of a run’s scores.

ValueTask<IReadOnlyList<RunScore>> ListAsync(string tenantId, Guid runId, CancellationToken cancellationToken = default)

tenantId string

The tenant.

runId Guid

The run identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<RunScore>>

The scores. No order is guaranteed.

Adds or updates a score.

ValueTask<RunScore> UpsertAsync(RunScore score, CancellationToken cancellationToken = default)

score RunScore

The score. If RunScore.Id is empty (Guid.Empty), a new identifier is generated.

cancellationToken CancellationToken

The cancellation token.

ValueTask<RunScore>

The score written.

When the same author (RunScore.Author) scores the same target (a run or a message) a second time, the row is updated, not opened as a new row. If RunScore.Author is empty, this rule does not apply; every call writes a new row.