- Issue created by @aman_lnwebworks
- Issue was unassigned.
- ๐ฎ๐ณIndia aman_lnwebworks
Hi @psf_
I have created MR!3 for the above issue, Please review it once.
Thank you !!
- Status changed to Needs work
5 months ago 9:19am 24 June 2024 - ๐ช๐ธSpain psf_ Huelva
Hi, thx by the patch.
I have some notes:
- In "src/OpenAIClientWrapper.php" you were erased all comments, it's are required by code styling that we have comments.
- In the protected method getApiToken() we can't send any status message, because that will spawn the user with messages. This method is called so many times. - First commit to issue fork.
- ๐ฎ๐ณIndia ankitv18
ankitv18 โ changed the visibility of the branch 1.1.x to hidden.
- Status changed to Needs review
5 months ago 9:49am 24 June 2024 - ๐ฎ๐ณIndia ankitv18
@psf_ please review the MR!5 I guess we could use the ternary operator to handle the null value passed as token.
- ๐ช๐ธSpain psf_ Huelva
In this line:
$token = empty($token) ? $this->getApiToken() : '';
"$this->getApiToken()" can return a NULL value if the user don't configure the module.
I change your commit with:
public function getClient(string $token = ''): Client { if (empty($token)) { $token = $this->getApiToken(); } $token = !$token ? '' : $token; return \OpenAI::client($token); }
But I don't tested it.
- ๐ฎ๐ณIndia ankitv18
I can implement the same logic with combination or ternary and null coalescing operator.
- ๐ช๐ธSpain psf_ Huelva
I see it OK, but I don't tested it.
I'm so busy, when I get free I will try it, or apply it if anyother tested it.
Thx so much