mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-03-19 03:23:47 +00:00
Compare commits
7 Commits
feat/examp
...
feat/bedro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d5c08c615 | ||
|
|
83672fa768 | ||
|
|
990d723909 | ||
|
|
c506a4b441 | ||
|
|
2918556793 | ||
|
|
19abbef9a3 | ||
|
|
939e0672aa |
6
.github/workflows/build_container.yaml
vendored
6
.github/workflows/build_container.yaml
vendored
@@ -74,7 +74,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
|
||||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
|
||||
|
||||
- name: Build Docker Image
|
||||
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
|
||||
@@ -96,7 +96,7 @@ jobs:
|
||||
outputs: type=docker,dest=/tmp/${{ env.IMAGE_NAME }}-image.tar
|
||||
|
||||
- name: Upload image as artifact
|
||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
|
||||
with:
|
||||
name: ${{ env.IMAGE_NAME }}-image.tar
|
||||
path: /tmp/${{ env.IMAGE_NAME }}-image.tar
|
||||
@@ -126,7 +126,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
|
||||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
|
||||
|
||||
- name: Build Docker Image
|
||||
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
|
||||
|
||||
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
@@ -59,7 +59,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
- name: Download Syft
|
||||
@@ -96,7 +96,7 @@ jobs:
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
|
||||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
|
||||
|
||||
4
.github/workflows/test.yaml
vendored
4
.github/workflows/test.yaml
vendored
@@ -18,13 +18,13 @@ jobs:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5
|
||||
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Run test
|
||||
run: go test ./... -coverprofile=coverage.txt
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5
|
||||
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
4
go.mod
4
go.mod
@@ -36,7 +36,7 @@ require (
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.5.0
|
||||
github.com/IBM/watsonx-go v1.0.1
|
||||
github.com/aws/aws-sdk-go v1.55.5
|
||||
github.com/aws/aws-sdk-go v1.55.6
|
||||
github.com/cohere-ai/cohere-go/v2 v2.12.2
|
||||
github.com/go-logr/zapr v1.3.0
|
||||
github.com/google/generative-ai-go v0.19.0
|
||||
@@ -49,6 +49,7 @@ require (
|
||||
github.com/pterm/pterm v0.12.80
|
||||
google.golang.org/api v0.210.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
sigs.k8s.io/controller-runtime v0.19.3
|
||||
sigs.k8s.io/gateway-api v1.2.1
|
||||
)
|
||||
@@ -189,7 +190,6 @@ require (
|
||||
google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a // indirect
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
knative.dev/pkg v0.0.0-20241026180704-25f6002b00f3 // indirect
|
||||
mvdan.cc/sh/v3 v3.8.0 // indirect
|
||||
)
|
||||
|
||||
2
go.sum
2
go.sum
@@ -801,6 +801,8 @@ github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2z
|
||||
github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
|
||||
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
|
||||
github.com/aws/aws-sdk-go v1.55.6 h1:cSg4pvZ3m8dgYcgqB97MrcdjUmZ1BeMYKUxMMB89IPk=
|
||||
github.com/aws/aws-sdk-go v1.55.6/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
|
||||
github.com/aws/aws-sdk-go-v2 v1.32.3 h1:T0dRlFBKcdaUPGNtkBSwHZxrtis8CQU17UpNBZYd0wk=
|
||||
github.com/aws/aws-sdk-go-v2 v1.32.3/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.1 h1:oxIvOUXy8x0U3fR//0eq+RdCKimWI900+SV+10xsCBw=
|
||||
|
||||
@@ -45,8 +45,59 @@ var BEDROCKER_SUPPORTED_REGION = []string{
|
||||
}
|
||||
|
||||
const (
|
||||
ModelAI21Jamba15Large = "ai21.jamba-1-5-large-v1:0"
|
||||
ModelAI21Jamba15Mini = "ai21.jamba-1-5-mini-v1:0"
|
||||
ModelAI21JambaInstruct = "ai21.jamba-instruct-v1:0"
|
||||
ModelAmazonNovaCanvas = "amazon.nova-canvas-v1:0"
|
||||
ModelAmazonNovaLite = "amazon.nova-lite-v1:0"
|
||||
ModelAmazonNovaMicro = "amazon.nova-micro-v1:0"
|
||||
ModelAmazonNovaPro = "amazon.nova-pro-v1:0"
|
||||
ModelAmazonNovaReel = "amazon.nova-reel-v1:0"
|
||||
ModelAmazonRerank10 = "amazon.rerank-v1:0"
|
||||
ModelAmazonTitanEmbedTextV1 = "amazon.titan-embed-text-v1"
|
||||
ModelAmazonTitanImageGenV2 = "amazon.titan-image-generator-v2:0"
|
||||
ModelAmazonTitanImageGenV1 = "amazon.titan-image-generator-v1"
|
||||
ModelAmazonTitanMultimodal = "amazon.titan-embed-image-v1"
|
||||
ModelAmazonTitanEmbedTextV2 = "amazon.titan-embed-text-v2:0"
|
||||
ModelAmazonTitanTextExpress = "amazon.titan-text-express-v1"
|
||||
ModelAmazonTitanTextLite = "amazon.titan-text-lite-v1"
|
||||
ModelAmazonTitanTextPremier = "amazon.titan-text-premier-v1:0"
|
||||
ModelAnthropicClaude3Haiku = "anthropic.claude-3-haiku-20240307-v1:0"
|
||||
ModelAnthropicClaude3Opus = "anthropic.claude-3-opus-20240229-v1:0"
|
||||
ModelAnthropicClaude3Sonnet = "anthropic.claude-3-sonnet-20240229-v1:0"
|
||||
ModelAnthropicClaude35Haiku = "anthropic.claude-3-5-haiku-20241022-v1:0"
|
||||
ModelAnthropicClaudeSonnetV3_5_V2 = "anthropic.claude-3-5-sonnet-20241022-v2:0"
|
||||
ModelAnthropicClaude35Sonnet = "anthropic.claude-3-5-sonnet-20240620-v1:0"
|
||||
ModelCohereCommandLight = "cohere.command-light-text-v14"
|
||||
ModelCohereCommandRPlus = "cohere.command-r-plus-v1:0"
|
||||
ModelCohereCommandR = "cohere.command-r-v1:0"
|
||||
ModelCohereCommand = "cohere.command-text-v14"
|
||||
ModelCohereEmbedEnglish = "cohere.embed-english-v3"
|
||||
ModelCohereEmbedMultilingual = "cohere.embed-multilingual-v3"
|
||||
ModelCohereRerank35 = "cohere.rerank-v3-5:0"
|
||||
ModelLumaAIRayV2 = "luma.ray-v2:0"
|
||||
ModelMetaLlama38BInstruct = "meta.llama3-8b-instruct-v1:0"
|
||||
ModelMetaLlama370BInstruct = "meta.llama3-70b-instruct-v1:0"
|
||||
ModelMetaLlama318BInstruct = "meta.llama3-1-8b-instruct-v1:0"
|
||||
ModelMetaLlama3170BInstruct = "meta.llama3-1-70b-instruct-v1:0"
|
||||
ModelMetaLlama31405BInstruct = "meta.llama3-1-405b-instruct-v1:0"
|
||||
ModelMetaLlama321BInstruct = "meta.llama3-2-1b-instruct-v1:0"
|
||||
ModelMetaLlama323BInstruct = "meta.llama3-2-3b-instruct-v1:0"
|
||||
ModelMetaLlama3211BInstruct = "meta.llama3-2-11b-instruct-v1:0"
|
||||
ModelMetaLlama3290BInstruct = "meta.llama3-2-90b-instruct-v1:0"
|
||||
ModelMetaLlama3370BInstruct = "meta.llama3-3-70b-instruct-v1:0"
|
||||
ModelMistral7BInstruct = "mistral.mistral-7b-instruct-v0:2"
|
||||
ModelMistralLarge2402 = "mistral.mistral-large-2402-v1:0"
|
||||
ModelMistralLarge2407 = "mistral.mistral-large-2407-v1:0"
|
||||
ModelMistralSmall2402 = "mistral.mistral-small-2402-v1:0"
|
||||
ModelMistralMixtral8x7B = "mistral.mixtral-8x7b-instruct-v0:1"
|
||||
ModelStabilitySD3Large = "stability.sd3-large-v1:0"
|
||||
ModelStabilitySD35Large = "stability.sd3-5-large-v1:0"
|
||||
ModelStabilityImageCore10 = "stability.stable-image-core-v1:0"
|
||||
ModelStabilityImageCore11 = "stability.stable-image-core-v1:1"
|
||||
ModelStabilityImageUltra10 = "stability.stable-image-ultra-v1:0"
|
||||
ModelStabilityImageUltra11 = "stability.stable-image-ultra-v1:1"
|
||||
ModelAnthropicClaudeSonnetV3_5 = "anthropic.claude-3-5-sonnet-20240620-v1:0"
|
||||
ModelAnthropicClaudeSonnetV3_5_V2 = "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
|
||||
ModelAnthropicClaudeV2 = "anthropic.claude-v2"
|
||||
ModelAnthropicClaudeV1 = "anthropic.claude-v1"
|
||||
ModelAnthropicClaudeInstantV1 = "anthropic.claude-instant-v1"
|
||||
@@ -56,6 +107,58 @@ const (
|
||||
)
|
||||
|
||||
var BEDROCK_MODELS = []string{
|
||||
ModelAI21Jamba15Large,
|
||||
ModelAI21Jamba15Mini,
|
||||
ModelAI21JambaInstruct,
|
||||
ModelAmazonNovaCanvas,
|
||||
ModelAmazonNovaLite,
|
||||
ModelAmazonNovaMicro,
|
||||
ModelAmazonNovaPro,
|
||||
ModelAmazonNovaReel,
|
||||
ModelAmazonRerank10,
|
||||
ModelAmazonTitanEmbedTextV1,
|
||||
ModelAmazonTitanImageGenV2,
|
||||
ModelAmazonTitanImageGenV1,
|
||||
ModelAmazonTitanMultimodal,
|
||||
ModelAmazonTitanEmbedTextV2,
|
||||
ModelAmazonTitanTextExpress,
|
||||
ModelAmazonTitanTextLite,
|
||||
ModelAmazonTitanTextPremier,
|
||||
ModelAnthropicClaude3Haiku,
|
||||
ModelAnthropicClaude3Opus,
|
||||
ModelAnthropicClaude3Sonnet,
|
||||
ModelAnthropicClaude35Haiku,
|
||||
ModelAnthropicClaudeSonnetV3_5_V2, // Already in your example
|
||||
ModelAnthropicClaude35Sonnet,
|
||||
ModelCohereCommandLight,
|
||||
ModelCohereCommandRPlus,
|
||||
ModelCohereCommandR,
|
||||
ModelCohereCommand,
|
||||
ModelCohereEmbedEnglish,
|
||||
ModelCohereEmbedMultilingual,
|
||||
ModelCohereRerank35,
|
||||
ModelLumaAIRayV2,
|
||||
ModelMetaLlama38BInstruct,
|
||||
ModelMetaLlama370BInstruct,
|
||||
ModelMetaLlama318BInstruct,
|
||||
ModelMetaLlama3170BInstruct,
|
||||
ModelMetaLlama31405BInstruct,
|
||||
ModelMetaLlama321BInstruct,
|
||||
ModelMetaLlama323BInstruct,
|
||||
ModelMetaLlama3211BInstruct,
|
||||
ModelMetaLlama3290BInstruct,
|
||||
ModelMetaLlama3370BInstruct,
|
||||
ModelMistral7BInstruct,
|
||||
ModelMistralLarge2402,
|
||||
ModelMistralLarge2407,
|
||||
ModelMistralSmall2402,
|
||||
ModelMistralMixtral8x7B,
|
||||
ModelStabilitySD3Large,
|
||||
ModelStabilitySD35Large,
|
||||
ModelStabilityImageCore10,
|
||||
ModelStabilityImageCore11,
|
||||
ModelStabilityImageUltra10,
|
||||
ModelStabilityImageUltra11,
|
||||
ModelAnthropicClaudeV2,
|
||||
ModelAnthropicClaudeV1,
|
||||
ModelAnthropicClaudeInstantV1,
|
||||
@@ -151,7 +254,12 @@ func (a *AmazonBedRockClient) GetCompletion(ctx context.Context, prompt string)
|
||||
},
|
||||
}
|
||||
default:
|
||||
return "", fmt.Errorf("model %s not supported", a.model)
|
||||
request = map[string]interface{}{
|
||||
"prompt": prompt,
|
||||
"maxTokens": a.maxTokens,
|
||||
"temperature": a.temperature,
|
||||
"topP": a.topP,
|
||||
}
|
||||
}
|
||||
|
||||
body, err := json.Marshal(request)
|
||||
|
||||
@@ -34,10 +34,10 @@ func (h *Handler) Analyze(ctx context.Context, i *schemav1.AnalyzeRequest) (
|
||||
[]string{}, //TODO: add custom http headers in server mode
|
||||
false, // with stats disable
|
||||
)
|
||||
config.Context = ctx // Replace context for correct timeouts.
|
||||
if err != nil {
|
||||
return &schemav1.AnalyzeResponse{}, err
|
||||
}
|
||||
config.Context = ctx // Replace context for correct timeouts.
|
||||
defer config.Close()
|
||||
|
||||
if config.CustomAnalyzersAreAvailable() {
|
||||
|
||||
Reference in New Issue
Block a user