diff --git a/libs/superagent/app/api/workflow_configs/saml_schema.py b/libs/superagent/app/api/workflow_configs/saml_schema.py index 837da1242..e1e37f6d1 100644 --- a/libs/superagent/app/api/workflow_configs/saml_schema.py +++ b/libs/superagent/app/api/workflow_configs/saml_schema.py @@ -149,6 +149,7 @@ class LLMAgentTool(BaseAgentToolModel, LLMAgent): LLMProvider.TOGETHER_AI.value, LLMProvider.ANTHROPIC.value, LLMProvider.BEDROCK.value, + LLMProvider.MISTRAL.value, ] @@ -159,6 +160,7 @@ class Workflow(BaseModel): perplexity: Optional[LLMAgent] together_ai: Optional[LLMAgent] bedrock: Optional[LLMAgent] + mistral: Optional[LLMAgent] anthropic: Optional[LLMAgent] llm: Optional[LLMAgent] = Field( description="Deprecated! Use LLM providers instead. e.g. `perplexity` or `together_ai`" diff --git a/libs/superagent/prisma/migrations/20240418181431_add_mistral/migration.sql b/libs/superagent/prisma/migrations/20240418181431_add_mistral/migration.sql new file mode 100644 index 000000000..fa30cbda9 --- /dev/null +++ b/libs/superagent/prisma/migrations/20240418181431_add_mistral/migration.sql @@ -0,0 +1,2 @@ +-- AlterEnum +ALTER TYPE "LLMProvider" ADD VALUE 'MISTRAL'; diff --git a/libs/superagent/prisma/schema.prisma b/libs/superagent/prisma/schema.prisma index 6f03bca21..9c9045e81 100644 --- a/libs/superagent/prisma/schema.prisma +++ b/libs/superagent/prisma/schema.prisma @@ -24,6 +24,7 @@ enum LLMProvider { TOGETHER_AI ANTHROPIC BEDROCK + MISTRAL } enum LLMModel { diff --git a/libs/ui/app/integrations/llm.tsx b/libs/ui/app/integrations/llm.tsx index 8f2bf5ba3..670821b99 100644 --- a/libs/ui/app/integrations/llm.tsx +++ b/libs/ui/app/integrations/llm.tsx @@ -54,6 +54,13 @@ const antrophicSchema = z.object({ apiKey: z.string().nonempty("API key is required"), options: z.object({}), }) + +const mistralSchema = z.object({ + llmType: z.literal(LLMProvider.MISTRAL), + apiKey: z.string().nonempty("API key is required"), + options: z.object({}), +}) + const amazonBedrockSchema = z.object({ llmType: z.literal(LLMProvider.BEDROCK), apiKey: z.literal(""), @@ -79,6 +86,7 @@ const formSchema = z.discriminatedUnion("llmType", [ perplexityAiSchema, togetherAiSchema, antrophicSchema, + mistralSchema, amazonBedrockSchema, azureOpenAiSchema, ]) diff --git a/libs/ui/config/site.ts b/libs/ui/config/site.ts index 3d2088966..1f7790487 100644 --- a/libs/ui/config/site.ts +++ b/libs/ui/config/site.ts @@ -523,6 +523,19 @@ export const siteConfig = { }, ], }, + { + disabled: false, + formDescription: "Please enter your Mistral API key.", + provider: LLMProvider.MISTRAL, + name: "Mistral", + metadata: [ + { + key: "apiKey", + type: "input", + label: "Mistral API Key", + }, + ], + }, { disabled: false, formDescription: "Please enter your Azure OpenAI API key.", diff --git a/libs/ui/models/models.ts b/libs/ui/models/models.ts index 414c0758a..34855caa4 100644 --- a/libs/ui/models/models.ts +++ b/libs/ui/models/models.ts @@ -4,6 +4,7 @@ export const LLMProvider = { TOGETHER_AI: "TOGETHER_AI", ANTHROPIC: "ANTHROPIC", BEDROCK: "BEDROCK", + MISTRAL: "MISTRAL", AZURE_OPENAI: "AZURE_OPENAI", } as const