From 489d21e5dc838c99b77b6f038edde81e812dbad5 Mon Sep 17 00:00:00 2001 From: genozc Date: Fri, 4 Dec 2026 05:31:54 +0800 Subject: [PATCH] docs(sdk): document the docs namespace return shapes The examples assign docs.search / docs.read / docs.ask without reading fields and never show what comes back, so the first run reads as an empty result. Document the verified shapes: search -> { results: [{title, url, excerpt}] }, read -> { url, markdown }, ask -> { answer, sources }. --- docs/sdk.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/sdk.md b/docs/sdk.md index 345c46a..cb0a89d 100644 --- a/docs/sdk.md +++ b/docs/sdk.md @@ -48,6 +48,12 @@ const page = await vapi.docs.read("/agents/quickstart"); const answer = await vapi.docs.ask("How do agent spend caps work?"); ``` +The docs namespace returns plain objects: `docs.search` returns +`{ results: [{ title, url, excerpt }] }`, `docs.read` returns +`{ url, markdown }` with the page's Markdown, and `docs.ask` returns +`{ answer, sources }`. The examples above assign them without reading +fields, which is easy to misread as an empty result. + Lower-level code can import `searchDocs`, `readDocs` and `askDocs` directly from `@vapi-network/core`. Documentation reads are restricted to the configured docs origin, which defaults to `https://docs.vapinetwork.ai` and can be changed