You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fluffychat/lib/pangea/choreographer/repo/interactive_translation_rep...

44 lines
1.4 KiB
Dart

2 years ago
import 'dart:convert';
import 'package:http/http.dart';
import 'package:fluffychat/pangea/common/config/environment.dart';
import 'package:fluffychat/widgets/matrix.dart';
import '../../common/network/requests.dart';
import '../../common/network/urls.dart';
2 years ago
import '../models/custom_input_translation_model.dart';
import '../models/it_response_model.dart';
class ITRepo {
static Future<ITResponseModel> customInputTranslate(
CustomInputRequestModel initalText,
) async {
2 years ago
final Requests req = Requests(
choreoApiKey: Environment.choreoApiKey,
accessToken: MatrixState.pangeaController.userController.accessToken,
);
2 years ago
final Response res =
await req.post(url: PApiUrls.firstStep, body: initalText.toJson());
final json = jsonDecode(utf8.decode(res.bodyBytes).toString());
return ITResponseModel.fromJson(json);
}
// static Future<ITResponseModel> systemChoiceTranslate(
// SystemChoiceRequestModel subseqText,
// ) async {
// final Requests req = Requests(
// choreoApiKey: Environment.choreoApiKey,
// accessToken: MatrixState.pangeaController.userController.accessToken,
// );
2 years ago
// final Response res =
// await req.post(url: PApiUrls.subseqStep, body: subseqText.toJson());
2 years ago
// final decodedBody = jsonDecode(utf8.decode(res.bodyBytes).toString());
2 years ago
// return ITResponseModel.fromJson(decodedBody);
// }
2 years ago
}