mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
docs: add comprehensive docstring to _should_allow_input_examples function
- Add detailed documentation explaining the function's purpose - Include parameter descriptions with types - Add return value documentation - Include usage examples for clarity - Explain which providers support input examples and why
This commit is contained in:
parent
7fdef46a2a
commit
975612482b
1 changed files with 25 additions and 0 deletions
|
|
@ -1018,6 +1018,31 @@ def responses_api_bridge_check(
|
|||
def _should_allow_input_examples(
|
||||
custom_llm_provider: Optional[str], model: str
|
||||
) -> bool:
|
||||
"""
|
||||
Determine whether a given model supports input examples in API calls.
|
||||
|
||||
This function checks if the specified LLM provider and model combination
|
||||
supports the `input_examples` parameter, which is used for in-context learning
|
||||
with Claude models. Input examples are currently only supported by Anthropic's
|
||||
native Claude models and Claude models accessed through cloud providers like
|
||||
Azure AI, AWS Bedrock, and Google Vertex AI.
|
||||
|
||||
Args:
|
||||
custom_llm_provider: The LLM provider name (e.g., "anthropic", "azure_ai",
|
||||
"bedrock", "vertex_ai"). Can be None.
|
||||
model: The model identifier string (e.g., "claude-3-opus").
|
||||
|
||||
Returns:
|
||||
bool: True if the model supports input examples, False otherwise.
|
||||
|
||||
Examples:
|
||||
>>> _should_allow_input_examples("anthropic", "claude-3-opus")
|
||||
True
|
||||
>>> _should_allow_input_examples("azure_ai", "claude-3-sonnet")
|
||||
True
|
||||
>>> _should_allow_input_examples("openai", "gpt-4")
|
||||
False
|
||||
"""
|
||||
if custom_llm_provider == "anthropic":
|
||||
return True
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue