feat(llm): convert function call request for non-funcall OSS model (#4711)

Co-authored-by: Calvin Smith <email@cjsmith.io>
This commit is contained in:
Xingyao Wang
2024-11-14 10:40:09 -06:00
committed by GitHub
parent 52a428d74a
commit 07f0d1ccb3
40 changed files with 1752 additions and 1164 deletions

View File

@@ -72,7 +72,12 @@ class Message(BaseModel):
# - into a single string: for providers that don't support list of content items (e.g. no vision, no tool calls)
# - into a list of content items: the new APIs of providers with vision/prompt caching/tool calls
# NOTE: remove this when litellm or providers support the new API
if self.cache_enabled or self.vision_enabled or self.tool_call_id is not None:
if (
self.cache_enabled
or self.vision_enabled
or self.tool_call_id is not None
or self.tool_calls is not None
):
return self._list_serializer()
return self._string_serializer()