feat(base_step): set default language from app context when not provided (#269)

- Initialize language attribute with app context language if not explicitly set
- Add conditional logic to check for existing language value before assignment
- Ensure proper fallback behavior when language parameter is empty or None
This commit is contained in:
jinliyl 2026-06-01 17:14:20 +08:00 committed by GitHub
parent 041f957a7f
commit aa87f4fdea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -418,7 +418,7 @@ components:
as_llm_formatter:
default:
backend: ${LLM_FORMATTER_BACKEND:-anthropic}
backend: ${LLM_BACKEND:-anthropic}
file_graph:
default:

View file

@ -125,6 +125,8 @@ class BaseStep(ComponentMixin, ABC):
):
super().__init__(name=name, backend=backend, app_context=app_context, **kwargs)
self.language: str = language
if not self.language and self.app_context is not None:
self.language = self.app_context.app_config.language
self.input_mapping = input_mapping
self.output_mapping = output_mapping
self.context: RuntimeContext | None = None