-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Cohere LLM and embedder support (#1233)
* getChatCompletion working WIP streaming * WIP * working streaming WIP abort stream * implement cohere embedder support * remove inputType option from cohere embedder * fix cohere LLM from not aborting stream when canceled by user * Patch Cohere implemention * add cohere to onboarding --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
- Loading branch information
1 parent
d02013f
commit 3caebc4
Showing
17 changed files
with
541 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
frontend/src/components/EmbeddingSelection/CohereOptions/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
export default function CohereEmbeddingOptions({ settings }) { | ||
return ( | ||
<div className="w-full flex flex-col gap-y-4"> | ||
<div className="w-full flex items-center gap-4"> | ||
<div className="flex flex-col w-60"> | ||
<label className="text-white text-sm font-semibold block mb-4"> | ||
API Key | ||
</label> | ||
<input | ||
type="password" | ||
name="CohereApiKey" | ||
className="bg-zinc-900 text-white placeholder:text-white/20 text-sm rounded-lg focus:border-white block w-full p-2.5" | ||
placeholder="Cohere API Key" | ||
defaultValue={settings?.CohereApiKey ? "*".repeat(20) : ""} | ||
required={true} | ||
autoComplete="off" | ||
spellCheck={false} | ||
/> | ||
</div> | ||
<div className="flex flex-col w-60"> | ||
<label className="text-white text-sm font-semibold block mb-4"> | ||
Model Preference | ||
</label> | ||
<select | ||
name="EmbeddingModelPref" | ||
required={true} | ||
className="bg-zinc-900 border-gray-500 text-white text-sm rounded-lg block w-full p-2.5" | ||
> | ||
<optgroup label="Available embedding models"> | ||
{[ | ||
"embed-english-v3.0", | ||
"embed-multilingual-v3.0", | ||
"embed-english-light-v3.0", | ||
"embed-multilingual-light-v3.0", | ||
"embed-english-v2.0", | ||
"embed-english-light-v2.0", | ||
"embed-multilingual-v2.0", | ||
].map((model) => { | ||
return ( | ||
<option | ||
key={model} | ||
value={model} | ||
selected={settings?.EmbeddingModelPref === model} | ||
> | ||
{model} | ||
</option> | ||
); | ||
})} | ||
</optgroup> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
49 changes: 49 additions & 0 deletions
49
frontend/src/components/LLMSelection/CohereAiOptions/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export default function CohereAiOptions({ settings }) { | ||
return ( | ||
<div className="w-full flex flex-col"> | ||
<div className="w-full flex items-center gap-4"> | ||
<div className="flex flex-col w-60"> | ||
<label className="text-white text-sm font-semibold block mb-4"> | ||
Cohere API Key | ||
</label> | ||
<input | ||
type="password" | ||
name="CohereApiKey" | ||
className="bg-zinc-900 text-white placeholder:text-white/20 text-sm rounded-lg focus:border-white block w-full p-2.5" | ||
placeholder="Cohere API Key" | ||
defaultValue={settings?.CohereApiKey ? "*".repeat(20) : ""} | ||
required={true} | ||
autoComplete="off" | ||
spellCheck={false} | ||
/> | ||
</div> | ||
<div className="flex flex-col w-60"> | ||
<label className="text-white text-sm font-semibold block mb-4"> | ||
Chat Model Selection | ||
</label> | ||
<select | ||
name="CohereModelPref" | ||
defaultValue={settings?.CohereModelPref || "command-r"} | ||
required={true} | ||
className="bg-zinc-900 border-gray-500 text-white text-sm rounded-lg block w-full p-2.5" | ||
> | ||
{[ | ||
"command-r", | ||
"command-r-plus", | ||
"command", | ||
"command-light", | ||
"command-nightly", | ||
"command-light-nightly", | ||
].map((model) => { | ||
return ( | ||
<option key={model} value={model}> | ||
{model} | ||
</option> | ||
); | ||
})} | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.