7
7
8
8
class CreateMessage
9
9
{
10
- public function __construct (public AnthropicDriver $ driver , public array $ payload = [])
11
- {
12
-
13
- }
10
+ public function __construct (public AnthropicDriver $ driver , public array $ payload = []) {}
14
11
15
12
public static function make (AnthropicDriver $ driver , array $ payload = []): CreateMessage
16
13
{
@@ -26,7 +23,7 @@ public function model(): string
26
23
{
27
24
$ default = data_get ($ this ->driver ->llm , 'model ' );
28
25
29
- return $ this ->value ( 'model ' , $ default );
26
+ return $ this ->value ('model ' , $ default );
30
27
}
31
28
32
29
public function value ($ key , $ default = null )
@@ -51,7 +48,7 @@ public function temperature(): float
51
48
52
49
public function system (): ?string
53
50
{
54
- return $ this ->value ( 'system ' );
51
+ return $ this ->value ('system ' );
55
52
}
56
53
57
54
public function stream (): bool
@@ -61,7 +58,7 @@ public function stream(): bool
61
58
62
59
public function messages (): array
63
60
{
64
- return $ this ->value ( 'messages ' , []);
61
+ return $ this ->value ('messages ' , []);
65
62
}
66
63
67
64
public function payload (): array
@@ -75,7 +72,7 @@ public function payload(): array
75
72
'model ' => $ this ->model (),
76
73
'max_tokens ' => $ this ->maxTokens (),
77
74
'temperature ' => $ this ->temperature (),
78
- 'messages ' => $ this ->messages ()
75
+ 'messages ' => $ this ->messages (),
79
76
];
80
77
81
78
return $ required + $ optional ;
@@ -87,4 +84,4 @@ public function execute(): CreateMessageResponse
87
84
88
85
return CreateMessageResponse::make ($ response );
89
86
}
90
- }
87
+ }
0 commit comments