Skip to content

Commit

Permalink
chore: Add Gemini 1.5 Flash/Pro (Google) chat models to seed.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
n4ze3m committed May 31, 2024
1 parent 0aed0db commit 440b807
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
16 changes: 16 additions & 0 deletions server/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,22 @@ const LLMS: {
stream_available: true,
model_provider: "OpenAI",
config: "{}",
},
{
model_id: "gemini-1.5-flash-dbase",
name: "Gemini 1.5 Flash (Google)",
model_type: "chat",
stream_available: true,
model_provider: "Google",
config: "{}",
},
{
model_id: "gemini-1.5-pro-dbase",
name: "Gemini 1.5 Pro (Google)",
model_type: "chat",
stream_available: true,
model_provider: "Google",
config: "{}",
}
];

Expand Down
6 changes: 4 additions & 2 deletions server/src/chain/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BaseLanguageModel } from "@langchain/core/language_models/base";
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
import { Document } from "@langchain/core/documents";
import {
ChatPromptTemplate,
Expand All @@ -14,6 +15,7 @@ import {
RunnableMap,
RunnableSequence,
} from "@langchain/core/runnables";

type RetrievalChainInput = {
chat_history: string;
question: string;
Expand Down Expand Up @@ -107,8 +109,8 @@ export const createChain = ({
retriever,
response_template,
}: {
llm: BaseLanguageModel;
question_llm: BaseLanguageModel;
llm: BaseLanguageModel<any> | BaseChatModel<any> ;
question_llm: BaseLanguageModel<any> | BaseChatModel<any>;
retriever: Runnable;
question_template: string;
response_template: string;
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const chatModelProvider = (
maxOutputTokens: 2048,
apiKey: process.env.GOOGLE_API_KEY,
...otherFields,
});
}) as any
case "ollama":
return new ChatOllama({
baseUrl: otherFields.baseURL,
Expand Down

0 comments on commit 440b807

Please sign in to comment.