diff --git a/src/Requests/CreateCompletionRequest.php b/src/Requests/CreateCompletionRequest.php index 0f0d214..bd64bbf 100644 --- a/src/Requests/CreateCompletionRequest.php +++ b/src/Requests/CreateCompletionRequest.php @@ -32,7 +32,7 @@ public function __construct( public readonly array $stop_sequences = [], public readonly float $top_p = 0.7, public readonly int $top_k = 5, - public readonly array $metadata = [], + public array $metadata = [], public readonly bool $stream = false ) { // @@ -45,8 +45,8 @@ public function resolveEndpoint(): string public function defaultBody(): array { - if(! isset($metadata['user_id'])) { - $metadata['user_id'] = uniqid(); + if(! isset($this->metadata['user_id'])) { + $this->metadata['user_id'] = uniqid(); } return [