-
-
Notifications
You must be signed in to change notification settings - Fork 661
Closed
Description
Overview:
We have created an API Service indentical with OpenAI API deployed on a server from a third-party company. The payload and response is at most identical to OpenAI but I think it differs on the headers.
Steps
- On creating the OpenAI Client, we replaced the base uri with our custom API endpoint
- Tried sending a chat completion streaming request to it
- I got an exception around this line #L31C58-L31C58
Exception
Initial Investigation:
- MetaInformation class first parameter is optional, this means there should be no problem
- Upon receiving the response, meta information is instantiated through the array form of OpenAI Response
client/src/ValueObjects/Transporter/Response.php
Lines 35 to 41 in 1287f56
public static function from(array|string $data, array $headers): self { // @phpstan-ignore-next-line $meta = MetaInformation::from($headers); return new self($data, $meta); } - Line #L31C58-L31C58 should handle of whether the array headers have key
x-request-idor not in addition to null check.$requestId = $headers['x-request-id'][0] ?? null;
Metadata
Metadata
Assignees
Labels
No labels