Commit 5a307f5
authored
feat(provider/google-vertex): allow using Gemini image models with
## Background
Follow-up to #12252 (which added Gemini image generation to the `google`
provider). This wasn't yet wired up for the `google-vertex` provider.
## Summary
- Adds Gemini image model support to `google-vertex`'s
`generateImage()`. When a `gemini-*` model ID is detected, the image
model internally delegates to `GoogleGenerativeAILanguageModel` with
`responseModalities: ['IMAGE']`, matching the approach used in the
`google` provider. Existing Imagen model behavior is unchanged.
- Includes docs for this new `generateImage` capability for
`google-vertex`
- Also improves provider options typing in both `google` and
`google-vertex` image models to use `satisfies
GoogleLanguageModelOptions`
## Manual Verification
Ran `google-vertex-gemini-image.ts` and
`google-vertex-gemini-editing.ts` examples against Vertex AI with real
credentials. Both image generation and image editing produce correct
results.
## Checklist
- [x] Tests have been added / updated (for bug fixes / features)
- [x] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
## Future Work
N/A
## Related Issues
Fixes #12452generateImage (#12502)1 parent e73beb8 commit 5a307f5
File tree
9 files changed
+637
-14
lines changed- .changeset
- content/providers/01-ai-sdk-providers
- examples/ai-functions/src/generate-image
- packages
- google-vertex/src
- google/src
9 files changed
+637
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 84 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
842 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
843 | 846 | | |
844 | 847 | | |
845 | 848 | | |
| |||
910 | 913 | | |
911 | 914 | | |
912 | 915 | | |
913 | | - | |
| 916 | + | |
914 | 917 | | |
915 | 918 | | |
916 | 919 | | |
| |||
919 | 922 | | |
920 | 923 | | |
921 | 924 | | |
922 | | - | |
| 925 | + | |
923 | 926 | | |
924 | 927 | | |
925 | 928 | | |
| |||
951 | 954 | | |
952 | 955 | | |
953 | 956 | | |
954 | | - | |
| 957 | + | |
955 | 958 | | |
956 | 959 | | |
957 | 960 | | |
| |||
982 | 985 | | |
983 | 986 | | |
984 | 987 | | |
985 | | - | |
| 988 | + | |
986 | 989 | | |
987 | 990 | | |
988 | 991 | | |
| |||
1013 | 1016 | | |
1014 | 1017 | | |
1015 | 1018 | | |
1016 | | - | |
| 1019 | + | |
1017 | 1020 | | |
1018 | 1021 | | |
1019 | 1022 | | |
| |||
1024 | 1027 | | |
1025 | 1028 | | |
1026 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1027 | 1104 | | |
1028 | 1105 | | |
1029 | 1106 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments