Skip to content

bug: Retrieval function fails because window is undefined #4876

@k1c14k

Description

@k1c14k

Jan version

0.5.16

Describe the Bug

When asked to generate answer based on PDF, document is not included.

Steps to Reproduce

  1. Setup RAG
  2. Use it
  3. Observe it fails

Screenshots / Logs

(node:7552) UnhandledPromiseRejectionWarning: ReferenceError: window is not defined
    at Retrieval.updateEmbeddingEngine (/home/<redacted>/.config/Jan/data/extensions/@janhq/assistant-extension/dist/node/index.js:82281:18)
    at Object.toolRetrievalIngestNewDocument (/home/<redacted>/.config/Jan/data/extensions/@janhq/assistant-extension/dist/node/index.js:82330:12)
    at invokeExtensionFunc (/opt/Jan/resources/app.asar/node_modules/@janhq/core/dist/node/index.cjs.js:658:70)
    at Extension.process (/opt/Jan/resources/app.asar/node_modules/@janhq/core/dist/node/index.cjs.js:653:10)
    at RequestAdapter.process (/opt/Jan/resources/app.asar/node_modules/@janhq/core/dist/node/index.cjs.js:862:57)
    at /opt/Jan/resources/app.asar/node_modules/@janhq/core/dist/node/index.cjs.js:879:56
    at /opt/Jan/resources/app.asar/build/handlers/common.js:53:52
    at step (/opt/Jan/resources/app.asar/build/handlers/common.js:33:23)
    at Object.next (/opt/Jan/resources/app.asar/build/handlers/common.js:14:53)
    at /opt/Jan/resources/app.asar/build/handlers/common.js:8:71
(node:7552) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

What is your OS?

  • MacOS
  • Windows
  • Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    QA

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions