Skip to content

Commit 33bf7f3

Browse files
authored
Merge pull request #1215 from Notnaton/func-call
Update llm.py to use litellm.support_function_calling()
2 parents c7fcc7e + 6b6f227 commit 33bf7f3

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

interpreter/core/llm/llm.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,11 @@ def run(self, messages):
6161
# Detect function support
6262
if self.supports_functions != None:
6363
supports_functions = self.supports_functions
64+
elif litellm.supports_function_calling(self.model):
65+
supports_functions = True
6466
else:
65-
# Guess whether or not it's a function calling LLM
66-
if not self.interpreter.offline and (
67-
self.interpreter.llm.model != "gpt-4-vision-preview"
68-
and self.model in litellm.open_ai_chat_completion_models
69-
or self.model.startswith("azure/")
70-
# Once Litellm supports it, add Anthropic models here
71-
):
72-
supports_functions = True
73-
else:
74-
supports_functions = False
75-
67+
supports_functions = False
68+
7669
# Trim image messages if they're there
7770
if self.supports_vision:
7871
image_messages = [msg for msg in messages if msg["type"] == "image"]

0 commit comments

Comments
 (0)