mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
restore docstring for strip markdown functin
This commit is contained in:
parent
cafa683894
commit
510c6cf962
1 changed files with 6 additions and 0 deletions
|
|
@ -421,6 +421,12 @@ class GenAIHubOrchestrationConfig(OpenAIGPTConfig):
|
|||
return _normalize_choice_fn(choice)
|
||||
|
||||
def _strip_markdown_json(self, response: ModelResponse) -> ModelResponse:
|
||||
"""Strip markdown code block wrapper from JSON content if present.
|
||||
|
||||
SAP GenAI Hub with Anthropic models sometimes returns JSON wrapped in
|
||||
markdown code blocks (```json ... ```) depending on prompt phrasing.
|
||||
This method strips that wrapper to ensure consistent JSON output.
|
||||
"""
|
||||
import re
|
||||
|
||||
for choice in response.choices or []:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue