feat(llm): remove everything to do with embeddings, part 3

This commit is contained in:
perf3ct
2025-06-07 18:30:46 +00:00
parent 44a2e7df21
commit 4550c12c6e
17 changed files with 44 additions and 221 deletions

View File

@@ -48,17 +48,6 @@ interface AnthropicModel {
* type: string
* type:
* type: string
* embeddingModels:
* type: array
* items:
* type: object
* properties:
* id:
* type: string
* name:
* type: string
* type:
* type: string
* '500':
* description: Error listing models
* security:
@@ -90,14 +79,10 @@ async function listModels(req: Request, res: Response) {
type: 'chat'
}));
// Anthropic doesn't currently have embedding models
const embeddingModels: AnthropicModel[] = [];
// Return the models list
return {
success: true,
chatModels,
embeddingModels
chatModels
};
} catch (error: any) {
log.error(`Error listing Anthropic models: ${error.message || 'Unknown error'}`);

View File

@@ -40,17 +40,6 @@ import OpenAI from "openai";
* type: string
* type:
* type: string
* embeddingModels:
* type: array
* items:
* type: object
* properties:
* id:
* type: string
* name:
* type: string
* type:
* type: string
* '500':
* description: Error listing models
* security:
@@ -82,8 +71,7 @@ async function listModels(req: Request, res: Response) {
// Filter and categorize models
const allModels = response.data || [];
// Include all models as chat models, without filtering by specific model names
// This allows models from providers like OpenRouter to be displayed
// Include all models as chat models, excluding embedding models
const chatModels = allModels
.filter((model) =>
// Exclude models that are explicitly for embeddings
@@ -96,23 +84,10 @@ async function listModels(req: Request, res: Response) {
type: 'chat'
}));
const embeddingModels = allModels
.filter((model) =>
// Only include embedding-specific models
model.id.includes('embedding') ||
model.id.includes('embed')
)
.map((model) => ({
id: model.id,
name: model.id,
type: 'embedding'
}));
// Return the models list
return {
success: true,
chatModels,
embeddingModels
chatModels
};
} catch (error: any) {
log.error(`Error listing OpenAI models: ${error.message || 'Unknown error'}`);

View File

@@ -92,7 +92,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([
"showLoginInShareTheme",
"splitEditorOrientation",
// AI/LLM integration options (embedding options removed)
// AI/LLM integration options
"aiEnabled",
"aiTemperature",
"aiSystemPrompt",