Skip to content

Commit

Permalink
fix: openAIEmbedding now requires top level API Key configuration (ja…
Browse files Browse the repository at this point in the history
…nhq#1902)

* fix: openAIEmbedding now requires top level API Key configuration

* chore: typo
  • Loading branch information
louis-jan authored Feb 2, 2024
1 parent bef8dcd commit eaa3053
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,19 @@ export class Retrieval {
if (engine === "nitro") {
this.embeddingModel = new OpenAIEmbeddings(
{ openAIApiKey: "nitro-embedding" },
{ basePath: "http://127.0.0.1:3928/v1" }
{ basePath: "http://127.0.0.1:3928/v1" },
);
} else {
// Fallback to OpenAI Settings
this.embeddingModel = new OpenAIEmbeddings({
configuration: {
apiKey: settings.api_key,
},
openAIApiKey: settings.api_key,
});
}
}

public ingestAgentKnowledge = async (
filePath: string,
memoryPath: string
memoryPath: string,
): Promise<any> => {
const loader = new PDFLoader(filePath, {
splitPages: true,
Expand Down
3 changes: 0 additions & 3 deletions extensions/inference-nitro-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ export default class JanInferenceNitroExtension extends InferenceExtension {
*/
private async onMessageRequest(data: MessageRequest) {
if (data.model?.engine !== InferenceEngine.nitro || !this._currentModel) {
console.log(
`Model is not nitro or no model loaded ${data.model?.engine} ${this._currentModel}`
);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions web/screens/Settings/Advanced/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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-shrink-0 space-y-1.5">
<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>
<p className="leading-relaxed">
Enable GPU acceleration for NVidia GPUs.
Enable GPU acceleration for Nvidia GPUs.
</p>
</div>
<Switch
Expand Down

0 comments on commit eaa3053

Please sign in to comment.