Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive, hands-on tutorial for Vectara Chat for bounty issue #462. It teaches readers how to build a complete grounded chat experience with Vectara in Python, written in the first-person tutorial style used across the repo.
File:
tutorials/en/vectara-chat-tutorial-build-a-grounded-chatbot-with-citations-in-python.mdx(~2,800 words)What the tutorial covers
Following the structure recommended in the issue:
[1], conversation memory, and the factual consistency score; links to the required Vectara Beginner App Tutorial and Vectara Advanced App TutorialVECTARA_API_KEYenvironment variable, virtualenv,pip install vectara, and creating a first corpus withclient.corpora.createCoreDocument/client.upload.file(PDFs), single-shot grounded Q&A withclient.query, printing[1]-style citations mapped tosearch_results, and multi-turn memory withcreate_chat_session+ChatParameters(store=True)lexical_interpolation,context_configuration, reranking (CustomerSpecificReranker),response_language(ISO 639-3),max_used_search_results,max_response_characters,generation_preset_name(Mockingbird),CitationParameters, factual consistency gating, and streaming withquery_streamapp.pyusing the chat session, three concrete test cases (grounded / follow-up / out-of-scope), and deployment withrequirements.txt+ Streamlit Community CloudHow API accuracy was verified
All code and parameters were checked against official, current sources before writing:
corpus_key,response_languagecodes): https://docs.vectara.com/docs/migration-guide-api-v2VECTARA_API_KEY,x-api-keyauth, Mockingbird preset,[1], [2]citations, factual consistency score): https://docs.vectara.com/docs/quickstartx-api-keyheader, permission profiles): https://docs.vectara.com/docs/security/authentication/api-key-managementcreate_chat_session,session.chat,ChatParameters): https://docs.vectara.com/docs/sdk/python/chatsPOST /v2/corpora/{corpus_key}/upload_file): Vectara REST API v2 referencevectaraSDK (PyPI, v0.4.3): https://pypi.org/project/vectara/ and https://github.com/vectara/python-sdkAdditionally, every SDK class, field name, and method signature used in the tutorial (
SearchCorporaParameters,KeyedSearchCorpus,ContextConfiguration,CustomerSpecificReranker,GenerationParameters,CitationParameters,ChatParameters,QueryFullResponse.summary/search_results/factual_consistency_score,CreateTurnsChatsResponse.chat_id/answer/turn_id,client.query,client.query_stream,client.create_chat_session,session.chat,client.corpora.create,client.documents.create,client.upload.file) was verified against the installed SDK v0.4.3 locally, so all samples are runnable as written.Note: this tutorial intentionally uses the current v2 API / official Python SDK, which differentiates it from the existing
vectara-chat-essentialstutorial in this repo that uses the older v1 request style./claim #462