mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-31 15:48:51 +01:00
feat: Enhance document intelligence support with new model configuration and API integration
This commit is contained in:
parent
2bf1857bc0
commit
5dfad6b77b
3 changed files with 13 additions and 9 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
const fs = require('fs');
|
||||
const { logger } = require('~/config');
|
||||
|
||||
/**
|
||||
|
|
@ -17,14 +17,18 @@ async function uploadAzureDocumentIntelligence({ filePath, apiKey, endpoint, mod
|
|||
const base64Source = fileBuffer.toString('base64');
|
||||
|
||||
try {
|
||||
const response = await axios.post(`${endpoint}/documentModels/${modelId}/analyze?outputContentFormat=markdown`, {
|
||||
base64Source,
|
||||
}, {
|
||||
headers: {
|
||||
'Ocp-Apim-Subscription-Key': apiKey,
|
||||
'Content-Type': 'application/json',
|
||||
const response = await axios.post(
|
||||
`${endpoint}/documentModels/${modelId}/analyze?outputContentFormat=markdown`,
|
||||
{
|
||||
base64Source,
|
||||
},
|
||||
});
|
||||
{
|
||||
headers: {
|
||||
'Ocp-Apim-Subscription-Key': apiKey,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
);
|
||||
const operationLocation = response.headers['Operation-Location'];
|
||||
|
||||
// Polling for the result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue