Skip to content

Commit

Permalink
enhance: add knowledgeSetName to indexed fields for knowledge files
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Jan 10, 2025
1 parent 887725f commit 6db580c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
github.com/mhale/smtpd v0.8.3
github.com/oauth2-proxy/oauth2-proxy/v7 v7.0.0-00010101000000-000000000000
github.com/obot-platform/kinm v0.0.0-20250108202210-e415532dacd6
github.com/obot-platform/kinm v0.0.0-20250110010105-a251de68a999
github.com/obot-platform/nah v0.0.0-20241217120500-e9169e4a999f
github.com/obot-platform/namegenerator v0.0.0-20241217121223-fc58bdb7dca2
github.com/obot-platform/obot/apiclient v0.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25 h1:9bCMuD3TcnjeqjPT2gSlha4asp8NvgcFRYExCaikCxk=
github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25/go.mod h1:eDjgYHYDJbPLBLsyZ6qRaugP0mX8vePOhZ5id1fdzJw=
github.com/obot-platform/kinm v0.0.0-20250108202210-e415532dacd6 h1:HG5ccJmHE6MTlCwHc5saau1eiN02Az4ZhS8T1ENY43M=
github.com/obot-platform/kinm v0.0.0-20250108202210-e415532dacd6/go.mod h1:RzrH0geIlbiTHDGZ8bpCk5k1hwdU9uu3l4zJn9n0pZU=
github.com/obot-platform/kinm v0.0.0-20250110010105-a251de68a999 h1:GyfmK8VCgbUZ4XjL0/90NbkNkV+AtIVR01y9Dc4Aqvs=
github.com/obot-platform/kinm v0.0.0-20250110010105-a251de68a999/go.mod h1:RzrH0geIlbiTHDGZ8bpCk5k1hwdU9uu3l4zJn9n0pZU=
github.com/obot-platform/nah v0.0.0-20241217120500-e9169e4a999f h1:yyexIHgaPtNrfaPLxDx+xbnibJTKKJK05jDDlIqXC04=
github.com/obot-platform/nah v0.0.0-20241217120500-e9169e4a999f/go.mod h1:KG1jLO9FeYvCPGI0iDqe5oqDqOFLd3/dt/iwuMianmI=
github.com/obot-platform/namegenerator v0.0.0-20241217121223-fc58bdb7dca2 h1:jiyBM/TYxU6UNVS9ff8Y8n55DOKDYohKkIZjfHpjfTY=
Expand Down
10 changes: 8 additions & 2 deletions pkg/storage/apis/obot.obot.ai/v1/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import (
"crypto/sha256"
"fmt"

types2 "github.com/obot-platform/kinm/pkg/types"
"github.com/obot-platform/nah/pkg/fields"
"github.com/obot-platform/obot/apiclient/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var (
_ fields.Fields = (*KnowledgeFile)(nil)
_ DeleteRefs = (*KnowledgeFile)(nil)
_ fields.Fields = (*KnowledgeFile)(nil)
_ DeleteRefs = (*KnowledgeFile)(nil)
_ types2.FieldsIndexer = (*KnowledgeFile)(nil)
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -78,6 +80,10 @@ func (*KnowledgeFile) FieldNames() []string {
return []string{"spec.knowledgeSourceName", "spec.knowledgeSetName"}
}

func (*KnowledgeFile) IndexFields() []string {
return []string{"spec.knowledgeSetName"}
}

type KnowledgeFileSpec struct {
KnowledgeSetName string `json:"knowledgeSetName,omitempty"`
KnowledgeSourceName string `json:"knowledgeSourceName,omitempty"`
Expand Down

0 comments on commit 6db580c

Please sign in to comment.