Skip to content

Commit

Permalink
Fix circular imports in form_filler_skill (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
markwaddle authored Nov 20, 2024
1 parent 0396f5a commit 6f5c188
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import logging

from .guided_conversation_skill import GuidedConversationSkill

logger = logging.getLogger(__name__)

__all__ = [
"GuidedConversationSkill",
]
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from typing import Any

from form_filler_skill.guided_conversation.message import Conversation, ConversationMessageType
Expand All @@ -10,11 +11,12 @@
message_from_completion,
validate_completion,
)
from pydantic import BaseModel
from skill_library.types import LanguageModel

from .. import logger
from ..artifact import Artifact
from .generate_artifact_updates import UpdateAttempt

logger = logging.getLogger(__name__)

ARTIFACT_ERROR_CORRECTION_SYSTEM_TEMPLATE = """You are a helpful, thoughtful, and meticulous assistant.
Expand All @@ -36,6 +38,11 @@
"""


class UpdateAttempt(BaseModel):
field_value: str
error: str


async def generate_artifact_field_update_error_fix(
language_model: LanguageModel,
artifact: Artifact,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from ..artifact import Artifact
from ..message import Conversation
from .fix_artifact_error import generate_artifact_field_update_error_fix
from .fix_artifact_error import UpdateAttempt, generate_artifact_field_update_error_fix

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -61,11 +61,6 @@ class ArtifactUpdates(BaseModel):
updates: list[ArtifactUpdate]


class UpdateAttempt(BaseModel):
field_value: str
error: str


async def generate_artifact_updates(
language_model: LanguageModel,
definition: GCDefinition,
Expand Down

0 comments on commit 6f5c188

Please sign in to comment.