Merge pull request 'fix: add starlette/httpx to dev deps, guard test_openai_compat imports' (#2) from devin/1777359479-fix-openai-compat-tests into main
This commit was merged in pull request #2.
This commit is contained in:
@@ -35,6 +35,8 @@ dev = [
|
|||||||
"pytest>=7.4",
|
"pytest>=7.4",
|
||||||
"mypy>=1.8",
|
"mypy>=1.8",
|
||||||
"ruff>=0.4",
|
"ruff>=0.4",
|
||||||
|
"starlette>=0.36",
|
||||||
|
"httpx>=0.27",
|
||||||
]
|
]
|
||||||
all = ["fusionagi[openai,anthropic,local,gpu]"]
|
all = ["fusionagi[openai,anthropic,local,gpu]"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,31 @@
|
|||||||
"""Tests for OpenAI-compatible API bridge."""
|
"""Tests for OpenAI-compatible API bridge.
|
||||||
|
|
||||||
|
Requires the ``api`` or ``dev`` extra (starlette, httpx).
|
||||||
|
Skipped gracefully when those packages are not installed.
|
||||||
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from starlette.testclient import TestClient
|
|
||||||
|
|
||||||
from fusionagi.adapters import StubAdapter
|
pytest.importorskip("starlette", reason="starlette not installed (pip install fusionagi[dev])")
|
||||||
from fusionagi.api.app import create_app
|
pytest.importorskip("fastapi", reason="fastapi not installed (pip install fusionagi[api])")
|
||||||
from fusionagi.api.openai_compat.translators import (
|
|
||||||
messages_to_prompt,
|
from starlette.testclient import TestClient # noqa: E402
|
||||||
|
|
||||||
|
from fusionagi.adapters import StubAdapter # noqa: E402
|
||||||
|
from fusionagi.api.app import create_app # noqa: E402
|
||||||
|
from fusionagi.api.openai_compat.translators import ( # noqa: E402
|
||||||
estimate_usage,
|
estimate_usage,
|
||||||
final_response_to_openai,
|
final_response_to_openai,
|
||||||
|
messages_to_prompt,
|
||||||
|
)
|
||||||
|
from fusionagi.schemas.witness import ( # noqa: E402
|
||||||
|
AgreementMap,
|
||||||
|
FinalResponse,
|
||||||
|
TransparencyReport,
|
||||||
)
|
)
|
||||||
from fusionagi.schemas.witness import AgreementMap, FinalResponse, TransparencyReport
|
|
||||||
|
|
||||||
|
|
||||||
# Stub adapter responses for Dvādaśa heads and Witness
|
# Stub adapter responses for Dvādaśa heads and Witness
|
||||||
HEAD_OUTPUT = {
|
HEAD_OUTPUT = {
|
||||||
|
|||||||
Reference in New Issue
Block a user