Skip to content

Commit

Permalink
chore(repo): Update example apps
Browse files Browse the repository at this point in the history
  • Loading branch information
dnys1 committed Oct 14, 2024
1 parent 9e37c26 commit e3c88d5
Show file tree
Hide file tree
Showing 33 changed files with 826 additions and 702 deletions.
21 changes: 11 additions & 10 deletions examples/gemini/celest/client/lib/gemini_example_client.dart
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
// Generated by Celest. This file should not be modified manually, but
// it can be checked into version control.
// ignore_for_file: type=lint, unused_local_variable, unnecessary_cast, unnecessary_import, deprecated_member_use
// ignore_for_file: type=lint, unused_local_variable, unnecessary_cast, unnecessary_import, deprecated_member_use, invalid_use_of_internal_member

library; // ignore_for_file: no_leading_underscores_for_library_prefixes

import 'dart:io' as _$io;
import 'dart:io';

import 'package:celest_core/_internal.dart' as _$celest;
import 'package:celest_core/celest_core.dart' as _$celest;
import 'package:celest_core/src/util/globals.dart' as _$celest;
import 'package:gemini_example_client/src/functions.dart';
import 'package:gemini_example_client/src/serializers.dart';
import 'package:http/http.dart' as _$http;
import 'package:native_storage/native_storage.dart' as _$native_storage;
import 'package:http/http.dart' as _$http_http;
import 'package:native_storage/native_storage.dart'
as _$native_storage_native_storage;

final Celest celest = Celest();

enum CelestEnvironment {
local;

Uri get baseUri => switch (this) {
local => _$celest.kIsWeb || !_$io.Platform.isAndroid
? Uri.parse('http://localhost:7787')
: Uri.parse('http://10.0.2.2:7787'),
local => _$celest.kIsWeb || !Platform.isAndroid
? Uri.parse('http://localhost:7788')
: Uri.parse('http://10.0.2.2:7788'),
};
}

Expand All @@ -31,11 +32,11 @@ class Celest with _$celest.CelestBase {

late CelestEnvironment _currentEnvironment;

late final _$native_storage.NativeStorage nativeStorage =
_$native_storage.NativeStorage(scope: 'celest');
late final _$native_storage_native_storage.NativeStorage nativeStorage =
_$native_storage_native_storage.NativeStorage(scope: 'celest');

@override
late _$http.Client httpClient =
late _$http_http.Client httpClient =
_$celest.CelestHttpClient(secureStorage: nativeStorage.secure);

late Uri _baseUri;
Expand Down
38 changes: 23 additions & 15 deletions examples/gemini/celest/client/lib/src/functions.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// Generated by Celest. This file should not be modified manually, but
// it can be checked into version control.
// ignore_for_file: type=lint, unused_local_variable, unnecessary_cast, unnecessary_import, deprecated_member_use
// ignore_for_file: type=lint, unused_local_variable, unnecessary_cast, unnecessary_import, deprecated_member_use, invalid_use_of_internal_member

library; // ignore_for_file: no_leading_underscores_for_library_prefixes

import 'dart:async' as _$async;
import 'dart:convert' as _$convert;
import 'dart:async';
import 'dart:convert';

import 'package:celest/celest.dart' as _$celest;
import 'package:celest_core/celest_core.dart' as _$celest;
import 'package:celest_core/src/exception/cloud_exception.dart' as _$celest;
import 'package:celest_core/src/exception/serialization_exception.dart'
as _$celest;
import 'package:gemini_example_client/gemini_example_client.dart';
import 'package:google_generative_ai/src/error.dart' as _$error;
import 'package:http/src/exception.dart' as _$exception;
import 'package:google_generative_ai/src/error.dart'
as _$google_generative_ai_error;
import 'package:http/src/exception.dart' as _$http_exception;

class CelestFunctions {
final gemini = CelestFunctionsGemini();
Expand Down Expand Up @@ -54,19 +55,18 @@ class CelestFunctionsGemini {
case 'dart.convert.JsonUnsupportedObjectError':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$convert.JsonUnsupportedObjectError>(errorValue),
.deserialize<JsonUnsupportedObjectError>(errorValue),
stackTrace,
);
case 'dart.async.AsyncError':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$async.AsyncError>(errorValue),
_$celest.Serializers.instance.deserialize<AsyncError>(errorValue),
stackTrace,
);
case 'dart.async.TimeoutException':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$async.TimeoutException>(errorValue),
.deserialize<TimeoutException>(errorValue),
stackTrace,
);
case 'dart.core.Error':
Expand Down Expand Up @@ -134,6 +134,11 @@ class CelestFunctionsGemini {
.deserialize<StackOverflowError>(errorValue),
stackTrace,
);
case 'dart.core.Exception':
Error.throwWithStackTrace(
_$celest.Serializers.instance.deserialize<Exception>(errorValue),
stackTrace,
);
case 'dart.core.FormatException':
Error.throwWithStackTrace(
_$celest.Serializers.instance
Expand Down Expand Up @@ -257,31 +262,34 @@ class CelestFunctionsGemini {
case 'google_generative_ai.GenerativeAIException':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$error.GenerativeAIException>(errorValue),
.deserialize<_$google_generative_ai_error.GenerativeAIException>(
errorValue),
stackTrace,
);
case 'google_generative_ai.InvalidApiKey':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$error.InvalidApiKey>(errorValue),
.deserialize<_$google_generative_ai_error.InvalidApiKey>(
errorValue),
stackTrace,
);
case 'google_generative_ai.UnsupportedUserLocation':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$error.UnsupportedUserLocation>(errorValue),
_$celest.Serializers.instance.deserialize<
_$google_generative_ai_error.UnsupportedUserLocation>(errorValue),
stackTrace,
);
case 'google_generative_ai.ServerException':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$error.ServerException>(errorValue),
.deserialize<_$google_generative_ai_error.ServerException>(
errorValue),
stackTrace,
);
case 'http.ClientException':
Error.throwWithStackTrace(
_$celest.Serializers.instance
.deserialize<_$exception.ClientException>(errorValue),
.deserialize<_$http_exception.ClientException>(errorValue),
stackTrace,
);
default:
Expand Down
Loading

0 comments on commit e3c88d5

Please sign in to comment.