mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
add mock request to docs
This commit is contained in:
parent
d4806cd686
commit
6da500c6e0
6 changed files with 31 additions and 4 deletions
21
litellm/tests/test_mock_request.py
Normal file
21
litellm/tests/test_mock_request.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
#### What this tests ####
|
||||
# This tests mock request calls to litellm
|
||||
|
||||
import sys, os
|
||||
import traceback
|
||||
|
||||
sys.path.insert(
|
||||
0, os.path.abspath("../..")
|
||||
) # Adds the parent directory to the system path
|
||||
import litellm
|
||||
|
||||
def test_mock_request():
|
||||
try:
|
||||
model = "gpt-3.5-turbo"
|
||||
messages = [{"role": "user", "content": "Hey, I'm a mock request"}]
|
||||
response = litellm.completion(model=model, messages=messages, mock_request=True)
|
||||
print(response)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
test_mock_request()
|
Loading…
Add table
Add a link
Reference in a new issue