forked from phoenix/litellm-mirror
Merge pull request #5402 from ajeetdsouza/patch-1
docs: add time.sleep() between streaming calls
This commit is contained in:
commit
3df1186d72
1 changed files with 4 additions and 1 deletions
|
@ -51,8 +51,10 @@ LiteLLM can cache your streamed responses for you
|
|||
### Usage
|
||||
```python
|
||||
import litellm
|
||||
import time
|
||||
from litellm import completion
|
||||
from litellm.caching import Cache
|
||||
|
||||
litellm.cache = Cache(type="hosted")
|
||||
|
||||
# Make completion calls
|
||||
|
@ -64,6 +66,7 @@ response1 = completion(
|
|||
for chunk in response1:
|
||||
print(chunk)
|
||||
|
||||
time.sleep(1) # cache is updated asynchronously
|
||||
|
||||
response2 = completion(
|
||||
model="gpt-3.5-turbo",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue