Skip to content

Commit

Permalink
chore(repo): Update examples
Browse files Browse the repository at this point in the history
Regenerate example projects using latest CLI changes.
  • Loading branch information
dnys1 committed Oct 10, 2024
1 parent 5019dec commit b34cce1
Show file tree
Hide file tree
Showing 35 changed files with 2,718 additions and 1,190 deletions.
4 changes: 2 additions & 2 deletions examples/gemini/celest/client/lib/gemini_example_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ enum CelestEnvironment {

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

Expand Down
410 changes: 276 additions & 134 deletions examples/gemini/celest/client/lib/src/functions.dart

Large diffs are not rendered by default.

44 changes: 42 additions & 2 deletions examples/gemini/celest/client/lib/src/serializers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.AbortedException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -228,6 +229,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.AbortedException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -239,6 +241,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.AlreadyExistsException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -250,6 +253,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.AlreadyExistsException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -261,6 +265,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.BadRequestException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -272,6 +277,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.BadRequestException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -283,6 +289,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.CancelledException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -294,6 +301,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.CancelledException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -305,6 +313,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.CloudException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -320,6 +329,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.DataLossError, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -331,6 +341,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.DataLossError(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -342,6 +353,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.DeadlineExceededError, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -353,6 +365,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.DeadlineExceededError(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -364,6 +377,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.FailedPreconditionException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -375,6 +389,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.FailedPreconditionException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -386,6 +401,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.InternalServerError, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -397,6 +413,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.InternalServerError(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -408,6 +425,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.NotFoundException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -419,6 +437,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.NotFoundException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -430,6 +449,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.OutOfRangeException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -441,6 +461,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.OutOfRangeException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -452,6 +473,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.PermissionDeniedException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -463,6 +485,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.PermissionDeniedException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -474,6 +497,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.ResourceExhaustedException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -485,6 +509,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.ResourceExhaustedException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -496,6 +521,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.UnauthorizedException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -507,6 +533,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.UnauthorizedException(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -518,6 +545,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.UnavailableError, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -529,6 +557,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.UnavailableError(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -538,8 +567,9 @@ void initSerializers({_$celest.Serializers? serializers}) {
},
));
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.UnimplementedError, Map<String, Object?>?>(
_$celest.UnimplementedError, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -550,12 +580,20 @@ void initSerializers({_$celest.Serializers? serializers}) {
},
deserialize: ($serialized) {
return _$celest.UnimplementedError(
($serialized?[r'message'] as String?));
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
const _$celest.TypeToken<_$celest.JsonValue?>('JsonValue'),
),
);
},
));
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.UnknownError, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand All @@ -567,6 +605,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
deserialize: ($serialized) {
return _$celest.UnknownError(
($serialized[r'message'] as String?),
code: ($serialized[r'code'] as num?)?.toInt(),
details:
_$celest.Serializers.instance.deserialize<_$celest.JsonValue?>(
$serialized[r'details'],
Expand All @@ -578,6 +617,7 @@ void initSerializers({_$celest.Serializers? serializers}) {
_$celest.Serializers.instance.put(_$celest.Serializer.define<
_$celest.SerializationException, Map<String, Object?>>(
serialize: ($value) => <String, Object?>{
r'code': $value.code,
r'message': $value.message,
if (_$celest.Serializers.instance.serialize<_$celest.JsonValue?>(
$value.details,
Expand Down
19 changes: 12 additions & 7 deletions examples/gemini/celest/client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ environment:
sdk: ^3.4.0

dependencies:
celest: ^1.0.0-0
celest_backend:
path: ..
celest: '^1.0.0-0'
celest_core: '^1.0.0-0'
meta: '^1.12.0'
native_storage: '^0.2.2'
celest_core: ^1.0.0-0
http: ^1.0.0
meta: ^1.12.0
native_storage: ^0.2.2

dev_dependencies: {}
dev_dependencies:
lints: ^4.0.0
test: ^1.25.0

dependency_overrides:
celest:
path: ../../../../packages/celest
celest_core:
path: ../../../../packages/celest_core
celest_ast:
path: ../../../../packages/celest_ast
celest_auth:
path: ../../../../packages/celest_auth
celest_cloud:
path: ../../../../packages/celest_cloud
celest_core:
path: ../../../../packages/celest_core
12 changes: 6 additions & 6 deletions examples/gemini/celest/lib/src/generated/cloud.celest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ class CelestCloud {

/// The current environment of the Celest service.
///
/// This is determined by the `CELEST_ENVIRONMENT` environment variable
/// This is determined by the `CELEST_ENVIRONMENT` variable
/// which is set for you by the deployment environment.
CelestEnvironment get currentEnvironment =>
(env.currentEnvironment as CelestEnvironment);
(variables.currentEnvironment as CelestEnvironment);

/// The environment variables for the Celest service.
/// The variables of the Celest service.
///
/// This class provides access to the environment variable values
/// that are configured for the [currentEnvironment].
CelestEnvironmentVariables get env => const CelestEnvironmentVariables();
/// This class provides access to the values configured for the
/// [currentEnvironment].
CelestVariables get variables => const CelestVariables();

/// The secrets for the Celest service.
///
Expand Down
4 changes: 2 additions & 2 deletions examples/gemini/celest/lib/src/generated/config.celest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ extension type const CelestEnvironment._(String _env)
///
/// This class provides access to the environment variable values
/// that are configured for the current [CelestEnvironment].
class CelestEnvironmentVariables {
const CelestEnvironmentVariables();
class CelestVariables {
const CelestVariables();

/// The environment variable that determines the current environment.
///
Expand Down
13 changes: 9 additions & 4 deletions examples/gemini/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ environment:
sdk: ^3.4.0

dependencies:
celest: '^1.0.0-0'
google_generative_ai: '^0.2.0'
celest: ^1.0.0-0
celest_ast: ^0.1.0
celest_core: ^1.0.0-0
google_generative_ai: ^0.2.0
http: '>=0.13.0 <2.0.0'
meta: ^1.12.0

dependency_overrides:
celest:
path: ../../../packages/celest
celest_ast:
path: ../../../packages/celest_ast
celest_auth:
path: ../../../packages/celest_auth
celest_cloud:
Expand All @@ -21,5 +26,5 @@ dependency_overrides:
path: ../../../packages/celest_core

dev_dependencies:
lints: '^4.0.0'
test: '^1.25.0'
lints: ^4.0.0
test: ^1.25.0
4 changes: 2 additions & 2 deletions examples/openai/celest/client/lib/openai_example_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ enum CelestEnvironment {

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

Expand Down
Loading

0 comments on commit b34cce1

Please sign in to comment.