Skip to main content

venice_ai.resources.augment

Venice AI Augment API resources.

Wraps the three /augment/* endpoints described at api-reference/endpoint/augment/:

  • POST /augment/scrape — fetch a URL as markdown
  • POST /augment/search — web search (Brave or Google)
  • POST /augment/text-parser — extract text from uploaded PDF/DOCX/XLSX/TXT

The Venice docs mark this API as experimental — request and response shapes may change without notice.

Augment Objects

class Augment(APIResource["VeniceClient"])

Provides access to Venice's Augment (web-scrape / search / text-parse) API.

Augment.scrape

async def scrape(*, url: str) -> AugmentScrapeResponse

Fetch a URL and return its contents as markdown.

Arguments:

  • url (str): Publicly accessible URL to scrape. Must start with http:// or https://.

Raises:

  • venice_ai.exceptions.APIError: If the target site blocks automated access (e.g. X/Twitter, Reddit) or another error occurs.

Example:

async with VeniceClient() as client:
result = await client.augment.scrape(url="https://example.com")
print(result.content)

Returns:

AugmentScrapeResponse: :class:AugmentScrapeResponse with url, content, and format.

Augment.search

async def search(
*,
query: str,
limit: int | None = None,
search_provider: Literal["brave", "google"] | None = None
) -> AugmentSearchResponse

Run a web search and return structured results.

Arguments:

  • query (str): Search query (1–400 chars).
  • limit (Optional[int]): Maximum number of results (1–20, default 10).
  • search_provider (Optional[Literal["brave", "google"]]): "brave" (default; ZDR privacy) or "google" (proxied / anonymised).

Returns:

`AugmentSearchResponse Example:

async with VeniceClient() as client:
response = await client.augment.search(
query="latest news about AI",
limit=5,
)
for r in response.results:
print(r.title, r.url)`: :class:`AugmentSearchResponse` with ``query`` and ``results``.

Augment.parse_text

async def parse_text(
*,
file: str | bytes | BinaryIO | Path,
response_format: Literal["json", "text"] = "json",
content_type: str | None = None,
filename: str | None = None) -> AugmentTextParserResponse | str

Extract text from a document file (PDF, DOCX, PPTX, XLSX, TXT).

Arguments:

  • file (Union[str, bytes, BinaryIO, Path]): File to parse. Can be a path (str / :class:~pathlib.Path), raw bytes, or any binary file-like object.
  • response_format (Literal["json", "text"]): "json" (default) returns an :class:AugmentTextParserResponse with text and tokens. "text" returns the extracted text as a plain str.
  • content_type (Optional[str]): Optional MIME type override for the upload. When None (default) the SDK derives it from the file extension, falling back to magic-byte sniffing for bytes / BinaryIO inputs without a recognised extension. Pass this explicitly when uploading raw bytes with no filename hint.
  • filename (Optional[str]): Optional filename hint for bytes / BinaryIO inputs. Used both for the multipart filename field and to derive content_type from the extension when the latter is not given. Ignored when file is a path.

Raises:

  • ValueError: If the file path is invalid or unreadable.
  • venice_ai.exceptions.APIError: If the API request fails. Example:
async with VeniceClient() as client:
# path: extension carries the type
parsed = await client.augment.parse_text(file="report.pdf")

# raw bytes: pass either content_type or a filename hint
with open("report.pdf", "rb") as f:
parsed = await client.augment.parse_text(
file=f.read(),
content_type="application/pdf",
)
print(parsed.text, parsed.tokens)

Returns:

Either :class:AugmentTextParserResponse or plain str depending on response_format.