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 markdownPOST /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 withhttp://orhttps://.
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), rawbytes, or any binary file-like object.response_format(Literal["json", "text"]):"json"(default) returns an :class:AugmentTextParserResponsewithtextandtokens."text"returns the extracted text as a plainstr.content_type(Optional[str]): Optional MIME type override for the upload. WhenNone(default) the SDK derives it from the file extension, falling back to magic-byte sniffing forbytes/BinaryIOinputs without a recognised extension. Pass this explicitly when uploading raw bytes with no filename hint.filename(Optional[str]): Optional filename hint forbytes/BinaryIOinputs. Used both for the multipart filename field and to derivecontent_typefrom the extension when the latter is not given. Ignored whenfileis 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.