Skip to content

Commit

Permalink
Merge pull request #713 from thecodacus/context-optimization-fix
Browse files Browse the repository at this point in the history
fix: removed context optimization temporarily, to be moved to optional
  • Loading branch information
thecodacus authored Dec 13, 2024
2 parents 77425d6 + 456c894 commit 5509439
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/lib/.server/llm/stream-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Dirent = File | Folder;

export type FileMap = Record<string, Dirent | undefined>;

function simplifyBoltActions(input: string): string {
export function simplifyBoltActions(input: string): string {
// Using regex to match boltAction tags that have type="file"
const regex = /(<boltAction[^>]*type="file"[^>]*>)([\s\S]*?)(<\/boltAction>)/g;

Expand Down Expand Up @@ -156,8 +156,9 @@ export async function streamText(props: {

return { ...message, content };
} else if (message.role == 'assistant') {
let content = message.content;
content = simplifyBoltActions(content);
const content = message.content;

// content = simplifyBoltActions(content);

return { ...message, content };
}
Expand Down
1 change: 0 additions & 1 deletion app/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ async function getOpenRouterModels(): Promise<ModelInfo[]> {
}

async function getLMStudioModels(_apiKeys?: Record<string, string>, settings?: IProviderSetting): Promise<ModelInfo[]> {

try {
const baseUrl = settings?.baseUrl || import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234';
const response = await fetch(`${baseUrl}/v1/models`);
Expand Down

0 comments on commit 5509439

Please sign in to comment.