Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Hide keys UI for model provider if no keys are required

Tomas Valenta739ee9b3ef0e
diff --git a/api-service/models/base.py b/api-service/models/base.py
index be006a45b..0b9c084e2 100644
--- a/api-service/models/base.py
+++ b/api-service/models/base.py
@@ -1,7 +1,7 @@
from typing import TypedDict, Dict, Any
from enum import Enum
-from langchain.llms import Replicate, GPT4All
+from langchain.llms import Replicate
from langchain.chat_models import ChatOpenAI
from langchain.schema import BaseLanguageModel
from langchain.callbacks.base import BaseCallbackManager
diff --git a/components/Editor/Sidebar/Model/index.tsx b/components/Editor/Sidebar/Model/index.tsx
index 645ac9d95..74e284f14 100644
--- a/components/Editor/Sidebar/Model/index.tsx
+++ b/components/Editor/Sidebar/Model/index.tsx
@@ -79,28 +79,31 @@ function Model({ }: Props) {
"
size={Text.size.S2}
/>
- <div
- className="
+ {value.creds &&
+ <div
+ className="
space-x-2
flex
"
- >
- <Text
- text={getMissingCreds(provider as ModelProvider, creds).length === 0 ? '' : 'Missing keys'}
- className="
+ >
+
+ <Text
+ text={getMissingCreds(provider as ModelProvider, creds).length === 0 ? '' : 'Missing keys'}
+ className="
text-red-600
"
- size={Text.size.S3}
- />
- <Button
- icon={
- <Key size="16px" />
- }
- text="Set keys"
- className="whitespace-pre-wrap"
- onClick={() => router.push('/settings')}
- />
- </div>
+ size={Text.size.S3}
+ />
+ <Button
+ icon={
+ <Key size="16px" />
+ }
+ text="Set keys"
+ className="whitespace-pre-wrap"
+ onClick={() => router.push('/settings')}
+ />
+ </div>
+ }
</div>
<div className="
flex