44 lines
1.4 KiB
Go
44 lines
1.4 KiB
Go
package generation
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitea.maximumdirect.net/eric/promptkit/internal/domain"
|
|
"gitea.maximumdirect.net/eric/promptkit/internal/llm"
|
|
)
|
|
|
|
// GenerationEvidence contains invocation-local request evidence without raw
|
|
// provider bodies, headers, credentials, or generated content.
|
|
type GenerationEvidence struct {
|
|
// InitialEndpoint is the frozen built-in request URL, if prepared.
|
|
// Injected generation leaves it unknown.
|
|
InitialEndpoint string
|
|
Attempts []AttemptEvidence
|
|
RetryDelays []time.Duration
|
|
Usage domain.ObservedTokenUsage
|
|
}
|
|
|
|
// AttemptEvidence describes one capacity acquisition and any dispatch it
|
|
// reached. Generated content remains on the separate response return value.
|
|
type AttemptEvidence struct {
|
|
StartedAt time.Time
|
|
Dispatched bool
|
|
ResponseReceived bool
|
|
HTTP llm.HTTPExecutionEvidence
|
|
CapacityWait time.Duration
|
|
RequestDuration time.Duration
|
|
Failure domain.ExecutionFailureKind
|
|
Usage domain.ObservedTokenUsage
|
|
ResponseDecoded bool
|
|
GenerationCompleted bool
|
|
StructuredOutputRequested *bool
|
|
}
|
|
|
|
func cloneHTTPEvidence(evidence llm.HTTPExecutionEvidence) llm.HTTPExecutionEvidence {
|
|
if evidence.HTTPStatus != nil {
|
|
status := *evidence.HTTPStatus
|
|
evidence.HTTPStatus = &status
|
|
}
|
|
return evidence
|
|
}
|