Skip to content

Commit 440b807

Browse files
committed
chore: Add Gemini 1.5 Flash/Pro (Google) chat models to seed.ts
1 parent 0aed0db commit 440b807

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

server/prisma/seed.ts

+16
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,22 @@ const LLMS: {
354354
stream_available: true,
355355
model_provider: "OpenAI",
356356
config: "{}",
357+
},
358+
{
359+
model_id: "gemini-1.5-flash-dbase",
360+
name: "Gemini 1.5 Flash (Google)",
361+
model_type: "chat",
362+
stream_available: true,
363+
model_provider: "Google",
364+
config: "{}",
365+
},
366+
{
367+
model_id: "gemini-1.5-pro-dbase",
368+
name: "Gemini 1.5 Pro (Google)",
369+
model_type: "chat",
370+
stream_available: true,
371+
model_provider: "Google",
372+
config: "{}",
357373
}
358374
];
359375

server/src/chain/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { BaseLanguageModel } from "@langchain/core/language_models/base";
2+
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
23
import { Document } from "@langchain/core/documents";
34
import {
45
ChatPromptTemplate,
@@ -14,6 +15,7 @@ import {
1415
RunnableMap,
1516
RunnableSequence,
1617
} from "@langchain/core/runnables";
18+
1719
type RetrievalChainInput = {
1820
chat_history: string;
1921
question: string;
@@ -107,8 +109,8 @@ export const createChain = ({
107109
retriever,
108110
response_template,
109111
}: {
110-
llm: BaseLanguageModel;
111-
question_llm: BaseLanguageModel;
112+
llm: BaseLanguageModel<any> | BaseChatModel<any> ;
113+
question_llm: BaseLanguageModel<any> | BaseChatModel<any>;
112114
retriever: Runnable;
113115
question_template: string;
114116
response_template: string;

server/src/utils/models.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const chatModelProvider = (
8484
maxOutputTokens: 2048,
8585
apiKey: process.env.GOOGLE_API_KEY,
8686
...otherFields,
87-
});
87+
}) as any
8888
case "ollama":
8989
return new ChatOllama({
9090
baseUrl: otherFields.baseURL,

0 commit comments

Comments
 (0)