Skip to content

Commit

Permalink
chore: Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramedina86 committed Nov 6, 2024
1 parent 43477c5 commit c6fc315
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/writer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
InstancePathItem,
Readable,
ServeMode,
WorkflowExecutionLog,
WriterEvent,
WriterEventResult,
WriterFileItem,
WorkflowExecutionLog
)

if TYPE_CHECKING:
Expand Down
8 changes: 3 additions & 5 deletions src/writer/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from typing import Any, Dict, List, Literal, Optional, Tuple

import writer.core
from writer.ss_types import WorkflowExecutionLog
import writer.workflows_blocks
from writer.core_ui import Component
from writer.ss_types import WorkflowExecutionLog
from writer.workflows_blocks.blocks import WorkflowBlock


Expand Down Expand Up @@ -41,11 +41,9 @@ def run_workflow(session, component_id: str, execution_env: Dict):
def _generate_run_log(session: "writer.core.WriterSession", execution: Dict[str, WorkflowBlock], title: str, entry_type: Literal["info", "error"], return_value: Optional[Any] = None):
if not writer.core.Config.is_mail_enabled_for_log:
return
exec_log:WorkflowExecutionLog = {
"summary": []
}
exec_log:WorkflowExecutionLog = WorkflowExecutionLog(summary=[])
for component_id, tool in execution.items():
exec_log["summary"].append({
exec_log.summary.append({
"componentId": component_id,
"outcome": tool.outcome,
"result": tool.result,
Expand Down
2 changes: 1 addition & 1 deletion src/writer/workflows_blocks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from writer.workflows_blocks.writerchat import WriterChat
from writer.workflows_blocks.writerclassification import WriterClassification
from writer.workflows_blocks.writercompletion import WriterCompletion
from writer.workflows_blocks.writernocodeapp import WriterNoCodeApp
from writer.workflows_blocks.writerinitchat import WriterInitChat
from writer.workflows_blocks.writernocodeapp import WriterNoCodeApp

SetState.register("workflows_setstate")
WriterClassification.register("workflows_writerclassification")
Expand Down
2 changes: 1 addition & 1 deletion src/writer/workflows_blocks/writeraddchatmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run(self):
conversation = self.evaluator.evaluate_expression(conversation_state_element, self.instance_path, self.execution_env)

if conversation is None or not isinstance(conversation, writer.ai.Conversation):
self.result = f"The state element specified doesn't contain a conversation. Initialize one using the block 'Initialize chat'."
self.result = "The state element specified doesn't contain a conversation. Initialize one using the block 'Initialize chat'."
self.outcome = "error"
return

Expand Down
2 changes: 1 addition & 1 deletion src/writer/workflows_blocks/writerchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def run(self):
conversation = self.evaluator.evaluate_expression(conversation_state_element, self.instance_path, self.execution_env)

if conversation is None or not isinstance(conversation, writer.ai.Conversation):
self.result = f"The state element specified doesn't contain a conversation. Initialize one using the block 'Initialize chat'."
self.result = "The state element specified doesn't contain a conversation. Initialize one using the block 'Initialize chat'."
self.outcome = "error"
return

Expand Down

0 comments on commit c6fc315

Please sign in to comment.