Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /BerriAI_litellm /tests /llm_translation /test_openrouter.py
| import pytest | |
| import litellm | |
| def test_completion_openrouter_reasoning_content(): | |
| litellm._turn_on_debug() | |
| resp = litellm.completion( | |
| model="openrouter/anthropic/claude-sonnet-4", | |
| messages=[{"role": "user", "content": "Hello world"}], | |
| reasoning={"effort": "high"}, | |
| ) | |
| print(resp) | |
| assert resp.choices[0].message.reasoning_content is not None | |
| def test_completion_openrouter_image_generation(): | |
| litellm._turn_on_debug() | |
| resp = litellm.completion( | |
| model="openrouter/google/gemini-2.5-flash-image", | |
| messages=[{"role": "user", "content": "Generate an image of a cat"}], | |
| modalities=["image", "text"], | |
| ) | |
| print(resp) | |
| assert ( | |
| resp.choices[0].message.images[0]["image_url"]["url"].startswith("data:image/") | |
| ) | |
| def test_openrouter_embedding(): | |
| """Test OpenRouter embeddings support.""" | |
| litellm._turn_on_debug() | |
| resp = litellm.embedding( | |
| model="openrouter/openai/text-embedding-3-small", | |
| input=["Hello world", "How are you?"], | |
| ) | |
| print(resp) | |
| assert resp is not None | |
| assert len(resp.data) == 2 | |
| assert resp.data[0]["embedding"] is not None | |
| assert isinstance(resp.data[0]["embedding"], list) | |
| assert len(resp.data[0]["embedding"]) > 0 | |
Xet Storage Details
- Size:
- 1.28 kB
- Xet hash:
- e1a1a3781bb754c73b74efe612def20bec2fff6211da8c246d99070662aa0dd1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.