config

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvConfigKey          = "DEFAULT_CONFIG"
	EnvConfigDefaultValue = "arcadia-config"
)

Variables

View Source
var (
	ErrNoConfigEnv         = fmt.Errorf("env:%s is not found", EnvConfigKey)
	ErrNoConfig            = fmt.Errorf("config in configmap is empty")
	ErrNoConfigGateway     = fmt.Errorf("config Gateway in configmap is not found")
	ErrNoConfigMinIO       = fmt.Errorf("config MinIO in comfigmap is not found")
	ErrNoConfigEmbedder    = fmt.Errorf("config Embedder in comfigmap is not found")
	ErrNoConfigVectorstore = fmt.Errorf("config Vectorstore in comfigmap is not found")
	ErrNoConfigStreamlit   = fmt.Errorf("config Streamlit in comfigmap is not found")
	ErrNoConfigRayClusters = fmt.Errorf("config RayClusters in comfigmap is not found")
	ErrNoConfigRerank      = fmt.Errorf("config rerankDefaultEndpoint in comfigmap is not found")
)

Functions

func GetDefaultRerank added in v0.2.1

func GetEmbedder added in v0.2.0

GetEmbedder get the default embedder from config

func GetRelationalDatasource added in v0.2.0

func GetRelationalDatasource(ctx context.Context, c client.Client) (*arcadiav1alpha1.Datasource, error)

func GetSystemDatasource

func GetSystemDatasource(ctx context.Context, c client.Client) (*arcadiav1alpha1.Datasource, error)

func GetVectorStore

GetVectorStore get the default vector store from config

Types

type Config

type Config struct {
	// SystemDatasource specifies the built-in datasource for Arcadia to host data files and model files
	SystemDatasource arcadiav1alpha1.TypedObjectReference `json:"systemDatasource,omitempty"`

	// RelationalDatasource specifies the built-in datasource(common:postgres) for Arcadia to host relational data
	RelationalDatasource arcadiav1alpha1.TypedObjectReference `json:"relationalDatasource,omitempty"`

	// Gateway to access LLM api services
	Gateway *Gateway `json:"gateway,omitempty"`

	// Embedder specifies the default embedder for Arcadia to generate embeddings
	Embedder *arcadiav1alpha1.TypedObjectReference `json:"embedder,omitempty"`

	// VectorStore to access VectorStore api services
	VectorStore *arcadiav1alpha1.TypedObjectReference `json:"vectorStore,omitempty"`

	// Streamlit to get the Streamlit configuration
	Streamlit *Streamlit `json:"streamlit,omitempty"`

	// Resource pool managed by Ray cluster
	RayClusters []RayCluster `json:"rayClusters,omitempty"`

	// the default rerank model
	Rerank *arcadiav1alpha1.TypedObjectReference `json:"rerank,omitempty"`
}

Config defines the configuration for the Arcadia controller

func GetConfig

func GetConfig(ctx context.Context, c client.Client) (config *Config, err error)

type Gateway

type Gateway struct {
	ExternalAPIServer string `json:"externalApiServer,omitempty"`
	APIServer         string `json:"apiServer,omitempty"`
	Controller        string `json:"controller,omitempty"`
}

Gateway defines the way to access llm apis host by Arcadia

func GetGateway

func GetGateway(ctx context.Context, c client.Client) (*Gateway, error)

type RayCluster added in v0.2.0

type RayCluster struct {
	// Name of this ray cluster
	Name string `json:"name,omitempty"`
	// Address of ray head address
	HeadAddress string `json:"headAddress,omitempty"`
	// Management dashboard of ray cluster, optional to configure it using ingress
	DashboardHost string `json:"dashboardHost,omitempty"`
	// Overwrite the python version in the woker
	PythonVersion string `json:"pythonVersion,omitempty"`
}

RayCluster defines configuration of existing ray cluster that manage GPU resources

func GetRayClusters added in v0.2.0

func GetRayClusters(ctx context.Context, c client.Client) ([]RayCluster, error)

Get the ray cluster that can be used a resource pool

type Streamlit

type Streamlit struct {
	Image            string `json:"image"`
	IngressClassName string `json:"ingressClassName"`
	Host             string `json:"host"`
	ContextPath      string `json:"contextPath"`
}

Streamlit defines the configuration of streamlit app

func GetStreamlit

func GetStreamlit(ctx context.Context, c client.Client) (*Streamlit, error)

Get the configuration of streamlit tool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL