From 42857109965aad0f6e8f2f2bf82eff39bb7db210 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Fri, 19 Apr 2024 20:14:54 +0200 Subject: [PATCH 1/3] added new groq provider --- agenta-web/src/lib/Types.ts | 1 + agenta-web/src/lib/helpers/llmProviders.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/agenta-web/src/lib/Types.ts b/agenta-web/src/lib/Types.ts index 07a9325be1..8a981fa524 100644 --- a/agenta-web/src/lib/Types.ts +++ b/agenta-web/src/lib/Types.ts @@ -263,6 +263,7 @@ export interface LlmProvidersKeys { AZURE_API_BASE: string TOGETHERAI_API_KEY: string MISTRAL_API_KEY: string + GROQ_API_KEY: string } export interface AppTemplate { diff --git a/agenta-web/src/lib/helpers/llmProviders.ts b/agenta-web/src/lib/helpers/llmProviders.ts index b934bb45ed..92f3d41773 100644 --- a/agenta-web/src/lib/helpers/llmProviders.ts +++ b/agenta-web/src/lib/helpers/llmProviders.ts @@ -20,6 +20,7 @@ export const llmAvailableProviders: LlmProvider[] = [ {title: "TogetherAI", key: "", name: "TOGETHERAI_API_KEY"}, {title: "Aleph Alpha", key: "", name: "ALEPHALPHA_API_KEY"}, {title: "OpenRouter", key: "", name: "OPENROUTER_API_KEY"}, + {title: "Groq", key: "", name: "GROQ_API_KEY"}, ] export const getApikeys = () => { From 85cf465b4410c8447b912a70ae02d970543a48f3 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Fri, 19 Apr 2024 20:52:27 +0200 Subject: [PATCH 2/3] added icon for groq --- agenta-web/src/components/Playground/Views/GroupedSelect.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agenta-web/src/components/Playground/Views/GroupedSelect.tsx b/agenta-web/src/components/Playground/Views/GroupedSelect.tsx index 523f291fe8..42944bbf6b 100644 --- a/agenta-web/src/components/Playground/Views/GroupedSelect.tsx +++ b/agenta-web/src/components/Playground/Views/GroupedSelect.tsx @@ -12,6 +12,7 @@ import { Together, OpenRouter, Fireworks, + Groq, } from "@lobehub/icons" const useStyles = createUseStyles({ @@ -43,6 +44,7 @@ const iconMap: {[key: string]: React.ComponentType} = { "Perplexity AI": Perplexity.Color, "Together AI": Together.Color, OpenRouter: OpenRouter, + Groq: Groq, } const getTextContent = (element: React.ReactNode): string => { From db0ce7f5a9e14c738f3048b0fbb54b588d6c84c5 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Fri, 19 Apr 2024 21:30:01 +0200 Subject: [PATCH 3/3] getting the keys in backend --- .../agenta_backend/models/api/evaluation_model.py | 7 +++++-- agenta-backend/agenta_backend/routers/app_router.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/agenta-backend/agenta_backend/models/api/evaluation_model.py b/agenta-backend/agenta_backend/models/api/evaluation_model.py index c62339a066..4549e85842 100644 --- a/agenta-backend/agenta_backend/models/api/evaluation_model.py +++ b/agenta-backend/agenta_backend/models/api/evaluation_model.py @@ -149,7 +149,8 @@ class HumanEvaluationScenario(BaseModel): class HumanEvaluationScenarioUpdate(BaseModel): vote: Optional[str] score: Optional[Union[str, int]] - correct_answer: Optional[str] # will be used when running custom code evaluation + # will be used when running custom code evaluation + correct_answer: Optional[str] outputs: Optional[List[HumanEvaluationScenarioOutput]] inputs: Optional[List[HumanEvaluationScenarioInput]] is_pinned: Optional[bool] @@ -171,7 +172,8 @@ class EvaluationScenario(BaseModel): class EvaluationScenarioUpdate(BaseModel): vote: Optional[str] score: Optional[Any] - correct_answer: Optional[str] # will be used when running custom code evaluation + # will be used when running custom code evaluation + correct_answer: Optional[str] outputs: Optional[List[EvaluationScenarioOutput]] inputs: Optional[List[EvaluationScenarioInput]] is_pinned: Optional[bool] @@ -243,6 +245,7 @@ class LMProvidersEnum(str, Enum): togetherai = "TOGETHERAI_API_KEY" alephalpha = "ALEPHALPHA_API_KEY" openrouter = "OPENROUTER_API_KEY" + groq = "GROQ_API_KEY" class NewEvaluation(BaseModel): diff --git a/agenta-backend/agenta_backend/routers/app_router.py b/agenta-backend/agenta_backend/routers/app_router.py index 8671bbaa3f..c341db272c 100644 --- a/agenta-backend/agenta_backend/routers/app_router.py +++ b/agenta-backend/agenta_backend/routers/app_router.py @@ -577,6 +577,7 @@ async def create_app_and_variant_from_template( "TOGETHERAI_API_KEY", "ALEPHALPHA_API_KEY", "OPENROUTER_API_KEY", + "GROQ_API_KEY", ] missing_keys = [ key for key in supported_llm_prodviders_keys if not os.environ.get(key)