litellm/tests/test_litellm/llms
Javier de la Torre df232a71f1 feat(snowflake): add function calling support for Snowflake Cortex REST API
Add support for function calling (tools) with Snowflake Cortex models that support it (e.g., Claude 3.5 Sonnet).

Changes:
- Add 'tools' and 'tool_choice' to supported OpenAI parameters
- Implement request transformation: OpenAI function format → Snowflake tool_spec format
- Implement response transformation: Snowflake content_list with tool_use → OpenAI tool_calls
- Add tool_choice transformation: OpenAI nested format → Snowflake array format

Request transformation:
- Transform tools from nested {"type": "function", "function": {...}} to Snowflake's {"tool_spec": {"type": "generic", "name": "...", "input_schema": {...}}}
- Transform tool_choice from {"type": "function", "function": {"name": "..."}} to {"type": "tool", "name": ["..."]}

Response transformation:
- Parse Snowflake's content_list array containing tool_use objects
- Extract tool calls with tool_use_id, name, and input
- Convert to OpenAI's tool_calls format with proper JSON serialization

Testing:
- Add 7 unit tests covering request/response transformations
- Add integration test for Responses API with tool calling
- All tests passing

Fixes issue #15218

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 13:08:33 +02:00
..
anthropic Fix Anthropic streaming IDs 2025-09-26 18:31:10 -04:00
azure Add support for GPT 5 codex models (#14841) 2025-09-30 18:44:35 -07:00
azure_ai add unit test 2025-09-23 01:57:50 +00:00
baseten/chat
bedrock test_twelvelabs_missing_input_type_error 2025-10-04 12:28:09 -07:00
bytez/chat
chat
cohere/chat
cometapi/chat
compactifai Fix CompactifAI provider tests and implementation 2025-09-15 22:03:42 +02:00
custom_httpx Update var name for consistency 2025-09-23 10:28:40 -07:00
dashscope [Fixes] Using Qwen API Tiered Pricing (#14479) 2025-09-11 20:07:41 -07:00
databricks Merge branch 'main' into feature/databricks-function-call-missing-pass-description 2025-09-09 22:42:32 -07:00
datarobot
deepgram
deepinfra fix deepinfra test 2025-09-10 19:39:23 -07:00
featherless_ai/chat
fireworks_ai/chat
gemini Fix gemini cli error (#14417) 2025-09-12 11:56:51 -07:00
github_copilot
heroku
hosted_vllm fix: fix vllm test 2025-09-27 10:01:48 -07:00
huggingface
jina_ai/embedding
lemonade Adding unit tests and documentation 2025-09-30 12:12:24 -06:00
litellm_proxy/chat
llamafile/chat
lm_studio fix(lm_studio): resolve illegal Bearer header value issue 2025-09-12 22:41:30 +02:00
meta_llama
mistral
moonshot
nebius
novita/chat
nscale/chat
oci/chat Merge pull request #14092 from gotsysdba/main 2025-09-09 22:39:16 -07:00
ollama fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
openai Add support for GPT 5 codex models (#14841) 2025-09-30 18:44:35 -07:00
openrouter/chat
ovhcloud feat: Add OVHCloud AI Endpoints as a provider 2025-09-12 13:37:03 +02:00
perplexity
pg_vector/vector_stores
recraft
sagemaker
sambanova
snowflake/chat feat(snowflake): add function calling support for Snowflake Cortex REST API 2025-10-05 13:08:33 +02:00
vercel_ai_gateway
vertex_ai [Feat] VertexAI - Support googlemap grounding in vertex ai (#15179) 2025-10-03 16:07:51 -07:00
volcengine add more test 2025-09-16 12:11:10 +08:00
wandb (feat): Add W&B Inference to LiteLLM 2025-09-11 00:07:30 +05:30
watsonx
xai fix xai cost calculation (#14127) 2025-09-01 11:31:56 -07:00