diff --git a/.gitignore b/.gitignore index 43db866c..2a02f394 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ go.work # Env .env + +knowledge/ \ No newline at end of file diff --git a/pkg/cmd/askdir.go b/pkg/cmd/askdir.go index 0aa79c2d..f279515e 100644 --- a/pkg/cmd/askdir.go +++ b/pkg/cmd/askdir.go @@ -46,7 +46,6 @@ func (s *ClientAskDir) Run(cmd *cobra.Command, args []string) error { } if s.FlowsFile != "" { - abspath, err := filepath.Abs(path) if err != nil { return fmt.Errorf("failed to get absolute path from %q: %w", path, err) @@ -54,6 +53,7 @@ func (s *ClientAskDir) Run(cmd *cobra.Command, args []string) error { datasetID := client.HashPath(abspath) + slog.Debug("Loading ingestion flows from config", "flows_file", s.FlowsFile, "dataset", datasetID) flowCfg, err := flowconfig.FromFile(s.FlowsFile) if err != nil { return err diff --git a/pkg/cmd/ingest.go b/pkg/cmd/ingest.go index e470d7b6..295d456f 100644 --- a/pkg/cmd/ingest.go +++ b/pkg/cmd/ingest.go @@ -48,6 +48,7 @@ func (s *ClientIngest) Run(cmd *cobra.Command, args []string) error { } if s.FlowsFile != "" { + slog.Debug("Loading ingestion flows from config", "flows_file", s.FlowsFile, "dataset", datasetID) flowCfg, err := flowconfig.FromFile(s.FlowsFile) if err != nil { return err diff --git a/pkg/flows/config/config.go b/pkg/flows/config/config.go index b6fdf8df..54bea89a 100644 --- a/pkg/flows/config/config.go +++ b/pkg/flows/config/config.go @@ -6,6 +6,7 @@ import ( "github.com/gptscript-ai/knowledge/pkg/datastore/documentloader" "github.com/gptscript-ai/knowledge/pkg/datastore/textsplitter" "github.com/gptscript-ai/knowledge/pkg/flows" + "log/slog" "os" "sigs.k8s.io/yaml" "strings" @@ -159,7 +160,9 @@ func (i *IngestionFlowConfig) AsIngestionFlow() (*flows.IngestionFlow, error) { func (f *FlowConfig) ForDataset(name string) (*FlowConfigEntry, error) { flowref, ok := f.Datasets[name] if ok { + slog.Debug("Flow assigned to dataset", "dataset", name, "flow", flowref) return f.GetFlow(flowref) } + slog.Debug("No flow found for dataset - using default", "dataset", name) return f.GetDefaultFlowConfigEntry() }