temporal

package
v0.0.0-...-7de319a Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityCheckShouldRespond = "CheckShouldRespondActivity"

	ActivitySendTyping = "SendTypingActivity"

	ActivityPersistUserMsg = "PersistUserMessageActivity"

	ActivityRoute = "RouteActivity"

	ActivityLLMTurn = "LLMTurnActivity"

	ActivityExecuteTool = "ExecuteToolActivity"

	ActivityPostMessage = "PostMessageActivity"

	ActivityPersistAssistant = "PersistAssistantMessageActivity"

	ActivityMaybeSummarize = "MaybeSummarizeActivity"
)
View Source
const MaxToolIterations = 8
View Source
const SlackReplyMetadataEventType = "agent_gogo.reply"

SlackReplyMetadataEventType marks assistant-authored messages so inbound event handlers can ignore them without user-ID-based loop guards.

Variables

This section is empty.

Functions

func ProcessMessageWorkflow

func ProcessMessageWorkflow(ctx workflow.Context, input MessageInput) error

Types

type Activities

type Activities struct {
	SlackClient *slack.Client

	BotUserID string // Slack user ID of the account running the bot

	Store *memory.Store

	OpenRouter *llm.OpenRouter

	Router *router.Config

	Judge *router.Judge

	MCPHost *mcp.Host

	SystemPrompt string

	MaxTurns int

	SummarizeAt int

	SummarizeFold int

	SummarizerModel string // typically equal to JudgeModel

}

func (*Activities) CheckShouldRespondActivity

func (a *Activities) CheckShouldRespondActivity(ctx context.Context) (bool, error)

func (*Activities) ExecuteToolActivity

func (a *Activities) ExecuteToolActivity(ctx context.Context, in ExecuteToolInput) (ExecuteToolOutput, error)

func (*Activities) LLMTurnActivity

func (a *Activities) LLMTurnActivity(ctx context.Context, in LLMTurnInput) (LLMTurnOutput, error)

func (*Activities) MaybeSummarizeActivity

func (a *Activities) MaybeSummarizeActivity(ctx context.Context, convID string) error

func (*Activities) PersistAssistantMessageActivity

func (a *Activities) PersistAssistantMessageActivity(ctx context.Context, in PersistAssistantInput) error

func (*Activities) PersistUserMessageActivity

func (a *Activities) PersistUserMessageActivity(ctx context.Context, input MessageInput) error

func (*Activities) PostMessageActivity

func (a *Activities) PostMessageActivity(ctx context.Context, in PostMessageInput) error

func (*Activities) RouteActivity

func (a *Activities) RouteActivity(ctx context.Context, in RouteInput) (RouteResult, error)

func (*Activities) SendTypingActivity

func (a *Activities) SendTypingActivity(ctx context.Context, channelID string) error

type ConversationMessage

type ConversationMessage struct {
	Role string

	Content string

	ToolCalls []ConversationToolCall

	ToolCallID string
}

type ConversationToolCall

type ConversationToolCall struct {
	ID string

	Name string

	Arguments json.RawMessage
}

type ExecuteToolInput

type ExecuteToolInput struct {
	ToolName string

	Arguments json.RawMessage
}

type ExecuteToolOutput

type ExecuteToolOutput struct {
	Result string

	IsError bool
}

type LLMTurnInput

type LLMTurnInput struct {
	ConversationID string

	Provider string

	Model string

	AllowedTools []string

	IsFirstTurn bool

	Conversation []ConversationMessage

	UserID string // Slack user_id

	Category string // routed category, e.g. "code"

	Iteration int // tool-loop iteration counter, 0-based

}

type LLMTurnOutput

type LLMTurnOutput struct {
	Text string

	ToolCalls []ConversationToolCall

	StopReason string

	ConversationAfter []ConversationMessage

	Provider string

	Model string
}

type MessageInput

type MessageInput struct {
	ChannelID string

	UserID string

	Text string

	Timestamp string

	ThreadTS string

	IsMention bool
}

type PersistAssistantInput

type PersistAssistantInput struct {
	ConversationID string

	Content string

	Provider string

	Model string
}

type PostMessageInput

type PostMessageInput struct {
	ChannelID string

	Text string

	ThreadTS string
}

type RouteInput

type RouteInput struct {
	UserMessage string

	ConversationID string // becomes Langfuse session_id

	UserID string // becomes Langfuse user_id

}

type RouteResult

type RouteResult struct {
	Category string

	Provider string

	Model string

	Reason string

	Tools []string // tool names this route is allowed to invoke

}

Jump to

Keyboard shortcuts

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