AiClient::setCache( WordPressAiClientDependenciesPsrSimpleCacheCacheInterface|null $cache ): void

In this article

Sets the PSR-16 cache for storing and retrieving cached data.

Description

The cache can be used to store AI responses and other data to avoid redundant API calls and improve performance.

Parameters

$cacheWordPressAiClientDependenciesPsrSimpleCacheCacheInterface|nullrequired
The PSR-16 cache instance, or null to disable caching.

Return

void

Source

public static function setCache(?CacheInterface $cache): void
{
    self::$cache = $cache;
}

Changelog

VersionDescription
0.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.