Skip to content

Commit

Permalink
Fixed dependency namings
Browse files Browse the repository at this point in the history
  • Loading branch information
NotBioWaste905 committed Oct 23, 2024
1 parent ca79f94 commit 284555d
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 512 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
from functools import singledispatch

try:
#!!! remove sklearn, use something else instead
from sklearn.metrics.pairwise import cosine_similarity

sklearn_available = True
except ImportError:
sklearn_available = False
from chatsky.script import Context
from chatsky.pipeline import Pipeline
from chatsky.script.conditions.llm_conditions.dataset import DatasetItem
from chatsky.script.conditions.llm_conditions.models.base_model import ExtrasBaseModel
from chatsky import Context, Pipeline
from chatsky.ml.dataset import DatasetItem
from chatsky.ml.models.base_model import ExtrasBaseModel


@singledispatch
Expand Down Expand Up @@ -92,7 +92,7 @@ def has_match(
any of the pre-defined intent utterances.
The model passed to this function should be in the fit state.
:param model: Any model from the :py:mod:`~chatsky.script.conditions.llm_conditions.models.local.cosine_matchers` module.
:param model: Any model from the :py:mod:`~chatsky.ml.models.local.cosine_matchers` module.
:param positive_examples: Utterances that the request should match.
:param negative_examples: Utterances that the request should not match.
:param threshold: Similarity threshold that triggers a positive response from the function.
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions chatsky/ml/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .remote_api.google_dialogflow_model import GoogleDialogFlowModel, AsyncGoogleDialogFlowModel # noqa: F401
from .remote_api.rasa_model import AsyncRasaModel, RasaModel # noqa: F401
from .remote_api.hf_api_model import AsyncHFAPIModel, HFAPIModel # noqa: F401
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from copy import copy
from abc import ABC, abstractmethod

from chatsky.script import Context
from chatsky import Context

from chatsky.script.conditions.llm_conditions.dataset import Dataset
from chatsky.ml.dataset import Dataset

import asyncio
from async_lru import alru_cache
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
This module provides the mixin that overrides the :py:meth:`__call__` method
in all the descendants making them asynchronous.
"""
from chatsky.script import Context
from chatsky.script.conditions.llm_conditions.models.base_model import ExtrasBaseModel
from chatsky import Context
from chatsky.ml.models.base_model import ExtrasBaseModel


class AsyncMixin(ExtrasBaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from pathlib import Path
from async_lru import alru_cache

from chatsky.script.conditions.llm_conditions.models.base_model import ExtrasBaseModel
from chatsky.script.conditions.llm_conditions.models.remote_api.async_mixin import AsyncMixin
from chatsky.ml.models.base_model import ExtrasBaseModel
from chatsky.ml.models.remote_api.async_mixin import AsyncMixin

try:
from google.cloud import dialogflow_v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
except ImportError:
hf_api_available = False

from chatsky.script.conditions.llm_conditions.models.base_model import ExtrasBaseModel
from chatsky.script.conditions.llm_conditions.models.remote_api.async_mixin import AsyncMixin
from chatsky.ml.models.base_model import ExtrasBaseModel
from chatsky.ml.models.remote_api.async_mixin import AsyncMixin


class AbstractHFAPIModel(ExtrasBaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
rasa_available = False

from http import HTTPStatus
from chatsky.script.conditions.llm_conditions.utils import RasaResponse
from chatsky.script.conditions.llm_conditions.models.base_model import ExtrasBaseModel
from chatsky.script.conditions.llm_conditions.models.remote_api.async_mixin import AsyncMixin
from chatsky.ml.utils import RasaResponse
from chatsky.ml.models.base_model import ExtrasBaseModel
from chatsky.ml.models.remote_api.async_mixin import AsyncMixin


class AbstractRasaModel(ExtrasBaseModel):
Expand Down
File renamed without changes.
9 changes: 0 additions & 9 deletions chatsky/script/conditions/llm_conditions/models/__init__.py

This file was deleted.

287 changes: 0 additions & 287 deletions chatsky/script/core/context.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/script/extras/conditions/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from chatsky.pipeline import Pipeline
from chatsky.script.conditions.llm_conditions.dataset import Dataset
from chatsky import Pipeline
from chatsky.ml.dataset import Dataset
from chatsky.utils.testing.toy_script import TOY_SCRIPT

from tests.test_utils import get_path_from_tests_to_current_dir
Expand Down
Loading

0 comments on commit 284555d

Please sign in to comment.