Comments (3)
Hello, @andrewdoro! I'm here to help you with any bugs, questions, or contributions. Let's work together to resolve your issue.
To address the issue of the default API option when running UnstructuredLoader
locally, you can add the following code snippet to the local setup section of the documentation:
/**
* Local setup for UnstructuredLoader with default API option.
* Ensure the `apiUrl` is set to "http://localhost:8000/general/v0/general".
* @example
* ```typescript
* const loader = new UnstructuredLoader("path/to/file", {
* apiUrl: "http://localhost:8000/general/v0/general",
* apiKey: "YOUR_API_KEY", // Optional if your local setup requires it
* });
* const docs = await loader.load();
* ```
*/
This snippet ensures that the apiUrl
points to the local server, avoiding the default API and preventing the "API key is malformed" error [1][2].
Details
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
from langchainjs.
You're still required to provide an API key even if running locally. Sign up for one here (free), and they'll send you an email with a key.
from langchainjs.
I understand that I need the key to use their API.
For the local instance I was able to run it locally without an API Key by using the docker setup. I literally just used stuff
, it's not a placeholder.
const loader = new UnstructuredLoader(`pdfs/${randomName}.pdf`, {
apiUrl: "http://localhost:8000/general/v0/general",
apiKey: "stuff",
strategy: "hi_res",
});
This issue was related to the local setup of Unstructured. According to docs you can run this docker command to start a local instance.
docker run -p 8000:8000 -d --rm --name unstructured-api quay.io/unstructured-io/unstructured-api:latest --port 8000 --host 0.0.0.0
To actually consume this instance you also have to add the apiUrl. I'm proposing adding this to the docs for people wanting to run unstructured locally:
apiUrl: "http://localhost:8000/general/v0/general",
from langchainjs.
Related Issues (20)
- DOC: Use /v0.2/docs/introduction/ as menu structure
- DOC: v0.2 pages link back to themselves HOT 2
- DOC: v0.2/docs/integrations/platforms Clarifications and Enhancements HOT 2
- Not able to add memory to Open AI Assistant HOT 19
- How to search the relevant rows from PostgreSQL by using LangChain? HOT 3
- ConversationalRetrievalQAChain - not enough parameters for query in Pinecone Index HOT 2
- Update Unstructured Docker Image Reference in Documentation HOT 2
- Failed to invoke a chain twice based on XataChatMessageHistory in the same session. HOT 4
- langchain-community/chat_models/Bedrock [Feature]: Agent with Tools using Bedrock Anthropic Claude new tools API HOT 1
- ChatWebLLM Initialization Failure Due To @mlc-ai/web-llm Refactoring HOT 5
- DOC: <Issue related to /v0.2/docs/integrations/chat/ollama_functions> HOT 1
- Swapping ChatOpenAI with AzureChatOpenAI fails when streaming HOT 9
- npm error when installing @langchain/community HOT 7
- Error TS2415: Class 'ChatOpenAI<CallOptions>' incorrectly extends base class 'BaseChatModel<CallOptions, AIMessageChunk>' HOT 6
- DOC: <Issue related to /v0.2/docs/integrations/llms/huggingface_inference/> HOT 1
- LangChain 0.2 adds LangChain 0.1 to node_modules HOT 2
- `ChatOpenAI.getLsParams` is protected (unlike `BaseChatModel` which it extends) making `ChatOpenAI` not assignable to `BaseChatModel` HOT 3
- Data going undefined HOT 3
- Typing issue with Pinecone HOT 2
- Passing Pinecone.Index to PineconeStore.fromExistingIndex broken after update HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langchainjs.