feat(ollama_chat.py): support ollama tool calling

Closes https://github.com/BerriAI/litellm/issues/4812
This commit is contained in:
Krrish Dholakia 2024-07-26 21:51:54 -07:00
parent a264d1ca8c
commit b25d4a8cb3
5 changed files with 57 additions and 25 deletions

View file

@ -3469,6 +3469,18 @@ class Router:
model_info=_model_info,
)
## REGISTER MODEL INFO IN LITELLM MODEL COST MAP
_model_name = deployment.litellm_params.model
if deployment.litellm_params.custom_llm_provider is not None:
_model_name = (
deployment.litellm_params.custom_llm_provider + "/" + _model_name
)
litellm.register_model(
model_cost={
_model_name: _model_info,
}
)
deployment = self._add_deployment(deployment=deployment)
model = deployment.to_json(exclude_none=True)