diff --git a/src/marvin/types.py b/src/marvin/types.py index f663ee81a..104948750 100644 --- a/src/marvin/types.py +++ b/src/marvin/types.py @@ -161,6 +161,8 @@ class ResponseModel(MarvinType): class ChatRequest(Prompt[T]): + model_config = dict(extra="allow") + model: str = Field(default_factory=lambda: settings.openai.chat.completions.model) frequency_penalty: Optional[ Annotated[float, Field(strict=True, ge=-2.0, le=2.0)] @@ -177,6 +179,8 @@ class ChatRequest(Prompt[T]): ) top_p: Optional[Annotated[float, Field(strict=True, ge=0, le=1)]] = 1 user: Optional[str] = None + logprobs: Optional[bool] = None + max_completion_tokens: Optional[Annotated[int, Field(strict=True, ge=1)]] = None class TranscriptRequest(MarvinType): diff --git a/tests/ai/vision/test_caption.py b/tests/ai/vision/test_caption.py index a8b2e7bbc..ea6df3f99 100644 --- a/tests/ai/vision/test_caption.py +++ b/tests/ai/vision/test_caption.py @@ -40,10 +40,13 @@ def test_two_cities(self): "https://images.unsplash.com/photo-1617581629397-a72507c3de9e" ) - result = marvin.caption([img_ny, img_dc], instructions="what city is this?") + result = marvin.caption([img_ny, img_dc], instructions="what cities are these?") assert_equal( result, "New York City; Washington DC", - instructions="A caption was generated for two images. Ensure it mentions both cities.", + instructions=( + "A caption was generated for two images. Ensure it mentions both cities" + " but don't enforce the exact text, i.e. D.C. ~= Washington DC" + ), ) diff --git a/tests/beta/assistants/test_assistants.py b/tests/beta/assistants/test_assistants.py index 60faefffb..464418e0a 100644 --- a/tests/beta/assistants/test_assistants.py +++ b/tests/beta/assistants/test_assistants.py @@ -13,6 +13,9 @@ def mocked_client(): return client +pytest.skip("Assistants API is not stable", allow_module_level=True) + + @pytest.fixture(autouse=True) def mock_get_client(monkeypatch): # Use monkeypatch to replace get_client with special_get_client