From bbe7a9427f926bcfc5b71bb0f29833e506fd4dcd Mon Sep 17 00:00:00 2001 From: Jordan Dalton Date: Wed, 24 Jan 2024 08:58:43 -0600 Subject: [PATCH] Meta data can be modified --- src/Requests/CreateCompletionRequest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 [