Skip to content
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

Add search cutoffs, null handing, and refresh API reference #331

Merged
merged 14 commits into from
Oct 9, 2024

Conversation

pwoznic
Copy link
Contributor

@pwoznic pwoznic commented Sep 25, 2024

Added information about search cutoffs, handling null values, and regenerated the API reference.

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for luxury-shortbread-acee05 ready!

Name Link
🔨 Latest commit 66d19c5
🔍 Latest deploy log https://app.netlify.com/sites/luxury-shortbread-acee05/deploys/6706ce41820ab700087f1250
😎 Deploy Preview https://deploy-preview-331--luxury-shortbread-acee05.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pwoznic pwoznic marked this pull request as ready for review September 25, 2024 22:33
@@ -55,12 +68,120 @@ this simplified example intentionally omits several parameter values.
"enable_factual_consistency_score": true
}
```

:::tip
Copy link
Contributor

Choose a reason for hiding this comment

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

Small nit: when I read something like "you can also enable reranking in the Vectara console..." it may be confusing in the sense that I ask myself: "if I enable it in console, does that affect my application?". Of course the answer is not, but I wonder if we can rephrase it to reiterate the message that console is for exploration, experimentation, etc with the API. but it ultimately of course the API call itself is what makes it happen.


1. Applies score cutoff, if specified.
2. Reranks all input results based on the selected reranker.
3. Eliminates results that return null scores.
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the cases where this might be happening? How would a developer know if any results return NULL scores?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I should have explained this better, null scores are only returned deliberately by user functions. So if you want to eliminate some search results, have a udf return null (say apply a metadata filter)

"rerankers": [
{
"type": "userfn",
"user_function": "get('$.document_metadata.category') === 'blog' ? get('$.score') : null",
Copy link
Contributor

Choose a reason for hiding this comment

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

So maybe this is related to my question about NULL above - is this the only use-case, where my UDF decided to return NULL?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes this is the only case where scores will be eliminated (aside from cutoffs and limits)

Copy link
Contributor

Choose a reason for hiding this comment

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

@husseinVectara are these ? and : operators implemented now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please correct this to:
"if (get('$.document_metadata.category') == 'blog') get('$.score') else null"

Added information about the cutoffs parameter and improved verbiage around the multilingual reranker
Needed to update this otherwise it would not start locally
@pwoznic
Copy link
Contributor Author

pwoznic commented Oct 4, 2024

There were several conflicts so trying to sort it out. May take more commits.

Regenerated the API docs again
I noticed some duplicate headings and sentences
@pwoznic pwoznic merged commit e397d75 into vectara:main Oct 9, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants