fix: openAIEmbedding now requires top level API Key configuration (#1902)
* fix: openAIEmbedding now requires top level API Key configuration * chore: typo
This commit is contained in:
parent
bef8dcd6d5
commit
eaa3053d40
@ -35,21 +35,19 @@ export class Retrieval {
|
|||||||
if (engine === "nitro") {
|
if (engine === "nitro") {
|
||||||
this.embeddingModel = new OpenAIEmbeddings(
|
this.embeddingModel = new OpenAIEmbeddings(
|
||||||
{ openAIApiKey: "nitro-embedding" },
|
{ openAIApiKey: "nitro-embedding" },
|
||||||
{ basePath: "http://127.0.0.1:3928/v1" }
|
{ basePath: "http://127.0.0.1:3928/v1" },
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Fallback to OpenAI Settings
|
// Fallback to OpenAI Settings
|
||||||
this.embeddingModel = new OpenAIEmbeddings({
|
this.embeddingModel = new OpenAIEmbeddings({
|
||||||
configuration: {
|
openAIApiKey: settings.api_key,
|
||||||
apiKey: settings.api_key,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ingestAgentKnowledge = async (
|
public ingestAgentKnowledge = async (
|
||||||
filePath: string,
|
filePath: string,
|
||||||
memoryPath: string
|
memoryPath: string,
|
||||||
): Promise<any> => {
|
): Promise<any> => {
|
||||||
const loader = new PDFLoader(filePath, {
|
const loader = new PDFLoader(filePath, {
|
||||||
splitPages: true,
|
splitPages: true,
|
||||||
|
|||||||
@ -226,9 +226,6 @@ export default class JanInferenceNitroExtension extends InferenceExtension {
|
|||||||
*/
|
*/
|
||||||
private async onMessageRequest(data: MessageRequest) {
|
private async onMessageRequest(data: MessageRequest) {
|
||||||
if (data.model?.engine !== InferenceEngine.nitro || !this._currentModel) {
|
if (data.model?.engine !== InferenceEngine.nitro || !this._currentModel) {
|
||||||
console.log(
|
|
||||||
`Model is not nitro or no model loaded ${data.model?.engine} ${this._currentModel}`
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,10 +109,10 @@ const Advanced = () => {
|
|||||||
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-0 last:border-none">
|
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-0 last:border-none">
|
||||||
<div className="flex-shrink-0 space-y-1.5">
|
<div className="flex-shrink-0 space-y-1.5">
|
||||||
<div className="flex gap-x-2">
|
<div className="flex gap-x-2">
|
||||||
<h6 className="text-sm font-semibold capitalize">NVidia GPU</h6>
|
<h6 className="text-sm font-semibold capitalize">Nvidia GPU</h6>
|
||||||
</div>
|
</div>
|
||||||
<p className="leading-relaxed">
|
<p className="leading-relaxed">
|
||||||
Enable GPU acceleration for NVidia GPUs.
|
Enable GPU acceleration for Nvidia GPUs.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Switch
|
<Switch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user