Skip to content

Commit

Permalink
fix: linting for isort rules and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaphoenix committed Nov 25, 2024
1 parent d28ce7a commit e9961c2
Show file tree
Hide file tree
Showing 91 changed files with 378 additions and 358 deletions.
1 change: 1 addition & 0 deletions data/ccai_service_kit/conf_score_cfx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import json
import logging

from dfcx_scrapi.tools.webhook_util import WebhookUtil

# logging config
Expand Down
8 changes: 4 additions & 4 deletions data/get_weather_tool.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Sample Tool for Agent Builder."""
import logging

import requests
from google.auth import default as google_default_auth
from google.auth.transport.requests import Request as GoogleRequest
from flask import Flask, request
from firebase_admin import initialize_app
from firebase_functions import https_fn

from flask import Flask, request
from google.auth import default as google_default_auth
from google.auth.transport.requests import Request as GoogleRequest

initialize_app()
app = Flask(__name__)
Expand Down
4 changes: 3 additions & 1 deletion examples/bot_building_series/bot_building_101.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
# limitations under the License.

import sys

import pandas as pd

from dfcx_scrapi.core.agents import Agents
from dfcx_scrapi.core.intents import Intents
from dfcx_scrapi.core.flows import Flows
from dfcx_scrapi.core.intents import Intents
from dfcx_scrapi.core.pages import Pages
from dfcx_scrapi.tools.dataframe_functions import DataframeFunctions
from dfcx_scrapi.tools.maker_util import MakerUtil


def build_agent(creds_path, project_id):
"""Build a simple agent."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
# limitations under the License.

import sys

import pandas as pd

from dfcx_scrapi.core.agents import Agents
from dfcx_scrapi.tools.dataframe_functions import DataframeFunctions

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# limitations under the License.

import pathlib
from setuptools import setup, find_packages

from setuptools import find_packages, setup

here = pathlib.Path(__file__).parent.resolve()

Expand Down
12 changes: 7 additions & 5 deletions src/agent_assist/agent_assist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
# limitations under the License.

import logging

from dfcx_scrapi.core import scrapi_base
from typing import Dict
from google.cloud.dialogflow_v2beta1 import services
from google.cloud.dialogflow_v2beta1 import types
from google.cloud.dialogflow_v2beta1.services.knowledge_bases import KnowledgeBasesClient

from google.cloud.dialogflow_v2beta1 import services, types
from google.cloud.dialogflow_v2beta1.services.knowledge_bases import (
KnowledgeBasesClient,
)
from google.protobuf import field_mask_pb2

from dfcx_scrapi.core import scrapi_base

# logging config
logging.basicConfig(
level=logging.INFO,
Expand Down
24 changes: 12 additions & 12 deletions src/dfcx_scrapi/agent_extract/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
# limitations under the License.

import logging
import time
import os
import shutil
import time
from typing import Dict

from dfcx_scrapi.core import agents
from dfcx_scrapi.core import operations
from dfcx_scrapi.core import scrapi_base
from dfcx_scrapi.agent_extract import graph
from dfcx_scrapi.agent_extract import flows
from dfcx_scrapi.agent_extract import intents
from dfcx_scrapi.agent_extract import entity_types
from dfcx_scrapi.agent_extract import test_cases
from dfcx_scrapi.agent_extract import webhooks
from dfcx_scrapi.agent_extract import gcs_utils
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import (
entity_types,
flows,
gcs_utils,
graph,
intents,
test_cases,
types,
webhooks,
)
from dfcx_scrapi.core import agents, operations, scrapi_base

# logging config
logging.basicConfig(
Expand Down
1 change: 1 addition & 0 deletions src/dfcx_scrapi/agent_extract/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import logging
import re

from dfcx_scrapi.agent_extract import types

# logging config
Expand Down
5 changes: 2 additions & 3 deletions src/dfcx_scrapi/agent_extract/entity_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@

import json
import os

from typing import Dict

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import common, types


class EntityTypes:
"""Entity Type processing methods and functions."""
Expand Down
15 changes: 8 additions & 7 deletions src/dfcx_scrapi/agent_extract/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

import json
import os

from typing import List

from dfcx_scrapi.agent_extract import graph
from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import pages
from dfcx_scrapi.agent_extract import routes
from dfcx_scrapi.agent_extract import route_groups
from dfcx_scrapi.agent_extract import (
common,
graph,
pages,
route_groups,
routes,
types,
)


class Flows:
Expand Down
1 change: 1 addition & 0 deletions src/dfcx_scrapi/agent_extract/gcs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

import zipfile

from google.cloud import storage
from google.oauth2 import service_account

Expand Down
1 change: 1 addition & 0 deletions src/dfcx_scrapi/agent_extract/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import collections


class Graph:
"""Utility class for manaing graph structure."""

Expand Down
3 changes: 1 addition & 2 deletions src/dfcx_scrapi/agent_extract/intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import json
import os

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import common, types


class Intents:
Expand Down
7 changes: 2 additions & 5 deletions src/dfcx_scrapi/agent_extract/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@

import json
import os
from typing import Any, Dict

from typing import Dict, Any

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import routes
from dfcx_scrapi.agent_extract import common, routes, types


class Pages:
Expand Down
6 changes: 2 additions & 4 deletions src/dfcx_scrapi/agent_extract/route_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import json
import os

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import routes
from dfcx_scrapi.agent_extract import common, routes, types


class RouteGroups:
Expand Down
5 changes: 2 additions & 3 deletions src/dfcx_scrapi/agent_extract/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict, Any
from typing import Any, Dict

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import common, types


class Fulfillments:
Expand Down
6 changes: 2 additions & 4 deletions src/dfcx_scrapi/agent_extract/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

import json
import os
from typing import Any, Dict, List

from typing import Dict, List, Any

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import common, types


class TestCases:
Expand Down
3 changes: 2 additions & 1 deletion src/dfcx_scrapi/agent_extract/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict, List, Any, Tuple
from dataclasses import dataclass, field
from typing import Any, Dict, List, Tuple

from dfcx_scrapi.agent_extract import graph as graph_class


@dataclass
class AgentMetadata:
"""Used to track the current Agent Metadata attrinbutes."""
Expand Down
4 changes: 2 additions & 2 deletions src/dfcx_scrapi/agent_extract/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import json
import os

from dfcx_scrapi.agent_extract import common
from dfcx_scrapi.agent_extract import types
from dfcx_scrapi.agent_extract import common, types


class Webhooks:
"""Webhook linter methods and functions."""
Expand Down
4 changes: 2 additions & 2 deletions src/dfcx_scrapi/builders/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import logging
from typing import List

from google.cloud.dialogflowcx_v3beta1.types import Agent
from google.cloud.dialogflowcx_v3beta1.types import SpeechToTextSettings
from google.cloud.dialogflowcx_v3beta1.types import Agent, SpeechToTextSettings

from dfcx_scrapi.builders.builders_common import BuildersCommon

# logging config
Expand Down
6 changes: 4 additions & 2 deletions src/dfcx_scrapi/builders/builders_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import logging
from typing import List, Union

from google.cloud.dialogflowcx_v3beta1.types import TransitionRoute
from google.cloud.dialogflowcx_v3beta1.types import EventHandler
from google.cloud.dialogflowcx_v3beta1.types import (
EventHandler,
TransitionRoute,
)

# logging config
logging.basicConfig(
Expand Down
1 change: 1 addition & 0 deletions src/dfcx_scrapi/builders/entity_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import List, Union

from google.cloud.dialogflowcx_v3beta1.types import EntityType

from dfcx_scrapi.builders.builders_common import BuildersCommon

# logging config
Expand Down
17 changes: 11 additions & 6 deletions src/dfcx_scrapi/builders/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
from dataclasses import dataclass
from typing import List, Union

from google.cloud.dialogflowcx_v3beta1.types import Flow
from google.cloud.dialogflowcx_v3beta1.types import NluSettings
from google.cloud.dialogflowcx_v3beta1.types import TransitionRoute
from google.cloud.dialogflowcx_v3beta1.types import EventHandler
from google.cloud.dialogflowcx_v3beta1.types import (
EventHandler,
Flow,
NluSettings,
TransitionRoute,
)

from dfcx_scrapi.builders.builders_common import BuildersCommon
from dfcx_scrapi.builders.routes import TransitionRouteBuilder
from dfcx_scrapi.builders.routes import EventHandlerBuilder
from dfcx_scrapi.builders.fulfillments import FulfillmentBuilder
from dfcx_scrapi.builders.routes import (
EventHandlerBuilder,
TransitionRouteBuilder,
)

# logging config
logging.basicConfig(
Expand Down
6 changes: 3 additions & 3 deletions src/dfcx_scrapi/builders/fulfillments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# limitations under the License.

import logging
from typing import List, Dict, Any
from typing import Any, Dict, List

from google.cloud.dialogflowcx_v3beta1.types import Fulfillment, ResponseMessage

from google.cloud.dialogflowcx_v3beta1.types import Fulfillment
from google.cloud.dialogflowcx_v3beta1.types import ResponseMessage
from dfcx_scrapi.builders.builders_common import BuildersCommon
from dfcx_scrapi.builders.response_messages import ResponseMessageBuilder

Expand Down
9 changes: 7 additions & 2 deletions src/dfcx_scrapi/builders/generative_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
import logging
from typing import List

from google.cloud.dialogflowcx_v3beta1.types.generative_settings import GenerativeSettings
from google.cloud.dialogflowcx_v3beta1.types.safety_settings import SafetySettings
from google.cloud.dialogflowcx_v3beta1.types.generative_settings import (
GenerativeSettings,
)
from google.cloud.dialogflowcx_v3beta1.types.safety_settings import (
SafetySettings,
)

from dfcx_scrapi.builders.builders_common import BuildersCommon

# logging config
Expand Down
9 changes: 4 additions & 5 deletions src/dfcx_scrapi/builders/intents.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
# limitations under the License.

import logging
from string import ascii_lowercase
from string import digits
from collections import defaultdict
from dataclasses import dataclass
from dataclasses import field
from typing import List, Dict, Union
from dataclasses import dataclass, field
from string import ascii_lowercase, digits
from typing import Dict, List, Union

from google.cloud.dialogflowcx_v3beta1.types import Intent

from dfcx_scrapi.builders.builders_common import BuildersCommon

# logging config
Expand Down
Loading

0 comments on commit e9961c2

Please sign in to comment.