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

Fix circular imports in form_filler_skill #257

Merged
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
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