fix empty llm_key promblem for the TextPromptBlock (#1282)

This commit is contained in:
Shuchang Zheng
2024-11-27 22:03:53 -08:00
committed by GitHub
parent a8dfc51b5a
commit f01a7aa357

View File

@@ -783,7 +783,8 @@ class TextPromptBlock(Block):
return self.parameters
async def send_prompt(self, prompt: str, parameter_values: dict[str, Any]) -> dict[str, Any]:
llm_api_handler = LLMAPIHandlerFactory.get_llm_api_handler(self.llm_key)
llm_key = self.llm_key or DEFAULT_TEXT_PROMPT_LLM_KEY
llm_api_handler = LLMAPIHandlerFactory.get_llm_api_handler(llm_key)
if not self.json_schema:
self.json_schema = {
"type": "object",