Skip to content

Commit

Permalink
Meta data can be modified
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanDalton committed Jan 24, 2024
1 parent 45de0fa commit bbe7a94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Requests/CreateCompletionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
//
Expand All @@ -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 [
Expand Down

0 comments on commit bbe7a94

Please sign in to comment.