package service

import (
    "context"
    "github.com/cloudwego/eino/compose"
    "github.com/cloudwego/eino/schema"
    "ai_scheduler/internal/config"
    "ai_scheduler/internal/domain/llm/pipeline"
)

type IntentService struct{ run compose.Runnable[[]*schema.Message, *schema.Message] }

func NewIntentService(ctx context.Context, cfg *config.Config) (*IntentService, error) {
    r, err := pipeline.BuildIntent(ctx, cfg)
    if err != nil { return nil, err }
    return &IntentService{run: r}, nil
}

func (s *IntentService) Invoke(ctx context.Context, msgs []*schema.Message) (*schema.Message, error) {
    return s.run.Invoke(ctx, msgs)
}

