mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(test) supports_function_calling
This commit is contained in:
parent
32f72335ab
commit
56d20cd073
2 changed files with 26 additions and 0 deletions
|
@ -549,6 +549,8 @@ from .utils import (
|
||||||
token_counter,
|
token_counter,
|
||||||
cost_per_token,
|
cost_per_token,
|
||||||
completion_cost,
|
completion_cost,
|
||||||
|
supports_function_calling,
|
||||||
|
supports_parallel_function_calling,
|
||||||
get_litellm_params,
|
get_litellm_params,
|
||||||
Logging,
|
Logging,
|
||||||
acreate,
|
acreate,
|
||||||
|
|
|
@ -317,3 +317,27 @@ def test_token_counter():
|
||||||
|
|
||||||
|
|
||||||
# test_token_counter()
|
# test_token_counter()
|
||||||
|
|
||||||
|
|
||||||
|
def test_supports_function_calling():
|
||||||
|
try:
|
||||||
|
assert litellm.supports_function_calling(model="gpt-3.5-turbo") == True
|
||||||
|
assert (
|
||||||
|
litellm.supports_function_calling(model="azure/gpt-4-1106-preview") == True
|
||||||
|
)
|
||||||
|
assert (
|
||||||
|
litellm.supports_function_calling(
|
||||||
|
model="bedrock/anthropic.claude-instant-v1"
|
||||||
|
)
|
||||||
|
== False
|
||||||
|
)
|
||||||
|
assert litellm.supports_function_calling(model="palm/chat-bison") == False
|
||||||
|
assert litellm.supports_function_calling(model="ollama/llama2") == False
|
||||||
|
assert (
|
||||||
|
litellm.supports_function_calling(model="anthropic.claude-instant-v1")
|
||||||
|
== False
|
||||||
|
)
|
||||||
|
assert litellm.supports_function_calling(model="claude-2") == False
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
pytest.fail(f"Error occurred: {e}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue