config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 11 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")
	ErrSystemCliNotFound   = fmt.Errorf("systemCli is not found")
)
View Source
var (
	ErrNoGPTsConfig         = fmt.Errorf("gpts config in configmap is empty")
	ErrNoGPTsConfigCategory = fmt.Errorf("gpts config Categories in comfigmap is not found")
)

Functions

func GetDefaultRerankModel added in v0.2.2

func GetDefaultRerankModel(ctx context.Context) (*arcadiav1alpha1.TypedObjectReference, error)

GetDefaultRerankModel gets the default reranking model which is recommended by kubeagi

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) (*arcadiav1alpha1.Datasource, error)

func GetSystemDatasource

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

GetSystemDatasource get the system datasource of kubeagi

func GetSystemDatasourceOSS added in v0.2.2

func GetSystemDatasourceOSS(ctx context.Context) (*datasource.OSS, error)

func GetSystemEmbeddingSuite added in v0.2.2

func GetSystemEmbeddingSuite(ctx context.Context) (*arcadiav1alpha1.Embedder, *arcadiav1alpha1.VectorStore, error)

GetSystemEmbeddingSuite returns the embedder and vectorstore which are built-in in system config Embedder and vectorstore are both required when generating a new embedding.That's why we call it a `EmbeddingSuit`

func GetVectorStore

GetVectorStore get the default vector store from config

func InitSystemClient added in v0.2.2

func InitSystemClient(cli client.Client)

Types

type Category added in v0.2.2

type Category struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	NameEn string `json:"nameEn,omitempty"`
}

Category in gpt store

func GetGPTsCategories added in v0.2.2

func GetGPTsCategories(ctx context.Context, c client.Client) (categories []Category, err error)

GetGPTsCategories gets the gpts Categories

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"`

	// EmbeddingSuite here represents the system embedding service provided by the system
	EmbeddingSuite

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

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

	// Streamlit to get the Streamlit configuration
	// Deprecated: this field no longer maintained
	Streamlit *Streamlit `json:"streamlit,omitempty"`
}

Config defines the configuration for the Arcadia controller

type EmbeddingSuite added in v0.2.2

type EmbeddingSuite struct {
	// 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"`
}

EmbeddingSuite contains everything required to provide embedding service

type GPTsConfig added in v0.2.2

type GPTsConfig struct {
	// URL is the url of gpt store
	URL string `json:"url,omitempty"`
	// PublicNamespace is the namespace which all gpt-releated resources are public
	PublicNamespace string     `json:"public_namespace,omitempty"`
	Categories      []Category `json:"categories,omitempty"`
}

GPTsConfig is the configurations for GPT Store

func GetGPTsConfig added in v0.2.2

func GetGPTsConfig(ctx context.Context, c client.Client) (gptsConfig *GPTsConfig, err error)

GetGPTsConfig gets the gpts configurations

type Gateway

type Gateway struct {
	// ExternalAPIServer is the api(LLM/Embedding) server address that can be accessed from internet
	ExternalAPIServer string `json:"externalApiServer,omitempty"`
	// APIServer is api(LLM/Embedding) server which can be accessed within platform
	APIServer string `json:"apiServer,omitempty"`
	// Controller is the server address which is responsible for llm/embedding service registration
	Controller string `json:"controller,omitempty"`
}

Gateway defines the way to access llm apis host by Arcadia

func GetGateway

func GetGateway(ctx context.Context) (*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"`
	// Ray cluster version
	RayVersion string `json:"rayVersion,omitempty"`
}

RayCluster defines configuration of existing ray cluster that manage GPU resources

func DefaultRayCluster added in v0.2.2

func DefaultRayCluster() RayCluster

DefaultRayCluster which can be used for vllm worker as local ray cluster which can only utilize single node gpus

func GetRayClusters added in v0.2.0

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

Get the ray cluster that can be used a resource pool

func (RayCluster) GetPythonVersion added in v0.2.2

func (rayCluster RayCluster) GetPythonVersion() string

GetPythonVersion in ray cluster

func (RayCluster) GetRayVersion added in v0.2.2

func (rayCluster RayCluster) GetRayVersion() string

GetRayVersion in ray cluster

func (RayCluster) String added in v0.2.2

func (rayCluster RayCluster) String() string

String format raycluster into string

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 Deprecated: no longer maintained

func GetStreamlit

func GetStreamlit(ctx context.Context) (*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