mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
83b6ee608c
- Add SetupBotContainer to ContainerLifecycle interface so containers are automatically created when a bot is created, matching the existing cleanup-on-delete behavior. - Refactor schedule tools to use bot-scoped API paths and pass identity context for proper authorization. - Introduce dedicated trigger-schedule endpoint in chat resolver with explicit schedule payload instead of reusing the generic chat path. - Generate short-lived JWT tokens for schedule trigger callbacks with resolved bot owner identity. - Validate required parameters in NewLLMClient and NewOpenAIEmbedder constructors, returning errors instead of falling back to defaults. - Add unit tests for schedule token generation and chat resolver.
20 lines
483 B
Go
20 lines
483 B
Go
package schedule
|
|
|
|
import "context"
|
|
|
|
// TriggerPayload describes the parameters passed to the chat side when a schedule triggers.
|
|
type TriggerPayload struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
Pattern string
|
|
MaxCalls *int
|
|
Command string
|
|
OwnerUserID string
|
|
}
|
|
|
|
// Triggerer 负责触发与聊天相关的调度执行。
|
|
type Triggerer interface {
|
|
TriggerSchedule(ctx context.Context, botID string, payload TriggerPayload, token string) error
|
|
}
|