[go: nahoru, domu]

Skip to content

Commit

Permalink
refactor how we pass in the gemini key (#2987)
Browse files Browse the repository at this point in the history
* refactor how we pass in the gemini key

* update the pub deps for the beta channel
  • Loading branch information
devoncarew committed Jun 10, 2024
1 parent 59f503c commit 4275e5c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
2 changes: 0 additions & 2 deletions pkgs/dart_services/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG PROJECT_ID
ARG FLUTTER_CHANNEL
ARG BUILD_SHA
ARG GOOGLE_API_KEY

FROM gcr.io/$PROJECT_ID/flutter:$FLUTTER_CHANNEL

Expand All @@ -17,7 +16,6 @@ RUN dart compile exe bin/server.dart -o bin/server
RUN dart run grinder build-project-templates

ENV BUILD_SHA=$BUILD_SHA
ENV GOOGLE_API_KEY=$GOOGLE_API_KEY

EXPOSE 8080
CMD ["/app/bin/server"]
4 changes: 2 additions & 2 deletions pkgs/dart_services/lib/src/common_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ class CommonServerApi {
return ok(version().toJson());
}

static final String? googleApiKey = Platform.environment['GOOGLE_API_KEY'];
static final String? geminiApiKey = Platform.environment['GEMINI_API_KEY'];
http.Client? geminiHttpClient;

@Route.post('$apiPrefix/_gemini')
Future<Response> gemini(Request request, String apiVersion) async {
if (apiVersion != api3) return unhandledVersion(apiVersion);

// Read the api key from env variables (populated on the server).
final apiKey = googleApiKey;
final apiKey = geminiApiKey;
if (apiKey == null) {
return Response.internalServerError(
body: 'gemini key not configured on server');
Expand Down
48 changes: 25 additions & 23 deletions pkgs/dart_services/tool/dependencies/pub_dependencies_beta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"_fe_analyzer_shared": "67.0.0",
"analyzer": "6.4.1",
"_fe_analyzer_shared": "68.0.0",
"analyzer": "6.5.0",
"animations": "2.0.11",
"archive": "3.6.1",
"args": "2.5.0",
Expand All @@ -26,11 +26,11 @@
"fast_immutable_collections": "10.2.4",
"ffi": "2.1.2",
"file": "7.0.0",
"flame": "1.17.0",
"flame_fire_atlas": "1.5.1",
"flame_forge2d": "0.18.0",
"flame": "1.18.0",
"flame_fire_atlas": "1.5.2",
"flame_forge2d": "0.18.1",
"flame_splash_screen": "0.3.0",
"flame_tiled": "1.20.1",
"flame_tiled": "1.20.2",
"flutter_adaptive_scaffold": "0.1.11",
"flutter_bloc": "8.1.5",
"flutter_hooks": "0.20.5",
Expand All @@ -43,7 +43,7 @@
"glob": "2.1.2",
"go_router": "14.1.4",
"google_fonts": "6.2.1",
"google_generative_ai": "0.4.2",
"google_generative_ai": "0.4.3",
"hooks_riverpod": "2.5.1",
"html": "0.15.4",
"http": "1.2.1",
Expand All @@ -53,17 +53,18 @@
"io": "1.0.4",
"js": "0.7.1",
"latlong2": "0.9.1",
"leak_tracker": "10.0.4",
"leak_tracker_flutter_testing": "3.0.3",
"leak_tracker": "10.0.5",
"leak_tracker_flutter_testing": "3.0.5",
"leak_tracker_testing": "3.0.1",
"lints": "4.0.0",
"lists": "1.0.1",
"logger": "2.3.0",
"logging": "1.2.0",
"macros": "0.1.0-main.5",
"markdown": "7.2.2",
"matcher": "0.12.16+1",
"material_color_utilities": "0.8.0",
"meta": "1.12.0",
"material_color_utilities": "0.11.1",
"meta": "1.14.0",
"mgrs_dart": "2.0.0",
"mime": "1.0.5",
"nested": "1.0.0",
Expand All @@ -73,7 +74,7 @@
"path": "1.9.0",
"path_parsing": "1.0.1",
"path_provider": "2.1.3",
"path_provider_android": "2.2.4",
"path_provider_android": "2.2.5",
"path_provider_foundation": "2.4.0",
"path_provider_linux": "2.2.1",
"path_provider_platform_interface": "2.1.2",
Expand All @@ -92,7 +93,7 @@
"rohd_vf": "0.5.0",
"rxdart": "0.27.7",
"shared_preferences": "2.2.3",
"shared_preferences_android": "2.2.2",
"shared_preferences_android": "2.2.3",
"shared_preferences_foundation": "2.4.0",
"shared_preferences_linux": "2.3.2",
"shared_preferences_platform_interface": "2.3.2",
Expand All @@ -101,7 +102,7 @@
"shelf": "1.4.1",
"shelf_packages_handler": "3.0.2",
"shelf_static": "1.1.2",
"shelf_web_socket": "1.0.4",
"shelf_web_socket": "2.0.0",
"source_map_stack_trace": "2.1.1",
"source_maps": "0.10.12",
"source_span": "1.10.0",
Expand All @@ -110,15 +111,15 @@
"stream_channel": "2.1.2",
"string_scanner": "1.2.0",
"term_glyph": "1.2.1",
"test": "1.25.2",
"test_api": "0.7.0",
"test_core": "0.6.0",
"test": "1.25.5",
"test_api": "0.7.1",
"test_core": "0.6.2",
"tiled": "0.10.2",
"timezone": "0.9.3",
"typed_data": "1.3.2",
"unicode": "0.3.1",
"url_launcher": "6.2.6",
"url_launcher_android": "6.3.2",
"url_launcher": "6.3.0",
"url_launcher_android": "6.3.3",
"url_launcher_ios": "6.3.0",
"url_launcher_linux": "3.1.1",
"url_launcher_macos": "3.2.0",
Expand All @@ -130,16 +131,17 @@
"vector_graphics_compiler": "1.1.11+1",
"vector_math": "2.1.4",
"video_player": "2.8.6",
"video_player_android": "2.4.14",
"video_player_android": "2.5.0",
"video_player_avfoundation": "2.6.1",
"video_player_platform_interface": "6.2.2",
"video_player_web": "2.3.1",
"vm_service": "14.2.1",
"vm_service": "14.2.2",
"watcher": "1.1.0",
"web": "0.5.1",
"web_socket_channel": "2.4.5",
"web_socket": "0.1.5",
"web_socket_channel": "3.0.0",
"webkit_inspection_protocol": "1.2.1",
"win32": "5.5.0",
"win32": "5.5.1",
"wkt_parser": "2.0.0",
"xdg_directories": "1.0.4",
"xml": "6.5.0",
Expand Down

0 comments on commit 4275e5c

Please sign in to comment.