Documentation
¶
Index ¶
- func ValidateDocument(path string) error
- type Client
- func (c *Client) CreateCollection(name, description string) (string, error)
- func (c *Client) DeleteCollection(collectionID string) error
- func (c *Client) ListCollections() ([]Collection, error)
- func (c *Client) UploadDocument(collectionID, name string, data []byte, contentType string) (string, error)
- type Collection
- type CollectionsError
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDocument ¶
ValidateDocument checks if a document is valid for upload
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles xAI Collections Management API operations
func (*Client) CreateCollection ¶
CreateCollection creates a new collection
func (*Client) DeleteCollection ¶
DeleteCollection deletes a collection
func (*Client) ListCollections ¶
func (c *Client) ListCollections() ([]Collection, error)
ListCollections lists all collections
type Collection ¶
type Collection struct {
ID string `json:"collection_id"`
Name string `json:"collection_name"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
DocumentCount int `json:"documents_count,omitempty"`
TotalFileSize string `json:"total_file_size,omitempty"`
}
Collection represents an xAI collection
type CollectionsError ¶
CollectionsError represents an API error
func (*CollectionsError) Error ¶
func (e *CollectionsError) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides high-level collections management
func NewManager ¶
NewManager creates a new collections manager
func (*Manager) DisableCollection ¶
DisableCollection removes a collection from the active set
func (*Manager) EnableCollection ¶
EnableCollection adds a collection to the active set
func (*Manager) GetActiveCollectionIDs ¶
GetActiveCollectionIDs returns a map of active collection IDs for quick lookup
func (*Manager) ListCollections ¶
func (m *Manager) ListCollections() ([]Collection, error)
ListCollections fetches all collections from the API
func (*Manager) SaveConfig ¶
SaveConfig saves the collections settings to the file the config was loaded from (the active named profile, or config.json); see config.SaveCollections.