Skip to main content
For a conceptual overview of response caching, see Response Caching.
Response caching allows you to cache model responses, which can significantly improve response times and reduce API costs during development and testing.

Basic Usage

Enable caching by setting cache_response=True when initializing the model. The first call will hit the API and cache the response, while subsequent identical calls will return the cached result.
cache_model_response.py

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
2

Set your API key

3

Install libraries

4

Run Agent