ciocan / langchain-chat-with-documents Goto Github PK
View Code? Open in Web Editor NEWChat with documents (pdf, docx, txt) using ChatGPT and Langchain
License: MIT License
Chat with documents (pdf, docx, txt) using ChatGPT and Langchain
License: MIT License
data: '{"model":"gpt-3.5-turbo","temperature":1,"top_p":1,"frequency_penalty":0,"presence_penalty":0,"n":1,"stream":false,"messages":[{"role":"user","content":"Given the following conversation and a follow up question, rephrase the follow up question to be a standalone question.\n\nChat History:\n 你知道robomaster 嘛?\nFollow Up Input: 你知道robomaster 嘛?\nStandalone question:"}]}',
url: 'https://api.openai.com/v1/chat/completions'
},
code: 'ERR_NETWORK',
request: Request {
[Symbol(realm)]: { settingsObject: [Object] },
[Symbol(state)]: {
method: 'POST',
localURLsOnly: false,
unsafeRequest: false,
body: [Object],
client: [Object],
reservedClient: null,
replacesClientId: '',
window: 'client',
keepalive: false,
serviceWorkers: 'all',
initiator: '',
destination: '',
priority: null,
origin: 'client',
policyContainer: 'client',
referrer: 'client',
referrerPolicy: '',
mode: 'cors',
useCORSPreflightFlag: false,
credentials: 'same-origin',
useCredentials: false,
cache: 'default',
redirect: 'follow',
integrity: '',
cryptoGraphicsNonceMetadata: '',
parserMetadata: '',
reloadNavigation: false,
historyNavigation: false,
userActivation: false,
taintedOrigin: false,
redirectCount: 0,
responseTainting: 'basic',
preventNoCacheCacheControlHeaderModification: false,
done: false,
timingAllowFailed: false,
headersList: [HeadersList],
urlList: [Array],
url: [URL]
},
[Symbol(signal)]: AbortSignal { aborted: false },
[Symbol(headers)]: HeadersList {
cookies: null,
[Symbol(headers map)]: [Map],
[Symbol(headers map sorted)]: null
}
},
response: undefined,
isAxiosError: true,
toJSON: [Function: toJSON],
attemptNumber: 7,
retriesLeft: 0
}
❌ tRPC failed on chat.prompt: Something went wrong
I wrote a guide here with a rough interface to use langchain with ollama
I have all the packages up to date, review my Weaviate, cloudflare and OpenAI API. Everything seems to be correct.
I see in cloudflare that the files are correctly uploaded.
This is the error in console when uploading a .txt simple file:
`- ready started server on 0.0.0.0:3000, url: http://localhost:3000
Error: 'Error in addDocuments' FetchError: request to https://https//chappyhome-ea1f2qjp.weaviate.network%20#%20do%20not%20use%20https://%20just%20the%20domain%20like%20bellingcat-xxx.weaviate.network/v1/batch/objects failed, reason: getaddrinfo ENOTFOUND https
at WeaviateStore.addVectors (file:///root/ai/langchain-chat-with-documents/node_modules/langchain/dist/vectorstores/weaviate.js:103:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WeaviateStore.fromDocuments (file:///root/ai/langchain-chat-with-documents/node_modules/langchain/dist/vectorstores/weaviate.js:155:9)
at async eval (webpack-internal:///(api)/./src/server/api/routers/weaviate.ts:80:13)
at async resolveMiddleware (file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/index.mjs:416:30)
at async callRecursive (file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/index.mjs:452:32)
at async callRecursive (file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/index.mjs:452:32)
at async resolve (file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/index.mjs:482:24)
at async file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/resolveHTTPResponse-e1286cb3.mjs:87:32
at async Promise.all (index 0)
at async resolveHTTPResponse (file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/resolveHTTPResponse-e1286cb3.mjs:84:28)
at async file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/nodeHTTPRequestHandler-f0efcff4.mjs:32:24
at async file:///root/ai/langchain-chat-with-documents/node_modules/@trpc/server/dist/adapters/next.mjs:42:9
❌ tRPC failed on weaviate.index: Failed to index document
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.