Skip to content

Conversation

@crekhari
Copy link
Contributor

Support document metadata

@linear
Copy link

linear bot commented Mar 31, 2025

QUO-898 Add documents metadata to detections endpoint

Allow users to pass metadata about their documents (e.g. as a dictionary). For example - Tavily mentioned they want to report where documents are being retrieved from.

continue;
} else if (typeof doc === 'object' && doc !== null) {
if (!this.isValidLogDocument(doc)) {
throw new ValidationError("Documents must be a list of strings or dictionaries with 'page_content' and optional 'metadata' keys. Metadata keys must be strings");
Copy link
Member

@freddiev4 freddiev4 Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user sees this error, what should they do about it?

Whenever we raise an exception we should tell the user what to do in response (as part of the exception message), otherwise they're going to fumble and have to read more docs, read source code, ignore completely, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some more actionable error msgs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Let’s make sure both messages are in sync in both clients

Copy link

@waldnzwrld waldnzwrld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update all tests related to logs to include your new type and verify the behaviour you have introduced.

@waldnzwrld waldnzwrld dismissed their stale review March 31, 2025 17:37

Tests have been added and my initial feedback has been tackled

Copy link

@waldnzwrld waldnzwrld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @crekhari

@waldnzwrld
Copy link

@crekhari would you mind updating the example_logs.ts file for the new documents format as well. 😁

@crekhari
Copy link
Contributor Author

crekhari commented Apr 1, 2025

@crekhari would you mind updating the example_logs.ts file for the new documents format as well. 😁

Fixed! Ill cut a new release after lunch. Lmk if theres any other changes needed

@crekhari crekhari merged commit 230e1b1 into main Apr 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants