Skip to content

Commit

Permalink
Introduce more Ruff rules to improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
corafid committed Dec 17, 2024
1 parent 6023413 commit 6d33a01
Show file tree
Hide file tree
Showing 14 changed files with 691 additions and 298 deletions.
18 changes: 13 additions & 5 deletions cohere/compass/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python imports
from enum import Enum
from typing import List, Optional
from typing import Optional

# 3rd party imports
from pydantic import BaseModel
Expand All @@ -12,28 +12,36 @@
ValidatedModel,
)

__version__ = "0.8.0"
__version__ = "0.10.2"


class ProcessFileParameters(ValidatedModel):
"""Model for use with the process_file parser API."""

parser_config: ParserConfig
metadata_config: MetadataConfig
doc_id: Optional[str] = None
content_type: Optional[str] = None


class ProcessFilesParameters(ValidatedModel):
doc_ids: Optional[List[str]] = None
"""Model for use with the process_files parser API."""

doc_ids: Optional[list[str]] = None
parser_config: ParserConfig
metadata_config: MetadataConfig


class GroupAuthorizationActions(str, Enum):
"""Enum for use with the edit_group_authorization API to specify the edit type."""

ADD = "add"
REMOVE = "remove"


class GroupAuthorizationInput(BaseModel):
document_ids: List[str]
authorized_groups: List[str]
"""Model for use with the edit_group_authorization API."""

document_ids: list[str]
authorized_groups: list[str]
action: GroupAuthorizationActions
Loading

0 comments on commit 6d33a01

Please sign in to comment.