From cae7ab29a138363825699c4ac6b87e1a5cf88bba Mon Sep 17 00:00:00 2001 From: Jordan Dalton Date: Wed, 24 Jan 2024 08:50:19 -0600 Subject: [PATCH] Set default user_Id --- src/Requests/CreateCompletionRequest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Requests/CreateCompletionRequest.php b/src/Requests/CreateCompletionRequest.php index 4b0d927..0f0d214 100644 --- a/src/Requests/CreateCompletionRequest.php +++ b/src/Requests/CreateCompletionRequest.php @@ -45,6 +45,10 @@ public function resolveEndpoint(): string public function defaultBody(): array { + if(! isset($metadata['user_id'])) { + $metadata['user_id'] = uniqid(); + } + return [ 'model' => 'claude-2', 'prompt' => $this->prompt,