- VertexApiError gains a serde-skipped retry_after field, filled from the
Retry-After header. VertexApiError::retry_delay() prefers RetryInfo and
falls back to it, so a JSON 429 without RetryInfo still exposes the
header delay.
- parse_retry_after rejects anything but ASCII digits; u64::from_str
alone accepted a leading '+'.
- Client tests share mock_client/http_response helpers instead of
repeating the mock server setup in every test.
Error::HttpStatus gains a retry_after field, filled from the response's
Retry-After header (delay-seconds form) before the body is consumed.
Error::retry_delay() now returns it for HttpStatus errors, so a 429 or
503 with a non-Vertex body still exposes the server's retry hint.
Closes#21
- Drop the unreachable checked_mul in parse_duration; a fraction of at
most 9 digits scaled to nanoseconds always fits in a u32.
- Share a vertex_error test helper in error.rs instead of building
VertexApiError inline.
- Bump version to 0.2.0 for the breaking VertexApiError.details change.
VertexApiError.details is now Option<Vec<serde_json::Value>> so that
unknown google.rpc.* detail types (e.g. RetryInfo, QuotaFailure) no
longer break deserialization and fall back to Error::HttpStatus. The
unused ErrorType, ErrorInfoMetadata, FieldViolation and Link types are
removed.
Add VertexApiError::retry_delay() which parses the protobuf duration in a
google.rpc.RetryInfo entry, and Error::retry_delay() which delegates to it.
Closes#19
Check response.status() before building the SSE event stream. On non-success
status, parse the response body as GenerateContentResponseError when
possible (returning Error::VertexError), and fall back to Error::HttpStatus
with the status code and raw text. Adds tests for HTTP 400 Vertex error,
non-JSON HTTP 500 error, and successful 200 SSE streaming.
- Introducues generate_content_stream that returns a Tokio Steam instead
of a Queue. This allows using the standard stream APIs from
tokio-streams.
- Replace future-utils with tokio-streams, mainly due to better
ergonomics for using the filter_map stream combinator.
- Add base code for the Vertex API with types and a client with helper
methods for prompting text and conversation.
- Add examples for prompting text and conversation.