Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

👷‍♂️ chore: pass Tavily Response error and revert test commit on `userSchema.js` (#3496)

Danny Avilab8a6efa649c6
diff --git a/api/app/clients/tools/structured/TavilySearchResults.js b/api/app/clients/tools/structured/TavilySearchResults.js
index 3945ac1d00..b1691a63db 100644
--- a/api/app/clients/tools/structured/TavilySearchResults.js
+++ b/api/app/clients/tools/structured/TavilySearchResults.js
@@ -82,7 +82,9 @@ class TavilySearchResults extends Tool {
const json = await response.json();
if (!response.ok) {
- throw new Error(`Request failed with status ${response.status}: ${json.error}`);
+ throw new Error(
+ `Request failed with status ${response.status}: ${json?.detail?.error || json?.error}`,
+ );
}
return JSON.stringify(json);
diff --git a/api/models/schema/userSchema.js b/api/models/schema/userSchema.js
index f32da48cc9..715d823516 100644
--- a/api/models/schema/userSchema.js
+++ b/api/models/schema/userSchema.js
@@ -1,4 +1,5 @@
const mongoose = require('mongoose');
+const { SystemRoles } = require('librechat-data-provider');
/**
* @typedef {Object} MongoSession
@@ -78,7 +79,7 @@ const userSchema = mongoose.Schema(
},
role: {
type: String,
- default: 'USER',
+ default: SystemRoles.USER,
},
googleId: {
type: String,