Download examples/quickstart.py from Angshul/Bayesian_LangChain: direct link, hf CLI and curl.
- Browser
- Download file 515 Bytes
-
https://huggingface.co/Angshul/Bayesian_LangChain/resolve/main/examples/quickstart.py
- Command line
-
hf download hf://Angshul/Bayesian_LangChain/examples/quickstart.py
-
curl -L -o quickstart.py https://huggingface.co/Angshul/Bayesian_LangChain/resolve/main/examples/quickstart.py
515 Bytes
| from bayesian_langchain import BayesianIndex, BayesianRAG, DocumentRecord | |
| docs = [ | |
| DocumentRecord("official", "The current HR portal is PeopleHub.", "Current policy", "official", {"reliability_alpha":18,"reliability_beta":2,"authority":0.98,"freshness":1.0}), | |
| DocumentRecord("legacy", "The HR portal is WorkSphere.", "Legacy guide", "cache", {"reliability_alpha":6,"reliability_beta":6,"authority":0.45,"freshness":0.18}), | |
| ] | |
| print(BayesianRAG(BayesianIndex(docs)).invoke("What is the current HR portal?")) | |