Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce more Ruff rules to improve code quality #69

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading