Commit graph

9 commits

Author SHA1 Message Date
Yuneng Jiang
2b374a2abf
Merge main and resolve Snowflake test conflict
Main rewrote the same tests we moved. Resolution: keep the tests only
in the unit test directory, adopting main's improved patterns (AsyncMock,
assert_called_once, stronger content assertions on streaming).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:06:37 -07:00
Yuneng Jiang
19f8b58046
[Test] Move mocked Snowflake chat completion tests to unit test directory
Move test_chat_completion_snowflake and test_chat_completion_snowflake_stream
from tests/llm_translation/ to tests/test_litellm/llms/snowflake/chat/ so
they run as part of `make test-unit` without requiring API credentials.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:03:00 -07:00
Ishaan Jaffer
3a0ebda867 test snowflake 2026-03-30 16:39:06 -07:00
Krrish Dholakia
25f2baad71 test: cleanup dead tests 2026-03-28 20:49:02 -07:00
Ishaan Jaffer
6439aed3ac snowflake test fix 2025-11-21 17:12:55 -08:00
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
Ishaan Jaff
cf5b4c0497 ruff check ./litellm --fix 2025-07-12 11:04:02 -07:00
Sunny Wan
844c27a9b2 added mock_tests 2025-03-11 16:32:15 -04:00
Sunny Wan
c413686ead wrote tests for snowflake 2025-03-03 17:49:11 -05:00