-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move modules under "cohere.compass" + More refactoring (#56)
- Move all modules under "cohere.compass". - Remove `tqdm` from dependencies; we are not using it. - Added `pyright` type checking to pre-commit. - Changed pyright checking mode from `basic`, which, as the name suggests, is basic and didn't catch some errors to `strict` to ensure we catch as many errors as possible at coding time rather than run time. - Updated README.md to have pyright certification at the top ;-) - Changed Python support window to `[3.9, 4.0)`.
- Loading branch information
Showing
25 changed files
with
250 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from cohere.compass.clients.compass import * # noqa: F403 | ||
from cohere.compass.clients.parser import * # noqa: F403 | ||
from cohere.compass.clients.rbac import * # noqa: F403 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import Any | ||
|
||
# import models into model package | ||
from pydantic import BaseModel | ||
|
||
|
||
class ValidatedModel(BaseModel): | ||
class Config: | ||
arbitrary_types_allowed = True | ||
use_enum_values = True | ||
|
||
@classmethod | ||
def attribute_in_model(cls, attr_name: str): | ||
return attr_name in cls.model_fields | ||
|
||
def __init__(self, **data: dict[str, Any]): | ||
for name, _value in data.items(): | ||
if not self.attribute_in_model(name): | ||
raise ValueError( | ||
f"{name} is not a valid attribute for {self.__class__.__name__}" | ||
) | ||
super().__init__(**data) | ||
|
||
|
||
from cohere.compass.models.config import * # noqa: E402, F403 | ||
from cohere.compass.models.datasources import * # noqa: E402, F403 | ||
from cohere.compass.models.documents import * # noqa: E402, F403 | ||
from cohere.compass.models.rbac import * # noqa: E402, F403 | ||
from cohere.compass.models.search import * # noqa: E402, F403 |
Oops, something went wrong.