forked from phoenix/litellm-mirror
(test) router - acompletion + cache
This commit is contained in:
parent
ce6eb8a30e
commit
26c6c1a03e
1 changed files with 3 additions and 0 deletions
|
@ -413,6 +413,9 @@ def test_acompletion_on_router():
|
||||||
print("Testing acompletion + caching on router")
|
print("Testing acompletion + caching on router")
|
||||||
response1 = await router.acompletion(model="gpt-3.5-turbo", messages=messages, temperature=1)
|
response1 = await router.acompletion(model="gpt-3.5-turbo", messages=messages, temperature=1)
|
||||||
print(f"response1: {response1}")
|
print(f"response1: {response1}")
|
||||||
|
|
||||||
|
await asyncio.sleep(1) # add cache is async, async sleep for cache to get set
|
||||||
|
|
||||||
response2 = await router.acompletion(model="gpt-3.5-turbo", messages=messages, temperature=1)
|
response2 = await router.acompletion(model="gpt-3.5-turbo", messages=messages, temperature=1)
|
||||||
print(f"response2: {response2}")
|
print(f"response2: {response2}")
|
||||||
assert response1.id == response2.id
|
assert response1.id == response2.id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue