Skip to content

Commit

Permalink
send files to feathers. Change to @koa/multer
Browse files Browse the repository at this point in the history
  • Loading branch information
Knar33 committed Aug 17, 2023
1 parent 05c14bf commit 9778929
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 154 deletions.
190 changes: 64 additions & 126 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"@google-cloud/speech": "5.5.0",
"@google-cloud/text-to-speech": "4.2.2",
"@koa/cors": "4.0.0",
"@koa/multer": "^3.0.2",
"@koa/router": "12.0.0",
"@minoru/react-dnd-treeview": "^3.4.4",
"@monaco-editor/react": "4.5.1",
Expand All @@ -90,6 +91,7 @@
"@reduxjs/toolkit": "1.9.5",
"@types/dotenv-flow": "3.2.0",
"@types/filesize": "5.0.0",
"@types/multer": "^1.4.7",
"@types/pubsub-js": "1.8.3",
"@use-gesture/react": "10.2.27",
"@welldone-software/why-did-you-render": "7.0.1",
Expand Down Expand Up @@ -119,7 +121,6 @@
"koa": "2.14.2",
"koa-body": "6.0.1",
"koa-compose": "4.1.0",
"koa-multer": "^1.0.2",
"koa-router": "12.0.0",
"koa-static": "5.0.0",
"langchain": "0.0.83",
Expand All @@ -128,6 +129,7 @@
"md5": "2.3.0",
"metaphor-node": "^1.0.18",
"mui-nested-menu": "^3.2.1",
"multer": "^1.4.5-lts.1",
"ngrok": "^5.0.0-beta.2",
"notistack": "3.0.1",
"nx-cloud": "16.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,18 @@ export class UnstructuredService<
// @ts-ignore
async create(data: UnstructuredData): Promise<any> {
data
const body = {
strategy: 'auto',
}

const headers = {
accept: 'application/json',
'unstructured-api-key': 'gOjoJNgNz2kBUrntiWOxazgHYlI3nI',
'Content-Type': 'multipart/form-data',
}

const form = new FormData()
form.append('strategy', 'auto')

const completion = await axios.postForm(
`https://api.unstructured.io/general/v0.0.34/general`,
body,
form,
{ headers: headers }
)

Expand Down
Loading

0 comments on commit 9778929

Please sign in to comment.