release: v0.2.10 (#452)
This commit is contained in:
+19
-2
@@ -2757,6 +2757,21 @@ class TestPatchOpenrouterStripResponsesReasoning:
|
||||
# =============================================================================
|
||||
|
||||
|
||||
def _anthropic_httpx():
|
||||
"""Return the httpx flavour the installed anthropic SDK accepts as ``http_client``.
|
||||
|
||||
anthropic >= 1.0 is built on ``httpx2`` and rejects an ``httpx.Client``.
|
||||
"""
|
||||
import anthropic
|
||||
from packaging.version import Version
|
||||
|
||||
if Version(anthropic.__version__) >= Version("1"):
|
||||
import httpx2 as httpx
|
||||
else:
|
||||
import httpx
|
||||
return httpx
|
||||
|
||||
|
||||
class TestAnthropicStripForeignReasoning:
|
||||
def test_strip_removes_reasoning_content_blocks(self):
|
||||
"""reasoning_content blocks are dropped; text and thinking survive."""
|
||||
@@ -2832,9 +2847,10 @@ class TestAnthropicStripForeignReasoning:
|
||||
import json
|
||||
|
||||
import anthropic
|
||||
import httpx
|
||||
from langchain_core.messages import AIMessage, HumanMessage
|
||||
|
||||
httpx = _anthropic_httpx()
|
||||
|
||||
monkeypatch.setenv("CUSTOM_ANTHROPIC_BASE_URL", "https://compat.example.com")
|
||||
monkeypatch.setenv("CUSTOM_ANTHROPIC_API_KEY", "test-key")
|
||||
model = get_chat_model("moonshotai/kimi-k3", provider="custom-anthropic")
|
||||
@@ -2904,9 +2920,10 @@ class TestAnthropicStructuredOutput:
|
||||
import json
|
||||
|
||||
import anthropic
|
||||
import httpx
|
||||
from pydantic import BaseModel
|
||||
|
||||
httpx = _anthropic_httpx()
|
||||
|
||||
class Pick(BaseModel):
|
||||
answer: str
|
||||
|
||||
|
||||
Reference in New Issue
Block a user