From 580f9e30973ef7b83225ecc6cde23b8a34ffc2c0 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 22 Feb 2024 13:17:30 -0800 Subject: [PATCH] (docs) setting cache paras on proxy + Openai client --- docs/my-website/docs/proxy/caching.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/my-website/docs/proxy/caching.md b/docs/my-website/docs/proxy/caching.md index 50aba03db5..ee4874caf5 100644 --- a/docs/my-website/docs/proxy/caching.md +++ b/docs/my-website/docs/proxy/caching.md @@ -238,9 +238,11 @@ chat_completion = client.chat.completions.create( } ], model="gpt-3.5-turbo", - cache={ - "no-cache": True # will not return a cached response - } + extra_body = { # OpenAI python accepts extra args in extra_body + cache: { + "no-cache": True # will not return a cached response + } + } ) ``` @@ -264,9 +266,11 @@ chat_completion = client.chat.completions.create( } ], model="gpt-3.5-turbo", - cache={ - "ttl": 600 # caches response for 10 minutes - } + extra_body = { # OpenAI python accepts extra args in extra_body + cache: { + "ttl": 600 # caches response for 10 minutes + } + } ) ``` @@ -288,13 +292,15 @@ chat_completion = client.chat.completions.create( } ], model="gpt-3.5-turbo", - cache={ - "s-maxage": 600 # only get responses cached within last 10 minutes - } + extra_body = { # OpenAI python accepts extra args in extra_body + cache: { + "s-maxage": 600 # only get responses cached within last 10 minutes + } + } ) ``` -## Supported `cache_params` +## Supported `cache_params` on proxy config.yaml ```yaml cache_params: