This commit is contained in:
Hamza-Ayed
2023-11-25 14:05:02 +03:00
parent 1d2ceed031
commit a8d6c509c1
37 changed files with 679 additions and 307 deletions

View File

@@ -59,7 +59,42 @@ class CRUD {
{
"role": "user",
"content":
"Extract the desired information from the following passage as json decoded like vin,make,made,color,owner and all you find in this:\n\n$payload"
"Extract the desired information from the following passage as json decoded like vin,make,made,year,expiration_date,color,owner,registration_date just in this:\n\n$payload"
}
],
"temperature": 0.9
});
var response = await http.post(
url,
body: data,
headers: headers,
);
if (response.statusCode == 200) {
return response.body;
}
return response.statusCode;
}
Future<dynamic> getChatGPT({
required String link,
required String payload,
}) async {
var url = Uri.parse(
link,
);
var headers = {
'Content-Type': 'application/json',
'Authorization':
'Bearer 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'
};
var data = json.encode({
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content":
"Extract the desired information from the following passage as json decoded like vin,make,made,year,expiration_date,color,owner,registration_date just in this:\n\n$payload"
}
],
"temperature": 0.9