requestctx

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConversationIDKey = conversationIDKey("conversationID")
View Source
var ModelMessageIDKey = modelMessageIDKey("modelMessageID")
View Source
var ToolMessageIDKey = toolMessageIDKey("toolMessageID")

Functions

func CleanupTurn

func CleanupTurn(turnID string)

func ConversationIDFromContext

func ConversationIDFromContext(ctx context.Context) string

func ModelMessageIDFromContext

func ModelMessageIDFromContext(ctx context.Context) string

func RequestModeFromContext

func RequestModeFromContext(ctx context.Context) string

func SetTurnModelMessageID

func SetTurnModelMessageID(turnID, msgID string)

func SetTurnTrace

func SetTurnTrace(turnID, traceID string)

func ToolMessageIDFromContext

func ToolMessageIDFromContext(ctx context.Context) string

func TurnModelMessageID

func TurnModelMessageID(turnID string) string

func TurnTrace

func TurnTrace(turnID string) string

func WithConversationID

func WithConversationID(ctx context.Context, conversationID string) context.Context

func WithModelCompletionMeta

func WithModelCompletionMeta(ctx context.Context, meta ModelCompletionMeta) context.Context

func WithModelMessageID

func WithModelMessageID(ctx context.Context, messageID string) context.Context

func WithRequestMode

func WithRequestMode(ctx context.Context, mode string) context.Context

func WithRunMeta

func WithRunMeta(ctx context.Context, meta RunMeta) context.Context

func WithToolMessageID

func WithToolMessageID(ctx context.Context, messageID string) context.Context

func WithTurnMeta

func WithTurnMeta(ctx context.Context, meta TurnMeta) context.Context

Types

type ModelCompletionMeta

type ModelCompletionMeta struct {
	Content       string
	Preamble      string
	FinalResponse bool
	FinishReason  string
}

func ModelCompletionMetaFromContext

func ModelCompletionMetaFromContext(ctx context.Context) (ModelCompletionMeta, bool)

type RunMeta

type RunMeta struct {
	RunID     string
	Iteration int
}

RunMeta captures the active persisted run identity and loop iteration.

func RunMetaFromContext

func RunMetaFromContext(ctx context.Context) (RunMeta, bool)

type TurnMeta

type TurnMeta struct {
	TurnID          string
	Assistant       string
	ConversationID  string
	ParentMessageID string
}

TurnMeta captures minimal per-turn context for downstream persistence.

func TurnMetaFromContext

func TurnMetaFromContext(ctx context.Context) (TurnMeta, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL