mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-05 20:46:43 +00:00
Merge pull request #713 from thecodacus/context-optimization-fix
fix: removed context optimization temporarily, to be moved to optional
This commit is contained in:
commit
55094392cf
@ -38,7 +38,7 @@ type Dirent = File | Folder;
|
|||||||
|
|
||||||
export type FileMap = Record<string, Dirent | undefined>;
|
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"
|
// Using regex to match boltAction tags that have type="file"
|
||||||
const regex = /(<boltAction[^>]*type="file"[^>]*>)([\s\S]*?)(<\/boltAction>)/g;
|
const regex = /(<boltAction[^>]*type="file"[^>]*>)([\s\S]*?)(<\/boltAction>)/g;
|
||||||
|
|
||||||
@ -156,8 +156,9 @@ export async function streamText(props: {
|
|||||||
|
|
||||||
return { ...message, content };
|
return { ...message, content };
|
||||||
} else if (message.role == 'assistant') {
|
} else if (message.role == 'assistant') {
|
||||||
let content = message.content;
|
const content = message.content;
|
||||||
content = simplifyBoltActions(content);
|
|
||||||
|
// content = simplifyBoltActions(content);
|
||||||
|
|
||||||
return { ...message, content };
|
return { ...message, content };
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,6 @@ async function getOpenRouterModels(): Promise<ModelInfo[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getLMStudioModels(_apiKeys?: Record<string, string>, settings?: IProviderSetting): Promise<ModelInfo[]> {
|
async function getLMStudioModels(_apiKeys?: Record<string, string>, settings?: IProviderSetting): Promise<ModelInfo[]> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const baseUrl = settings?.baseUrl || import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234';
|
const baseUrl = settings?.baseUrl || import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234';
|
||||||
const response = await fetch(`${baseUrl}/v1/models`);
|
const response = await fetch(`${baseUrl}/v1/models`);
|
||||||
|
Loading…
Reference in New Issue
Block a user