Documentation
¶
Overview ¶
Package aitime provides the time parsing service interface for AI agents. This interface is consumed by Team B (Assistant+Schedule).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTimeService ¶
type MockTimeService struct {
// FixedNow can be set to use a fixed "now" for testing
FixedNow *time.Time
}
MockTimeService is a mock implementation of TimeService for testing.
func NewMockTimeService ¶
func NewMockTimeService() *MockTimeService
NewMockTimeService creates a new MockTimeService.
func (*MockTimeService) Normalize ¶
func (m *MockTimeService) Normalize(ctx context.Context, input string, timezone string) (time.Time, error)
Normalize standardizes time expressions.
func (*MockTimeService) ParseNaturalTime ¶
func (m *MockTimeService) ParseNaturalTime(ctx context.Context, input string, reference time.Time) (TimeRange, error)
ParseNaturalTime parses natural language time expressions.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses natural language time expressions.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements TimeService with rule-based parsing.
func NewService ¶
NewService creates a new time service.
type TimeService ¶
type TimeService interface {
// Normalize standardizes time expressions.
// Supports: "明天3点", "下午三点", "2026-1-28", "15:00"
// Returns: standardized time.Time
Normalize(ctx context.Context, input string, timezone string) (time.Time, error)
// ParseNaturalTime parses natural language time expressions.
// reference: reference time point (usually current time)
// Returns: time range
ParseNaturalTime(ctx context.Context, input string, reference time.Time) (TimeRange, error)
}
TimeService defines the time parsing service interface. Consumers: Team B (Assistant+Schedule)
Click to show internal directories.
Click to hide internal directories.