Skip to content

Commit

Permalink
Merge branch 'main' into fix/gemini-app
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-bf authored Feb 7, 2024
2 parents 03c3237 + 9d5801f commit b40297c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,14 @@ function fillTemplateWith(input: string, modelConfig: ModelConfig) {
KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default;
// Find the model in the DEFAULT_MODELS array that matches the modelConfig.model
const modelInfo = DEFAULT_MODELS.find((m) => m.name === modelConfig.model);
if (!modelInfo) {
throw new Error(
`Model ${modelConfig.model} not found in DEFAULT_MODELS array.`,
);

var serviceProvider = "OpenAI";
if (modelInfo) {
// TODO: auto detect the providerName from the modelConfig.model

// Directly use the providerName from the modelInfo
serviceProvider = modelInfo.provider.providerName;
}
// Directly use the providerName from the modelInfo
const serviceProvider = modelInfo.provider.providerName;

const vars = {
ServiceProvider: serviceProvider,
Expand Down

0 comments on commit b40297c

Please sign in to comment.