-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathInference.php
More file actions
65 lines (56 loc) · 1.56 KB
/
Copy pathInference.php
File metadata and controls
65 lines (56 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace Mindee\Parsing\V2;
/**
* Inference class.
*/
class Inference
{
/**
* @var string ID of the inference.
*/
public string $id;
/**
* @var InferenceJob Job the inference belongs to.
*/
public InferenceJob $job;
/**
* @var InferenceModel Model info for the inference.
*/
public InferenceModel $model;
/**
* @var InferenceFile File info for the inference.
*/
public InferenceFile $file;
/**
* @var InferenceActiveOptions Active options for the inference.
*/
public InferenceActiveOptions $activeOptions;
/**
* @var InferenceResult Result of the inference.
*/
public InferenceResult $result;
/**
* @param array $serverResponse Raw server response array.
*/
public function __construct(array $serverResponse)
{
$this->id = $serverResponse['id'];
$this->job = new InferenceJob($serverResponse['job']);
$this->model = new InferenceModel($serverResponse['model']);
$this->file = new InferenceFile($serverResponse['file']);
$this->activeOptions = new InferenceActiveOptions($serverResponse['active_options']);
$this->result = new InferenceResult($serverResponse['result']);
}
/**
* @return string String representation.
*/
public function __toString(): string
{
return "Inference\n#########\n"
. "{$this->job}\n"
. "{$this->model}\n"
. "{$this->file}\n"
. "{$this->activeOptions}\n"
. "{$this->result}\n";
}
}