mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-09-30 10:22:09 +02:00
Formatting changes.
This commit is contained in:
1 parent
abbc80890d
commit
20f8a12032
10 files changed
+111
-103
No files matched your search
@@ -5,14 +5,16 @@ import os
|
||||
import sys
|
||||
from unittest.mock import patch
|
||||
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import anthropic
|
||||
import pytest
|
||||
from httpx import Client
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
|
||||
@@ -8,14 +8,16 @@ import sys
|
||||
from pathlib import Path
|
||||
from typing import Dict, List
|
||||
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import anthropic
|
||||
import pytest
|
||||
from httpx import Client
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
|
||||
@@ -4,14 +4,16 @@ import datetime
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import anthropic
|
||||
import pytest
|
||||
from httpx import Client
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
import os
|
||||
import sys
|
||||
import uuid
|
||||
import pytest
|
||||
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import pytest
|
||||
from google import genai
|
||||
from google.genai import types
|
||||
|
||||
# add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
def set_light_values(brightness: int, color_temp: str) -> dict[str, int | str]:
|
||||
"""Set the brightness and color temperature of a room light. (mock API).
|
||||
|
||||
|
||||
@@ -6,17 +6,16 @@ import uuid
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from google import genai
|
||||
import PIL.Image
|
||||
|
||||
# add tests folder (parent) to sys.path
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import pytest
|
||||
import PIL.Image
|
||||
from google import genai
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
@@ -134,7 +133,10 @@ async def test_generate_content_with_image(
|
||||
config={"maxOutputTokens": 100},
|
||||
)
|
||||
|
||||
assert "TWO" in chat_response.candidates[0].content.parts[0].text.upper()
|
||||
assert (
|
||||
"TWO" in chat_response.candidates[0].content.parts[0].text.upper()
|
||||
or 2 in chat_response.candidates[0].content.parts[0].text
|
||||
)
|
||||
|
||||
if push_to_explorer:
|
||||
# Fetch the trace ids for the dataset
|
||||
|
||||
@@ -5,16 +5,16 @@ import os
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from httpx import Client
|
||||
|
||||
# add tests folder (parent) to sys.path
|
||||
from openai import OpenAI
|
||||
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
import pytest
|
||||
from httpx import Client
|
||||
from openai import OpenAI
|
||||
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
|
||||
@@ -7,17 +7,16 @@ import uuid
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from httpx import Client
|
||||
|
||||
# add tests folder (parent) to sys.path
|
||||
from openai import NotFoundError, OpenAI
|
||||
|
||||
# Add tests folder (parent) to sys.path
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
import pytest
|
||||
from httpx import Client
|
||||
from openai import NotFoundError, OpenAI
|
||||
|
||||
from util import * # needed for pytest fixtures
|
||||
from util import * # Needed for pytest fixtures
|
||||
|
||||
# Pytest plugins
|
||||
pytest_plugins = ("pytest_asyncio",)
|
||||
|
||||
|
||||
@@ -133,7 +132,10 @@ async def test_chat_completion_with_image(
|
||||
max_tokens=100,
|
||||
)
|
||||
|
||||
assert "TWO" in chat_response.choices[0].message.content.upper()
|
||||
assert (
|
||||
"TWO" in chat_response.choices[0].message.content.upper()
|
||||
or 2 in chat_response.choices[0].message.content
|
||||
)
|
||||
|
||||
if push_to_explorer:
|
||||
# Fetch the trace ids for the dataset
|
||||
|
||||
Reference in new issue
Block a user