mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
fix: handle non-str case
This commit is contained in:
parent
f0f84d6c5c
commit
d282e7eaac
1 changed files with 3 additions and 1 deletions
|
|
@ -331,8 +331,10 @@ class OllamaConfig(BaseConfig):
|
|||
response_text = response_json.get("response", "")
|
||||
content = None
|
||||
reasoning_content = None
|
||||
if response_text is not None:
|
||||
if response_text is not None and isinstance(response_text, str):
|
||||
reasoning_content, content = _parse_content_for_reasoning(response_text)
|
||||
else:
|
||||
content = response_text # type: ignore
|
||||
model_response.choices[0].message.content = content # type: ignore
|
||||
model_response.choices[0].message.reasoning_content = reasoning_content # type: ignore
|
||||
model_response.created = int(time.time())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue