FakeStoreGateway
class FakeStoreGateway implements StoreGateway
Properties
| protected int | $currentResponseIndex | ||
| protected bool | $preventStrayOperations |
Methods
Marshal the given response into a Store instance.
Create a new vector store.
Add a file to a vector store.
Remove a file from a vector store.
Indicate that an exception should be thrown if any store operation is not faked.
Details
at line 28
__construct(Closure|array $responses = [])
Create a store gateway with fake responses.
at line 36
Store
getStore(StoreProvider $provider, string $storeId)
Get a vector store by its ID.
at line 44
protected Store
nextGetResponse(StoreProvider $provider, string $storeId)
Get the next response for a get request.
at line 63
protected Store
marshalGetResponse(StoreProvider $provider, mixed $response, string $storeId)
Marshal the given response into a Store instance.
at line 101
Store
createStore(StoreProvider $provider, string $name, string|null $description = null, Collection|null $fileIds = null, DateInterval|null $expiresWhenIdleFor = null)
Create a new vector store.
at line 121
string
addFile(StoreProvider $provider, string $storeId, string $fileId, array $metadata = [])
Add a file to a vector store.
at line 129
bool
removeFile(StoreProvider $provider, string $storeId, string $documentId)
Remove a file from a vector store.
at line 137
bool
deleteStore(StoreProvider $provider, string $storeId)
Delete a vector store by its ID.
at line 148
FakeStoreGateway
preventStrayOperations(bool $prevent = true)
Indicate that an exception should be thrown if any store operation is not faked.
When the shared manager holds this fake gateway, the setting affects every request in the worker.