Add doc.go with package-level godoc for all 15 packages, runnable
example functions for chat completion, streaming, embeddings, and
error handling, plus build-tagged integration tests for live API
validation.
Library management with 17 service methods covering full CRUD for
libraries and documents, multipart upload, text content extraction,
processing status, signed URLs, reprocessing, and sharing management.
Agents lifecycle: create, get, list, update, delete, version switching,
version listing, aliases (set/list/delete). Agent types include tools
(function, web_search, code_interpreter, etc.), guardrails, completion
args. Moderation: text + chat endpoints with categories and scores.
Classification: text + chat endpoints with target result scores.
Add retry logic to all HTTP methods:
- doRetry() core loop with configurable max retries
- Exponential backoff with 0.5-1.5x jitter
- Retry-After header support (seconds and HTTP-date)
- Retry on 429 and 5xx; no retry on 4xx client errors
- Context cancellation respected during retry delays
- Multipart uploads also retry via doRetry()
- 9 new tests: 429/500 recovery, exhaustion, no-retry-on-400, backoff math