-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Abirdcfly <[email protected]>
- Loading branch information
Showing
35 changed files
with
9,744 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
Copyright 2023 KubeAGI. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// ApplicationSpec defines the desired state of Application | ||
type ApplicationSpec struct { | ||
Nodes []Node `json:"nodes,omitempty"` | ||
Connections []Connection `json:"connections,omitempty"` | ||
} | ||
|
||
type Node struct { | ||
Name string `json:"name"` | ||
// LLMRef is a reference to a llm. | ||
// +optional | ||
LLMRef *TypedObjectReference `json:"llmRef,omitempty"` | ||
|
||
// LLMSpec is a specification of a llm. | ||
// +optional | ||
LLMSpec *LLMSpec `json:"llmSpec,omitempty"` | ||
|
||
// LLMRef is a reference to a llm. | ||
// +optional | ||
EmbedderRef *TypedObjectReference `json:"embedderRef,omitempty"` | ||
|
||
// EmbedderSpec is a specification of a Embedder. | ||
// +optional | ||
EmbedderSpec *EmbedderSpec `json:"EmbedderSpec,omitempty"` | ||
|
||
// LLMRef is a reference to a llm. | ||
// +optional | ||
VectorStoreRef *TypedObjectReference `json:"vectorStoreRef,omitempty"` | ||
|
||
// VectorStoreSpec is a specification of a VectorStore. | ||
// +optional | ||
VectorStoreSpec *VectorStoreSpec `json:"VectorStoreSpec,omitempty"` | ||
|
||
// Chain is a reference to a chain. | ||
// +optional | ||
Chain Chain `json:"chain,omitempty"` | ||
} | ||
|
||
type Connection struct { | ||
SourceNode string `json:"sourceNode"` | ||
TargetNode string `json:"targetNode"` | ||
} | ||
|
||
type Chain struct { | ||
LLMChain LLMChain `json:"llmChain,omitempty"` | ||
} | ||
|
||
type LLMChain struct { | ||
} | ||
|
||
// ApplicationStatus defines the observed state of Application | ||
type ApplicationStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// Application is the Schema for the applications API | ||
type Application struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ApplicationSpec `json:"spec,omitempty"` | ||
Status ApplicationStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// ApplicationList contains a list of Application | ||
type ApplicationList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Application `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Application{}, &ApplicationList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
Copyright 2023 KubeAGI. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package vectorstore | ||
|
||
import ( | ||
"github.com/kubeagi/arcadia/api/v1alpha1" | ||
appsv1 "k8s.io/api/apps/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// ChromaSpec defines the desired state of Chroma | ||
type ChromaSpec struct { | ||
v1alpha1.CommonSpec `json:",inline"` | ||
// Endpoint represents the endpoint used to communicate with the VectorStore. | ||
ProxyEndpoint v1alpha1.Endpoint `json:"proxyEndpoint"` | ||
// +optional | ||
CollactionName string `json:"collactionName,omitempty"` | ||
// +optional | ||
StorePVC string `json:"storePVC,omitempty"` | ||
// +optional | ||
Image string `json:"image,omitempty"` | ||
// +optional | ||
Deploy *appsv1.DeploymentSpec `json:"deploy,omitempty"` | ||
// +optional | ||
Service *corev1.ServiceSpec `json:"service,omitempty"` | ||
} | ||
|
||
// ChromaStatus defines the observed state of Chroma | ||
type ChromaStatus struct { | ||
// ConditionedStatus is the current status | ||
// +optional | ||
v1alpha1.ConditionedStatus `json:",inline"` | ||
|
||
// ObservedGeneration is the latest generation observed by the controller. | ||
// +optional | ||
ObservedGeneration int64 `json:"observedGeneration,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// Chroma is the Schema for the Chroma API | ||
type Chroma struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ChromaSpec `json:"spec,omitempty"` | ||
Status ChromaStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// ChromaList contains a list of Chroma | ||
type ChromaList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Chroma `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Chroma{}, &ChromaList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
Copyright 2023 KubeAGI. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package v1alpha1 contains API Schema definitions for the arcadia v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=arcadia.kubeagi.k8s.com.cn | ||
package vectorstore | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "vectorstore.arcadia.kubeagi.k8s.com.cn", Version: "v1alpha1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
Oops, something went wrong.