chunks retrieval issue
getting this error while fetching chunks,
const context = await dewy.kb.retrieveChunks({
collection: process.env.DEWY_COLLECTION ?? "stablelm",
query: query,
n: 10,
});
ERROR:
⨯ TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11731:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async globalThis.fetch (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:57569)
at async sendRequest (webpack-internal:///(rsc)/./node_modules/dewy-ts/dist/core/request.js:172:12)
at async eval (webpack-internal:///(rsc)/./node_modules/dewy-ts/dist/core/request.js:252:34) {
cause: Error: unknown scheme
at makeNetworkError (node:internal/deps/undici/undici:5002:35)
at schemeFetch (node:internal/deps/undici/undici:9857:18)
at node:internal/deps/undici/undici:9727:26
at mainFetch (node:internal/deps/undici/undici:9746:11)
at fetching (node:internal/deps/undici/undici:9694:7)
at fetch (node:internal/deps/undici/undici:9558:20)
at Object.fetch (node:internal/deps/undici/undici:11729:18)
at fetch (node:internal/process/pre_execution:281:25)
at R (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:342633)
at M (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:61456)
at C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63607
at C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\server\lib\trace\tracer.js:133:36
at NoopContextManager.with (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\@opentelemetry\api\index.js:1:7062)
at ContextAPI.with (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\@opentelemetry\api\index.js:1:518)
at NoopTracer.startActiveSpan (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\@opentelemetry\api\index.js:1:18093)
at ProxyTracer.startActiveSpan (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\@opentelemetry\api\index.js:1:18854)
at C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\server\lib\trace\tracer.js:122:103
at NoopContextManager.with (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\@opentelemetry\api\index.js:1:7062)
at ContextAPI.with (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\@opentelemetry\api\index.js:1:518)
at NextTracerImpl.trace (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\server\lib\trace\tracer.js:122:28)
at globalThis.fetch (C:\Users\Administrator\Downloads\chat_dewy\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:57593)
at sendRequest (webpack-internal:///(rsc)/./node_modules/dewy-ts/dist/core/request.js:172:18)
at eval (webpack-internal:///(rsc)/./node_modules/dewy-ts/dist/core/request.js:252:64)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
How dod you configure the Dewy client? The "unknown scheme" makes me think that it was configured to connect to localhost:port instead of http://localhost:port, perhaps. Any more information on the code you're using for the connection?
yes configured as localhost:port, on configuring http://localhost:port, it gives error
cause: Error: connect ECONNREFUSED ::1:8000 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '::1', port: 8000 } }
Also, in http://localhost:8000/admin/#/search.... I am unable to search and getting the following error,
POST http://localhost:8000/api/chunks/retrieve 422 (Unprocessable Entity)
the problem seems to be with the collection in the code below.... in the example you are using collection_id.... but in the code below its collection only.
const context = await dewy.kb.retrieveChunks({ collection: process.env.DEWY_COLLECTION ?? "stablelm", query: query, n: 10, });
What versions of Dewy and Dewy Client are you using? Did you intsall from Docker or PIP, etc.? This is likely a version mismatch issue.