mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
create model response object
This commit is contained in:
parent
b5f8d0f60d
commit
224ccad8f9
4 changed files with 71 additions and 20 deletions
|
@ -119,6 +119,14 @@ def test_completion_openai_with_more_optional_params():
|
|||
response = completion(model="gpt-3.5-turbo", messages=messages, temperature=0.5, top_p=0.1, n=2, max_tokens=150, presence_penalty=0.5, frequency_penalty=-0.5, logit_bias={123: 5}, user="ishaan_dev@berri.ai")
|
||||
# Add any assertions here to check the response
|
||||
print(response)
|
||||
response_str = response['choices'][0]['message']['content']
|
||||
response_str_2 = response.choices[0].message.content
|
||||
print(response['choices'][0]['message']['content'])
|
||||
print(response.choices[0].message.content)
|
||||
if type(response_str) != str:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
if type(response_str_2) != str:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue