Merge pull request #5381 from BerriAI/litellm_gemini_context_caching

gemini context caching (openai format) support
This commit is contained in:
Krish Dholakia 2024-08-26 22:22:23 -07:00 committed by GitHub
commit 81e62aec16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -309,7 +309,6 @@ class GoogleAIStudioGeminiConfig: # key diff from VertexAI - 'frequency_penalty
"n",
"stop",
]
def _map_function(self, value: List[dict]) -> List[Tools]:
gtool_func_declarations = []
googleSearchRetrieval: Optional[dict] = None
@ -973,7 +972,6 @@ class VertexLLM(BaseLLM):
index=candidate.get("index", idx),
)
tools.append(_tool_response_chunk)
chat_completion_message["content"] = (
content_str if len(content_str) > 0 else None
)
@ -982,7 +980,6 @@ class VertexLLM(BaseLLM):
if functions is not None:
chat_completion_message["function_call"] = functions
choice = litellm.Choices(
finish_reason=candidate.get("finishReason", "stop"),
index=candidate.get("index", idx),