Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jennywong2129 committed Oct 25, 2024
1 parent fef9445 commit 5e09e5c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/rev_ai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
from .models import Job, JobStatus, Account, Transcript, Monologue, Element, MediaConfig, \
CaptionType, CustomVocabulary, TopicExtractionJob, TopicExtractionResult, Topic, Informant, \
SpeakerName, LanguageIdentificationJob, LanguageIdentificationResult, LanguageConfidence, \
SentimentAnalysisResult, SentimentValue, SentimentMessage, SentimentAnalysisJob, CustomerUrlData, \
RevAiApiDeploymentConfigMap, RevAiApiDeployment
SentimentAnalysisResult, SentimentValue, SentimentMessage, SentimentAnalysisJob, \
CustomerUrlData, RevAiApiDeploymentConfigMap, RevAiApiDeployment
5 changes: 3 additions & 2 deletions src/rev_ai/apiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

from . import utils
from .baseclient import BaseClient
from .models import Account, CaptionType, Job, Transcript, RevAiApiDeploymentConfigMap, RevAiApiDeployment
from .models import Account, CaptionType, Job, Transcript, RevAiApiDeploymentConfigMap,
RevAiApiDeployment
from .models.asynchronous.summarization_options import SummarizationOptions
from .models.asynchronous.summary import Summary
from .models.asynchronous.translation_options import TranslationOptions
Expand Down Expand Up @@ -37,7 +38,7 @@ class RevAiAPIClient(BaseClient):
# Rev AI transcript format
rev_json_content_type = 'application/vnd.rev.transcript.v1.0+json'

def __init__(self, access_token: str, url: str=None):
def __init__(self, access_token: str, url: str = None):
"""Constructor
:param access_token: access token which authorizes all requests and links them to your
Expand Down
6 changes: 3 additions & 3 deletions src/rev_ai/generic_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class GenericApiClient(BaseClient):

# Default url for US Rev AI deployment
default_url = RevAiApiDeploymentConfigMap[RevAiApiDeployment.US]['base_url']

def __init__(
self,
access_token: str,
api_name: str,
api_version: str,
parse_job_info,
parse_job_result,
url: str=None):
url: str = None):
"""Constructor
:param access_token: access token which authorizes all requests and links them to your
Expand All @@ -40,7 +40,7 @@ def __init__(
"""

BaseClient.__init__(self, access_token)
self.base_url = '{0}/{1}/{2}/'.format(url if url else self.default_url, api_name, api_version)
self.base_url = f'{url if url else self.default_url}/{api_name}/{api_version}/'
self.parse_job_info = parse_job_info
self.parse_job_result = parse_job_result

Expand Down
3 changes: 2 additions & 1 deletion src/rev_ai/language_identification_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import json
from .generic_api_client import GenericApiClient
from .models import LanguageIdentificationJob, LanguageIdentificationResult, RevAiApiDeploymentConfigMap, RevAiApiDeployment
from .models import LanguageIdentificationJob, LanguageIdentificationResult, RevAiApiDeploymentConfigMap,
RevAiApiDeployment

try:
from urllib.parse import urljoin
Expand Down
3 changes: 3 additions & 0 deletions src/rev_ai/models/revaiapi_deployment_config_constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from enum import Enum
from typing import Dict, TypedDict


class RevAiApiDeployment(Enum):
"""
Enum representing the deployment regions for Rev AI API.
Expand All @@ -12,6 +13,7 @@ class RevAiApiDeployment(Enum):
US = 'US'
EU = 'EU'


class RevAiApiConfig(TypedDict):
"""
TypedDict representing the configuration for a Rev AI API deployment.
Expand All @@ -23,6 +25,7 @@ class RevAiApiConfig(TypedDict):
base_url: str
base_websocket_url: str


# Dictionary mapping RevAiApiDeployment enum values to their respective configuration settings.
RevAiApiDeploymentConfigMap: Dict[RevAiApiDeployment, RevAiApiConfig] = {
RevAiApiDeployment.US: {
Expand Down
4 changes: 2 additions & 2 deletions src/rev_ai/streamingclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class RevAiStreamingClient:
def __init__(self,
access_token: str,
config: MediaConfig,
version: str='v1',
version: str = 'v1',
on_error=on_error,
on_close=on_close,
on_connected=on_connected,
url: str=None):
url: str = None):
"""Constructor for Streaming Client
:param access_token: access token which authorizes all requests and
links them to your account. Generated on the settings page of your
Expand Down

0 comments on commit 5e09e5c

Please sign in to comment.