diff --git a/pkg/ai/amazonbedrock.go b/pkg/ai/amazonbedrock.go index 25381d7e8a..8f3ecdbfaf 100644 --- a/pkg/ai/amazonbedrock.go +++ b/pkg/ai/amazonbedrock.go @@ -10,6 +10,8 @@ import ( "github.com/aws/aws-sdk-go/service/bedrockruntime" ) +const amazonbedrockAIClientName = "amazonbedrock" + // AmazonBedRockClient represents the client for interacting with the Amazon Bedrock service. type AmazonBedRockClient struct { nopCloser @@ -147,5 +149,5 @@ func (a *AmazonBedRockClient) GetCompletion(ctx context.Context, prompt string) // GetName returns the name of the AmazonBedRockClient. func (a *AmazonBedRockClient) GetName() string { - return "amazonbedrock" + return amazonbedrockAIClientName } diff --git a/pkg/ai/amazonsagemaker.go b/pkg/ai/amazonsagemaker.go index cae9e9660e..23a6e6dac5 100644 --- a/pkg/ai/amazonsagemaker.go +++ b/pkg/ai/amazonsagemaker.go @@ -23,6 +23,8 @@ import ( "github.com/aws/aws-sdk-go/service/sagemakerruntime" ) +const amazonsagemakerAIClientName = "amazonsagemaker" + type SageMakerAIClient struct { nopCloser @@ -131,5 +133,5 @@ func (c *SageMakerAIClient) GetCompletion(_ context.Context, prompt string) (str } func (c *SageMakerAIClient) GetName() string { - return "amazonsagemaker" + return amazonsagemakerAIClientName } diff --git a/pkg/ai/azureopenai.go b/pkg/ai/azureopenai.go index eb8ee71728..7def5ea430 100644 --- a/pkg/ai/azureopenai.go +++ b/pkg/ai/azureopenai.go @@ -7,6 +7,8 @@ import ( "github.com/sashabaranov/go-openai" ) +const azureAIClientName = "azureopenai" + type AzureAIClient struct { nopCloser @@ -58,5 +60,5 @@ func (c *AzureAIClient) GetCompletion(ctx context.Context, prompt string) (strin } func (c *AzureAIClient) GetName() string { - return "azureopenai" + return azureAIClientName } diff --git a/pkg/ai/cohere.go b/pkg/ai/cohere.go index 1b6158dfb4..3ea394aca4 100644 --- a/pkg/ai/cohere.go +++ b/pkg/ai/cohere.go @@ -20,9 +20,11 @@ import ( "github.com/cohere-ai/cohere-go" ) +const cohereAIClientName = "cohere" + type CohereClient struct { nopCloser - + client *cohere.Client model string temperature float32 @@ -68,5 +70,5 @@ func (c *CohereClient) GetCompletion(_ context.Context, prompt string) (string, } func (c *CohereClient) GetName() string { - return "cohere" + return cohereAIClientName } diff --git a/pkg/ai/iai.go b/pkg/ai/iai.go index b4380ce3da..7ad14852cf 100644 --- a/pkg/ai/iai.go +++ b/pkg/ai/iai.go @@ -29,14 +29,14 @@ var ( &GoogleGenAIClient{}, } Backends = []string{ - "openai", - "localai", - "azureopenai", - "cohere", - "amazonbedrock", - "amazonsagemaker", + openAIClientName, + localAIClientName, + azureAIClientName, + cohereAIClientName, + amazonbedrockAIClientName, + amazonsagemakerAIClientName, googleAIClientName, - "noopai", + noopAIClientName, } ) diff --git a/pkg/ai/localai.go b/pkg/ai/localai.go index 33aa730098..d813c549db 100644 --- a/pkg/ai/localai.go +++ b/pkg/ai/localai.go @@ -1,9 +1,11 @@ package ai +const localAIClientName = "localai" + type LocalAIClient struct { OpenAIClient } func (a *LocalAIClient) GetName() string { - return "localai" + return localAIClientName } diff --git a/pkg/ai/noopai.go b/pkg/ai/noopai.go index e1c4498331..b41436228f 100644 --- a/pkg/ai/noopai.go +++ b/pkg/ai/noopai.go @@ -17,6 +17,8 @@ import ( "context" ) +const noopAIClientName = "noopai" + type NoOpAIClient struct { nopCloser } @@ -31,5 +33,5 @@ func (c *NoOpAIClient) GetCompletion(_ context.Context, prompt string) (string, } func (c *NoOpAIClient) GetName() string { - return "noopai" + return noopAIClientName } diff --git a/pkg/ai/openai.go b/pkg/ai/openai.go index ec097e355b..e60e734f39 100644 --- a/pkg/ai/openai.go +++ b/pkg/ai/openai.go @@ -20,6 +20,8 @@ import ( "github.com/sashabaranov/go-openai" ) +const openAIClientName = "openai" + type OpenAIClient struct { nopCloser @@ -78,5 +80,5 @@ func (c *OpenAIClient) GetCompletion(ctx context.Context, prompt string) (string } func (c *OpenAIClient) GetName() string { - return "openai" + return openAIClientName }