Skip to content

Commit

Permalink
chore: Update examples with latest CLI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dnys1 committed Feb 6, 2024
1 parent 20b0435 commit 2836bc2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 33 deletions.
3 changes: 0 additions & 3 deletions examples/openai/celest/lib/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import 'package:http/http.dart' as http;
import 'src/client/functions.dart';
import 'src/client/serializers.dart';

export 'exceptions.dart';
export 'models.dart';

final Celest celest = Celest();

class Celest {
Expand Down
8 changes: 4 additions & 4 deletions examples/openai/celest/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "0f7b1783ddb1e4600580b8c00d0ddae5b06ae7f0382bd4fcce5db4df97b618e1"
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
version: "66.0.0"
version: "67.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "5e8bdcda061d91da6b034d64d8e4026f355bcb8c3e7a0ac2da1523205a91a737"
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
version: "6.4.0"
version: "6.4.1"
args:
dependency: transitive
description:
Expand Down
20 changes: 6 additions & 14 deletions examples/openai/celest/resources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@
// it can be checked into version control.
// ignore_for_file: type=lint, unused_local_variable, unnecessary_cast, unnecessary_import

library; // ignore_for_file: no_leading_underscores_for_library_prefixes
library;

import 'package:celest/celest.dart' as _i1;
import 'package:celest_backend/models.dart' as _i2;
import 'package:celest/celest.dart';

abstract final class apis {
static const openAi = _i1.CloudApi(name: r'open_ai');
static const openAi = CloudApi(name: r'open_ai');
}

abstract final class functions {
static const openAiAvailableModels = _i1.CloudFunction<void, List<String>>(
static const openAiAvailableModels = CloudFunction(
api: r'open_ai',
functionName: r'availableModels',
);

static const openAiOpenAiRequest = _i1.CloudFunction<
({
String model,
String prompt,
_i2.ModelParameters parameters,
String openAiToken
}),
String>(
static const openAiOpenAiRequest = CloudFunction(
api: r'open_ai',
functionName: r'openAIRequest',
);
}

abstract final class env {
static const openAiToken = _i1.EnvironmentVariable(name: r'OPEN_AI_TOKEN');
static const openAiToken = EnvironmentVariable(name: r'OPEN_AI_TOKEN');
}
1 change: 1 addition & 0 deletions examples/openai/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Import the generated Celest client
import 'package:celest_backend/client.dart';
import 'package:celest_backend/models.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logger/logger.dart';
Expand Down
7 changes: 2 additions & 5 deletions examples/todo/celest/lib/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ import 'package:http/http.dart' as http;
import 'src/client/functions.dart';
import 'src/client/serializers.dart';

export 'exceptions.dart';
export 'models.dart';

final Celest celest = Celest();

class Celest {
late http.Client httpClient = http.Client();

late final Uri baseUri = kIsWeb || !Platform.isAndroid
? Uri.parse('http://localhost:7783')
: Uri.parse('http://10.0.2.2:7783');
? Uri.parse('http://localhost:7777')
: Uri.parse('http://10.0.2.2:7777');

final functions = CelestFunctions();

Expand Down
1 change: 1 addition & 0 deletions examples/todo/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import 'dart:async';

import 'package:celest_backend/client.dart';
import 'package:celest_backend/models.dart';
import 'package:flutter/material.dart';

void main() {
Expand Down
3 changes: 0 additions & 3 deletions packages/celest/example/celest/lib/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import 'package:http/http.dart' as http;

import 'src/client/functions.dart';

export 'exceptions.dart';
export 'models.dart';

final Celest celest = Celest();

class Celest {
Expand Down
8 changes: 4 additions & 4 deletions packages/celest/example/celest/resources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// it can be checked into version control.
// ignore_for_file: type=lint, unused_local_variable, unnecessary_cast, unnecessary_import

library; // ignore_for_file: no_leading_underscores_for_library_prefixes
library;

import 'package:celest/celest.dart' as _i1;
import 'package:celest/celest.dart';

abstract final class apis {
static const greeting = _i1.CloudApi(name: r'greeting');
static const greeting = CloudApi(name: r'greeting');
}

abstract final class functions {
static const greetingSayHello = _i1.CloudFunction<String, String>(
static const greetingSayHello = CloudFunction(
api: r'greeting',
functionName: r'sayHello',
);
Expand Down

0 comments on commit 2836bc2

Please sign in to comment.