File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ //go:build cgo
2+
13package treesitter
24
35import (
Original file line number Diff line number Diff line change 1+ //go:build !cgo
2+
3+ package treesitter
4+
5+ import (
6+ "errors"
7+
8+ "github.com/docker/docker-agent/pkg/rag/chunk"
9+ )
10+
11+ // DocumentProcessor implements chunk.DocumentProcessor and always returns an
12+ // error when the application is built without CGO and uses RAG. For applications
13+ // that do not use RAG, this allows building without any CGO requirement.
14+ type DocumentProcessor struct {}
15+
16+ // NewDocumentProcessor creates a new DocumentProcessor.
17+ func NewDocumentProcessor (_ , _ int , _ bool ) * DocumentProcessor {
18+ return & DocumentProcessor {}
19+ }
20+
21+ // Process implements chunk.DocumentProcessor.
22+ func (p * DocumentProcessor ) Process (_ string , _ []byte ) ([]chunk.Chunk , error ) {
23+ return nil , errors .New ("rag/treesitter: document processor must be built with CGO_ENABLED=1" )
24+ }
You can’t perform that action at this time.
0 commit comments