mirror of
https://github.com/hwchase17/langchain.git
synced 2026-07-01 14:47:02 +00:00
test(openai): clarify async API key sync failure trace (#38379)
Clarifies why the async callable API-key integration test intentionally creates a failed `ChatOpenAI` run in scheduled LangSmith traces. The sync invocation is expected to fail because async API-key callables are only valid for async model methods.
This commit is contained in:
@@ -111,8 +111,10 @@ async def test_callable_api_key_async(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
assert isinstance(async_response, AIMessage)
|
||||
assert calls["async"] == 1
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
# We do not create a sync callable from an async one
|
||||
with pytest.raises(ValueError, match="Sync client is not available"):
|
||||
# This intentionally records a failed ChatOpenAI run in scheduled LangSmith
|
||||
# traces: async API-key callables are valid for async methods, but sync
|
||||
# invocation must fail.
|
||||
_ = model.invoke("hello")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user