Skip to content

Commit 4530495

Browse files
committed
fix: llm provider config (#20)
1 parent ca973c3 commit 4530495

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/domain/llm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const parseActionItems = (text: string) => {
5454
.filter(isNotNull);
5555
};
5656

57-
const getChatModel = async () => {
57+
export const getChatModel = async () => {
5858
const { llm } = await settings.getSettings();
5959
switch (llm.provider) {
6060
case "ollama":
@@ -68,7 +68,7 @@ const getChatModel = async () => {
6868
}
6969
};
7070

71-
const getEmbeddings = async () => {
71+
export const getEmbeddings = async () => {
7272
const { llm } = await settings.getSettings();
7373

7474
switch (llm.provider) {
@@ -77,8 +77,8 @@ const getEmbeddings = async () => {
7777
return new OllamaEmbeddings(llm.providerConfig.ollama.embeddings);
7878
case "openai":
7979
return new OpenAIEmbeddings({
80+
...llm.providerConfig.openai.chatModel, // reuse provider config
8081
...llm.providerConfig.openai.embeddings,
81-
apiKey: llm.providerConfig.openai.chatModel.apiKey,
8282
});
8383
default:
8484
throw new Error(`Invalid LLM provider: ${llm.provider}`);

0 commit comments

Comments
 (0)