Compare commits

..

1 Commits

Author SHA1 Message Date
AlexsJones
2d5c08c615 feat: adding entire AWS model catalog
Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
2025-02-05 10:02:33 +00:00
8 changed files with 135 additions and 50 deletions

View File

@@ -1 +1 @@
{".":"0.3.49"}
{".":"0.3.48"}

View File

@@ -1,30 +1,5 @@
# Changelog
## [0.3.49](https://github.com/k8sgpt-ai/k8sgpt/compare/v0.3.48...v0.3.49) (2025-02-20)
### Bug Fixes
* **deps:** update all non-major dependencies ([#1335](https://github.com/k8sgpt-ai/k8sgpt/issues/1335)) ([8cd3b29](https://github.com/k8sgpt-ai/k8sgpt/commit/8cd3b2985e4cd61711497fb0436e72b6b8aa3162))
* **deps:** update k8s.io/utils digest to 24370be ([#1344](https://github.com/k8sgpt-ai/k8sgpt/issues/1344)) ([fcc8563](https://github.com/k8sgpt-ai/k8sgpt/commit/fcc8563e4eba9bf45d49901b7287d311b93372c2))
* **deps:** update module golang.org/x/net to v0.33.0 [security] ([#1354](https://github.com/k8sgpt-ai/k8sgpt/issues/1354)) ([5de4f77](https://github.com/k8sgpt-ai/k8sgpt/commit/5de4f7704a856fd7db7b2f800bda40c5beb9333b))
* **deps:** update module gopkg.in/yaml.v2 to v3 ([#1336](https://github.com/k8sgpt-ai/k8sgpt/issues/1336)) ([19abbef](https://github.com/k8sgpt-ai/k8sgpt/commit/19abbef9a3112ceb060ac3fd772e2e4f62f19f84))
* prevent npe by handling checking error in NewAnalysis call ([#1365](https://github.com/k8sgpt-ai/k8sgpt/issues/1365)) ([83672fa](https://github.com/k8sgpt-ai/k8sgpt/commit/83672fa768887dd1c6f4dc12a92c3444f100c4f6))
### Other
* **deps:** update actions/setup-go digest to 3041bf5 ([#1347](https://github.com/k8sgpt-ai/k8sgpt/issues/1347)) ([939e067](https://github.com/k8sgpt-ai/k8sgpt/commit/939e0672aaaa5538cd58bb171f1e5d1c07831651))
* **deps:** update actions/upload-artifact digest to 65c4c4a ([#1350](https://github.com/k8sgpt-ai/k8sgpt/issues/1350)) ([c506a4b](https://github.com/k8sgpt-ai/k8sgpt/commit/c506a4b441e24052398c00c93d96806cec1b9f75))
* **deps:** update codecov/codecov-action digest to 13ce06b ([#1342](https://github.com/k8sgpt-ai/k8sgpt/issues/1342)) ([990d723](https://github.com/k8sgpt-ai/k8sgpt/commit/990d7239091b368178e06af60e4dc0e897fc8236))
* **deps:** update docker/setup-buildx-action digest to 6524bf6 ([#1349](https://github.com/k8sgpt-ai/k8sgpt/issues/1349)) ([2918556](https://github.com/k8sgpt-ai/k8sgpt/commit/2918556793316ea4f5a319c9aa51c1fec12ede85))
* fix typo in "completion" ([#1362](https://github.com/k8sgpt-ai/k8sgpt/issues/1362)) ([06b8f78](https://github.com/k8sgpt-ai/k8sgpt/commit/06b8f78150308c1f6023747fa34826e038d6bc3a))
### Docs
* fix broken schema link in README.md ([#1373](https://github.com/k8sgpt-ai/k8sgpt/issues/1373)) ([076ca2f](https://github.com/k8sgpt-ai/k8sgpt/commit/076ca2f14832cf83e43c465c377ef21825218b2f))
## [0.3.48](https://github.com/k8sgpt-ai/k8sgpt/compare/v0.3.47...v0.3.48) (2024-12-04)

View File

@@ -49,7 +49,7 @@ brew install k8sgpt
<!---x-release-please-start-version-->
```
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.49/k8sgpt_386.rpm
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.48/k8sgpt_386.rpm
```
<!---x-release-please-end-->
@@ -57,7 +57,7 @@ brew install k8sgpt
<!---x-release-please-start-version-->
```
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.49/k8sgpt_amd64.rpm
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.48/k8sgpt_amd64.rpm
```
<!---x-release-please-end-->
</details>
@@ -70,7 +70,7 @@ brew install k8sgpt
<!---x-release-please-start-version-->
```
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.49/k8sgpt_386.deb
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.48/k8sgpt_386.deb
sudo dpkg -i k8sgpt_386.deb
```
@@ -81,7 +81,7 @@ sudo dpkg -i k8sgpt_386.deb
<!---x-release-please-start-version-->
```
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.49/k8sgpt_amd64.deb
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.48/k8sgpt_amd64.deb
sudo dpkg -i k8sgpt_amd64.deb
```
@@ -96,7 +96,7 @@ sudo dpkg -i k8sgpt_amd64.deb
<!---x-release-please-start-version-->
```
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.49/k8sgpt_386.apk
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.48/k8sgpt_386.apk
apk add --allow-untrusted k8sgpt_386.apk
```
<!---x-release-please-end-->
@@ -105,7 +105,7 @@ sudo dpkg -i k8sgpt_amd64.deb
<!---x-release-please-start-version-->
```
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.49/k8sgpt_amd64.apk
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.48/k8sgpt_amd64.apk
apk add --allow-untrusted k8sgpt_amd64.apk
```
<!---x-release-please-end-->
@@ -529,7 +529,7 @@ k8sgpt cache remove
<summary> Custom Analyzers</summary>
There may be scenarios where you wish to write your own analyzer in a language of your choice.
K8sGPT now supports the ability to do so by abiding by the [schema](https://github.com/k8sgpt-ai/schemas/blob/main/protobuf/schema/v1/custom_analyzer.proto) and serving the analyzer for consumption.
K8sGPT now supports the ability to do so by abiding by the [schema](https://github.com/k8sgpt-ai/schemas/blob/main/protobuf/schema/v1/analyzer.proto) and serving the analyzer for consumption.
To do so, define the analyzer within the K8sGPT configuration and it will add it into the scanning process.
In addition to this you will need to enable the following flag on analysis:

10
go.mod
View File

@@ -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
)
@@ -304,9 +304,9 @@ require (
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/crypto v0.30.0 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/net v0.33.0
golang.org/x/net v0.32.0
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
@@ -323,7 +323,7 @@ require (
k8s.io/component-base v0.31.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 // indirect
k8s.io/utils v0.0.0-20241210054802-24370beab758
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078
oras.land/oras-go v1.2.5 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/kustomize/api v0.18.0 // indirect

14
go.sum
View File

@@ -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=
@@ -1824,8 +1826,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -1947,8 +1949,8 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -2545,8 +2547,8 @@ k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094 h1:MErs8YA0abvOqJ8gIupA1T
k8s.io/kube-openapi v0.0.0-20241009091222-67ed5848f094/go.mod h1:7ioBJr1A6igWjsR2fxq2EZ0mlMwYLejazSIc2bzMp2U=
k8s.io/kubectl v0.31.1 h1:ih4JQJHxsEggFqDJEHSOdJ69ZxZftgeZvYo7M/cpp24=
k8s.io/kubectl v0.31.1/go.mod h1:aNuQoR43W6MLAtXQ/Bu4GDmoHlbhHKuyD49lmTC8eJM=
k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0=
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078 h1:jGnCPejIetjiy2gqaJ5V0NLwTpF4wbQ6cZIItJCSHno=
k8s.io/utils v0.0.0-20241104163129-6fe5fd82f078/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/pkg v0.0.0-20241026180704-25f6002b00f3 h1:uUSDGlOIkdPT4svjlhi+JEnP2Ufw7AM/F5QDYiEL02U=
knative.dev/pkg v0.0.0-20241026180704-25f6002b00f3/go.mod h1:FeMbTLlxQqSASwlRCrYEOsZ0OKUgSj52qxhECwYCJsw=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=

View File

@@ -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)

View File

@@ -80,10 +80,10 @@ func (c *GoogleGenAIClient) GetCompletion(ctx context.Context, prompt string) (s
if !r.Blocked {
continue
}
return "", fmt.Errorf("completion blocked due to %v with probability %v", r.Category.String(), r.Probability.String())
return "", fmt.Errorf("complection blocked due to %v with probability %v", r.Category.String(), r.Probability.String())
}
}
return "", errors.New("no completion returned; unknown reason")
return "", errors.New("no complection returned; unknown reason")
}
// Format output.

View File

@@ -139,10 +139,10 @@ func (g *GoogleVertexAIClient) GetCompletion(ctx context.Context, prompt string)
if !r.Blocked {
continue
}
return "", fmt.Errorf("completion blocked due to %v with probability %v", r.Category.String(), r.Probability.String())
return "", fmt.Errorf("complection blocked due to %v with probability %v", r.Category.String(), r.Probability.String())
}
}
return "", errors.New("no completion returned; unknown reason")
return "", errors.New("no complection returned; unknown reason")
}
// Format output.