@aj-archipelago/cortex 1.1.28 → 1.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,7 +45,7 @@ const generateUniqueFolderName = () => {
45
45
  async function downloadFile(url, outputPath) {
46
46
  try {
47
47
  // Make an HTTP request for the file
48
- const response = await axios.get(url, { responseType: 'stream' });
48
+ const response = await axios.get(decodeURIComponent(url), { responseType: 'stream' });
49
49
 
50
50
  // Create a writable file stream to save the file
51
51
  const fileStream = fs.createWriteStream(outputPath);
package/lib/util.js CHANGED
@@ -77,7 +77,9 @@ function generateUniqueFilename(extension) {
77
77
  }
78
78
 
79
79
  const downloadFile = async (fileUrl) => {
80
- const fileExtension = path.extname(fileUrl).slice(1);
80
+ const urlObj = new URL(fileUrl);
81
+ const pathname = urlObj.pathname;
82
+ const fileExtension = pathname.substring(pathname.lastIndexOf('.') + 1);
81
83
  const uniqueFilename = generateUniqueFilename(fileExtension);
82
84
  const tempDir = os.tmpdir();
83
85
  const localFilePath = `${tempDir}/${uniqueFilename}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aj-archipelago/cortex",
3
- "version": "1.1.28",
3
+ "version": "1.1.29",
4
4
  "description": "Cortex is a GraphQL API for AI. It provides a simple, extensible interface for using AI services from OpenAI, Azure and others.",
5
5
  "private": false,
6
6
  "repository": {