Commit a6ef5cf
feat: add Vertex AI support for all providers (#135)
* feat: add Vertex AI support for all providers
Route requests through Vertex AI when GoogleADC auth is provided.
Supports Google, Anthropic, Mistral, and DeepSeek providers across
text, images, and videos modalities. Includes Veo polling fix
(fetchPredictOperation), error handler hardening, Gemini image
role fix, and DeepSeek usage parser fix.
WIP: Veo Vertex inline video (bytesBase64Encoded) parsing not yet
handled — needs base64 decoding or storageUri in request.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ci): install gcp extra so Vertex routing tests can import google-auth
The google-auth package is optional under [gcp], but unit tests in
test_vertex_routing.py and Vertex integration tests need it importable.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(veo): handle Vertex inline bytesBase64Encoded and videoGcsUri key mismatch
Vertex Veo responses use videoGcsUri (not uri/gcsUri) and can return
inline base64 instead of a GCS URL. Normalize the key and decode
inline responses directly into VideoArtifact.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(embeddings): adapt request/response format for Vertex :predict endpoint
Vertex embeddings uses :predict with instances format, not :embedContent.
Build correct request body in _init_request when auth is GoogleADC, and
parse predictions response format in _parse_content. Add integration test.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: fix trailing newlines in workflow files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(vertex): move embeddings auth to provider mixin, rename VertexEndpoint, update templates
- Move isinstance(self.auth, GoogleADC) check from modality _init_request() to
provider mixin _make_request() for embeddings, keeping auth logic in provider layer
- Fix misplaced class docstring in GoogleEmbeddingsClient mixin
- Rename VertexEndpoint to VertexGenerateContentEndpoint for consistency with
VertexImagenEndpoint, VertexEmbeddingsEndpoint, etc.
- Add Vertex AI routing patterns (commented) to provider templates
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(vertex): centralize URL building in GoogleADC.build_url()
Move duplicated project_id validation, base URL resolution, and endpoint
formatting from 7 provider _build_url() methods into GoogleADC.build_url().
Also remove manual base64.b64decode from video client (Artifact validator
handles it).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(images): let Artifact validator handle base64 decoding in Gemini images
Same pattern as the video client fix - pass base64 string directly to
ImageArtifact(data=...) instead of manual base64.b64decode().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(images): let Artifact validator handle base64 decoding in Imagen
Same pattern as Gemini images and Veo video fixes - pass base64 string
directly to ImageArtifact(data=...) instead of manual base64.b64decode().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent af37ace commit a6ef5cf
File tree
32 files changed
+1093
-61
lines changed- .github/workflows
- src/celeste
- modalities
- images/providers/google
- videos/providers/google
- providers
- anthropic/messages
- deepseek/chat
- google
- cloud_tts
- embeddings
- generate_content
- imagen
- veo
- mistral/chat
- templates/providers/{provider_slug}/src/celeste_{provider_slug}/{api_slug}
- tests
- integration_tests
- embeddings
- images
- text
- videos
- unit_tests
32 files changed
+1093
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
| 299 | + | |
| 300 | + | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
65 | | - | |
| 63 | + | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
65 | | - | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
70 | 80 | | |
71 | | - | |
| 81 | + | |
72 | 82 | | |
73 | 83 | | |
74 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
35 | 57 | | |
36 | 58 | | |
37 | 59 | | |
| |||
85 | 107 | | |
86 | 108 | | |
87 | 109 | | |
88 | | - | |
| 110 | + | |
89 | 111 | | |
90 | 112 | | |
91 | 113 | | |
| |||
111 | 133 | | |
112 | 134 | | |
113 | 135 | | |
114 | | - | |
| 136 | + | |
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
0 commit comments