Skip to content

Commit

Permalink
Merge pull request #594 from helixml/fix/knowledge-in-crds
Browse files Browse the repository at this point in the history
add basic knowledge fields to crd types
  • Loading branch information
lukemarsden authored Jan 22, 2025
2 parents b26897e + 1e1acd4 commit ae61de5
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 8 deletions.
43 changes: 40 additions & 3 deletions operator/api/v1alpha1/aiapp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,48 @@ type TestStep struct {
ExpectedOutput string `json:"expected_output"`
}

// RAGSettings contains settings for RAG processing
type RAGSettings struct {
Threshold int `json:"threshold"`
ResultsCount int `json:"results_count"`
ChunkSize int `json:"chunk_size"`
ChunkOverflow int `json:"chunk_overflow"`
DisableChunking bool `json:"disable_chunking"`
DisableDownloading bool `json:"disable_downloading"`
}

// FilestoreSource represents filestore configuration
type FilestoreSource struct {
Path string `json:"path"`
}

// WebCrawlerConfig contains web crawler settings
type WebCrawlerConfig struct {
Enabled bool `json:"enabled"`
MaxDepth int `json:"max_depth"`
MaxPages int `json:"max_pages"`
Readability bool `json:"readability"`
}

// WebSource represents web source configuration
type WebSource struct {
URLs []string `json:"urls"`
Crawler WebCrawlerConfig `json:"crawler"`
}

// KnowledgeSource contains source configuration for knowledge
type KnowledgeSource struct {
Filestore FilestoreSource `json:"filestore"`
Web WebSource `json:"web"`
}

// AssistantKnowledge represents knowledge configuration for an assistant
// Note: This type wasn't in the original types.go, but was referenced.
// You'll need to define its structure based on your requirements
type AssistantKnowledge struct {
// Add fields as needed
Name string `json:"name"`
RAGSettings RAGSettings `json:"rag_settings"`
Source KnowledgeSource `json:"source"`
RefreshEnabled bool `json:"refresh_enabled"`
RefreshSchedule string `json:"refresh_schedule,omitempty"`
}

// ToolApiConfig represents API tool configuration
Expand Down
89 changes: 88 additions & 1 deletion operator/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 83 additions & 4 deletions operator/config/crd/bases/app.aispec.org_aiapps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,89 @@ spec:
knowledge:
description: Knowledge available to the assistant
items:
description: |-
AssistantKnowledge represents knowledge configuration for an assistant
Note: This type wasn't in the original types.go, but was referenced.
You'll need to define its structure based on your requirements
description: AssistantKnowledge represents knowledge configuration
for an assistant
properties:
name:
type: string
rag_settings:
description: RAGSettings contains settings for RAG processing
properties:
chunk_overflow:
type: integer
chunk_size:
type: integer
disable_chunking:
type: boolean
disable_downloading:
type: boolean
results_count:
type: integer
threshold:
type: integer
required:
- chunk_overflow
- chunk_size
- disable_chunking
- disable_downloading
- results_count
- threshold
type: object
refresh_enabled:
type: boolean
refresh_schedule:
type: string
source:
description: KnowledgeSource contains source configuration
for knowledge
properties:
filestore:
description: FilestoreSource represents filestore
configuration
properties:
path:
type: string
required:
- path
type: object
web:
description: WebSource represents web source configuration
properties:
crawler:
description: WebCrawlerConfig contains web crawler
settings
properties:
enabled:
type: boolean
max_depth:
type: integer
max_pages:
type: integer
readability:
type: boolean
required:
- enabled
- max_depth
- max_pages
- readability
type: object
urls:
items:
type: string
type: array
required:
- crawler
- urls
type: object
required:
- filestore
- web
type: object
required:
- name
- rag_settings
- refresh_enabled
- source
type: object
type: array
lora_id:
Expand Down

0 comments on commit ae61de5

Please sign in to comment.