-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
810: Session vs non-session routes #811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmarsh-scottlogic Ah yes sorry, you'll need to replace your backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works a charm
Note to self: will pull out the integration test changes plus the debugging log line in langchain.ts, cos it just complicates things elsewhere. |
asRetriever() { | ||
mockAsRetriever(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmarsh-scottlogic It seemed unnecessary to create a class, so I inlined it below.
@@ -28,6 +28,7 @@ async function getDocuments(filePath: string) { | |||
'.csv': (path: string) => new CSVLoader(path), | |||
}); | |||
const docs = await loader.load(); | |||
console.debug(`${docs.length} documents found`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the line that exposed we weren't stubbing the loader to return anything. So I simply added that in my test changes. I'm happy for this line to be removed if you wish, it's not all that important any longer.
mockRetrievalQAChain.call.mockReset(); | ||
mockFromLLM.mockReset(); | ||
mockFromTemplate.mockReset(); | ||
mockLoader.mockReset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you use mockClear()
instead and then not have to do mockLoader.mockResolvedValue([]);
in the beforeEach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
9e67edf
to
1e62b9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lovely
Description
We need to split API routes into session and non-session endpoints, so that we are not generating or noop-updating the session when we don't need to. This is particularly important for cloud deployment, where our load-balancer hits our healthcheck every 30secs, creating a new session every time 😱
Resolves #810
Checklist
Have you done the following?