Documentation
¶
Index ¶
- type NarrationPairing
- type Service
- func (s *Service) Finalize(ctx context.Context, parent runtimerequestctx.TurnMeta, ...) error
- func (s *Service) PublishFinal(ctx context.Context, parent runtimerequestctx.TurnMeta, ...) (string, error)
- func (s *Service) Start(ctx context.Context, parent runtimerequestctx.TurnMeta, ...) (string, error)
- func (s *Service) StartNarration(ctx context.Context, parent runtimerequestctx.TurnMeta, ...) (string, error)
- func (s *Service) Update(ctx context.Context, parent runtimerequestctx.TurnMeta, ...) error
- func (s *Service) UpdateNarration(ctx context.Context, parent runtimerequestctx.TurnMeta, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NarrationPairing ¶
type NarrationPairing struct {
// contains filtered or unexported fields
}
NarrationPairing keeps the parked-status-call -> interim assistant message mapping used by backend-authored assistant_preamble updates. Multiple parked calls in the same parent turn may resolve to the same reused interim assistant message id when the turn already owns a transient narration slot.
func NewNarrationPairing ¶
func NewNarrationPairing(svc *Service) *NarrationPairing
func (*NarrationPairing) MessageID ¶
func (p *NarrationPairing) MessageID(parkedToolCallID string) string
func (*NarrationPairing) Release ¶
func (p *NarrationPairing) Release(parkedToolCallID string)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service publishes tool-run status messages into the parent conversation turn. It supports start/update/finalize lifecycle with minimal, consistent fields.
func (*Service) Finalize ¶
func (s *Service) Finalize(ctx context.Context, parent runtimerequestctx.TurnMeta, messageID, status, preview string) error
Finalize clears interim, sets final status, and writes an optional preview content. status should be one of running|succeeded|failed|canceled|auth-required.
func (*Service) PublishFinal ¶
func (s *Service) PublishFinal(ctx context.Context, parent runtimerequestctx.TurnMeta, toolName, role, actor, mode, linkedConversationID, status, preview string) (string, error)
PublishFinal creates a final assistant status message in the parent turn. It is used for detached/background completions where no interim status row exists yet but the parent conversation still needs a surfaced result.
func (*Service) Start ¶
func (s *Service) Start(ctx context.Context, parent runtimerequestctx.TurnMeta, toolName, role, actor, mode string) (string, error)
Start creates an interim status message under the parent turn and returns its id. role defaults to "assistant"; mode defaults to "exec"; actor defaults to "tool".
func (*Service) StartNarration ¶
func (s *Service) StartNarration(ctx context.Context, parent runtimerequestctx.TurnMeta, toolName, role, actor, mode, preamble string) (string, error)
StartNarration creates an interim assistant message whose visible content is carried through the message preamble field. This is the backend-authored counterpart to model-authored assistant preambles and reuses the same assistant_preamble event contract.
func (*Service) Update ¶
func (s *Service) Update(ctx context.Context, parent runtimerequestctx.TurnMeta, messageID, content string) error
Update sets interim content (e.g., progress text) on the status message.
func (*Service) UpdateNarration ¶
func (s *Service) UpdateNarration(ctx context.Context, parent runtimerequestctx.TurnMeta, messageID, preamble string) error
UpdateNarration refreshes an existing interim assistant message in place using the preamble field while preserving the same assistant message id.