Skip to content

Commit

Permalink
Fixes issue 259 preventing the usage of other models not set in stati…
Browse files Browse the repository at this point in the history
…cmodels
  • Loading branch information
dctfor committed Nov 17, 2024
1 parent 87064f7 commit 736ce67
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions app/lib/.server/llm/stream-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,12 @@ export function streamText(
const processedMessages = messages.map((message) => {
if (message.role === 'user') {
const { model, provider, content } = extractPropertiesFromMessage(message);

if (MODEL_LIST.find((m) => m.name === model)) {
currentModel = model;
}

currentModel = model;
currentProvider = provider;

return { ...message, content };
}

return message; // No changes for non-user messages
});
currentModel = 'llama3.1:8b';
console.log('Processed messages:', processedMessages);
console.log('Current model:', currentModel);
console.log('Current provider:', currentProvider);
return _streamText({
model: getModel(currentProvider, currentModel, env, apiKeys),
system: getSystemPrompt(),
Expand Down

0 comments on commit 736ce67

Please sign in to comment.