Skip to content

Commit fd0aa4e

Browse files
committed
fix
1 parent 0dc0e3d commit fd0aa4e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/credal/copilots/types/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ class Config:
7878

7979
Filter = typing_extensions.Annotated[
8080
typing.Union[Filter_String, Filter_Number, Filter_Boolean, Filter_Datetime],
81-
pydantic.Field(discriminator="fieldType"),
81+
pydantic.Field(discriminator="field_type"),
8282
]

tests/custom/test_verify_types.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
from credal import CredalApi
22

3-
def test_repro() -> None:
3+
def test_services_can_be_imported() -> None:
44
client = CredalApi(api_key="")
5-
client.copilots
5+
assert client.copilots is not None
6+
assert client.document_catalog is not None
7+
assert client.document_collections is not None
8+
assert client.search is not None
9+
assert client.users is not None
10+
11+
# Assert that the number of top-level properties of the CredalApi instance is fixed
12+
# This can help ensure the API surface is not unexpectedly changed
13+
# If this changes, we just need to update our service assertions
14+
services = {attr for attr in dir(client) if not attr.startswith("_") and not callable(getattr(client, attr, None))}
15+
assert len(services) == 5

0 commit comments

Comments
 (0)