Repository navigation
docs(examples): demonstrate a cited public documentation lookup - #2417
Open
georgeatparallel wants to merge 2 commits into
Open
georgeatparallel wants to merge 2 commits into
georgeatparallel wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
The function-calling walkthrough demonstrates a dummy weather tool and citations against supplied text, but does not show how a local application can retrieve public documentation and carry an original source URL into its answer.
Add an independent native API section for one explicit public documentation lookup through Parallel MCP. The lookup is disabled by default, accepts no generated query input, sends only the fixed public objective and keywords, and returns at most two sources with bounded excerpts. It checks the local function call, retains its native tool-call ID, and rejects a final citation that is absent from the returned sources. Empty and unavailable retrieval end without generating a sourced answer. Existing cells remain unchanged.
The generic function-calling formatter omits tool-role content, so the example retains the tool response in the transcript and also supplies that same bounded evidence in a follow-up user message for the final completion. The answer schema uses ordinary string fields. No new dependencies or library/server settings are required. See Parallel MCP setup for the service details.
Parallel affiliation: this contribution is submitted on behalf of Parallel and was prepared with AI assistance.
Validation at
e909d7a1c57c59dd93774ec50861f32913a7826aon Linux x86_64 CPU, Python 3.12.12, with the source build and pinned vendor submodule:make testpassed the full stock suite: 39 tests, no skips.make lintpassed.python -m pytest -q tests/test_functions_notebook.pypassed all 13 fixture cases, including the disabled/no-tool, empty, unavailable, rejected-call and citation checks. These cases use local doubles and make no external requests.https://docs.python.org/3/library/tomllib.html, an exact returned source URL. Excerpt provenance was checked against the live response. The expected fact and URL were not passed to generation.A fresh independent review inspected the same unchanged commit and separately passed the fixture, lint, notebook preservation, and native live/default checks.