forked from danny-avila/LibreChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐳 feat: RAG for Default Docker Compose Files + Docs Update (danny-avi…
…la#2246) * refactor(deploy-compose.yml): use long-syntax to avoid implicit folder creation of librechat.yaml * refactor(docker-compose.override.yml.example): use long-syntax to avoid implicit folder creation of librechat.yaml * chore: add simple health check for RAG_API_URL * chore: improve axios error handling, adding `logAxiosError` * chore: more informative message detailing RAG_API_URL path * feat: add rag_api and vectordb to default compose file * chore(rag.yml): update standalone rag compose file to use RAG_PORT * chore: documentation updates * docs: Update rag_api.md with images * Update rag_api.md * Update rag_api.md, assistants clarification * add RAG API note to breaking changes
- Loading branch information
1 parent
6a6b2e7
commit 56ea0f9
Showing
16 changed files
with
306 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
const loadYaml = require('./loadYaml'); | ||
const tokenHelpers = require('./tokens'); | ||
const azureUtils = require('./azureUtils'); | ||
const logAxiosError = require('./logAxiosError'); | ||
const extractBaseURL = require('./extractBaseURL'); | ||
const findMessageContent = require('./findMessageContent'); | ||
|
||
module.exports = { | ||
...azureUtils, | ||
loadYaml, | ||
...tokenHelpers, | ||
...azureUtils, | ||
logAxiosError, | ||
extractBaseURL, | ||
findMessageContent, | ||
loadYaml, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const { logger } = require('~/config'); | ||
|
||
/** | ||
* Logs Axios errors based on the error object and a custom message. | ||
* | ||
* @param {Object} options - The options object. | ||
* @param {string} options.message - The custom message to be logged. | ||
* @param {Error} options.error - The Axios error object. | ||
*/ | ||
const logAxiosError = ({ message, error }) => { | ||
const timedOutMessage = 'Cannot read properties of undefined (reading \'status\')'; | ||
if (error.response) { | ||
logger.error( | ||
`${message} The request was made and the server responded with a status code that falls out of the range of 2xx: ${ | ||
error.message ? error.message : '' | ||
}. Error response data:\n`, | ||
{ | ||
headers: error.response?.headers, | ||
status: error.response?.status, | ||
data: error.response?.data, | ||
}, | ||
); | ||
} else if (error.request) { | ||
logger.error( | ||
`${message} The request was made but no response was received: ${ | ||
error.message ? error.message : '' | ||
}. Error Request:\n`, | ||
{ | ||
request: error.request, | ||
}, | ||
); | ||
} else if (error?.message?.includes(timedOutMessage)) { | ||
logger.error( | ||
`${message}\nThe request either timed out or was unsuccessful. Error message:\n`, | ||
error, | ||
); | ||
} else { | ||
logger.error( | ||
`${message}\nSomething happened in setting up the request. Error message:\n`, | ||
error, | ||
); | ||
} | ||
}; | ||
|
||
module.exports = logAxiosError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.