set a DEFAULT_TEXT_PROMPT_LLM_KEY if TextPromptBlock.llm_key is not passed to backend (#1280)

This commit is contained in:
Shuchang Zheng 2024-11-27 16:41:52 -08:00 committed by GitHub
parent eec7e7c40c
commit a8dfc51b5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -765,10 +765,13 @@ async def user_code():
return self.build_block_result(success=True, output_parameter_value=result, status=BlockStatus.completed)
DEFAULT_TEXT_PROMPT_LLM_KEY = settings.SECONDARY_LLM_KEY or settings.LLM_KEY
class TextPromptBlock(Block):
block_type: Literal[BlockType.TEXT_PROMPT] = BlockType.TEXT_PROMPT
llm_key: str
llm_key: str = DEFAULT_TEXT_PROMPT_LLM_KEY
prompt: str
parameters: list[PARAMETER_TYPE] = []
json_schema: dict[str, Any] | None = None