Skip to content

docs(examples): demonstrate a cited public documentation lookup - #2417

Open
georgeatparallel wants to merge 2 commits into
abetlen:mainfrom
georgeatparallel:george/parallel-mcp-llama-cpp-python-e5894bab
Open

georgeatparallel wants to merge 2 commits into
abetlen:mainfrom
georgeatparallel:george/parallel-mcp-llama-cpp-python-e5894bab

Conversation

@georgeatparallel

Copy link
Copy Markdown

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 e909d7a1c57c59dd93774ec50861f32913a7826a on Linux x86_64 CPU, Python 3.12.12, with the source build and pinned vendor submodule:

  • make test passed the full stock suite: 39 tests, no skips.
  • make lint passed.
  • python -m pytest -q tests/test_functions_notebook.py passed 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.
  • Executed the new notebook section with real native inference in both default and enabled modes. The default made no HTTP requests. The enabled run used live anonymous Parallel retrieval, observed the product User-Agent, retained the actual native tool-call ID, and produced “Python version 3.11” with 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.

This branch has not been deployed

No deployments
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.

1 participant