mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-15 01:39:41 +00:00
set a DEFAULT_TEXT_PROMPT_LLM_KEY if TextPromptBlock.llm_key is not passed to backend (#1280)
This commit is contained in:
parent
eec7e7c40c
commit
a8dfc51b5a
2 changed files with 9 additions and 2 deletions
|
@ -3,6 +3,7 @@ from typing import Annotated, Any, Literal
|
|||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from skyvern.config import settings
|
||||
from skyvern.forge.sdk.schemas.tasks import ProxyLocation
|
||||
from skyvern.forge.sdk.workflow.models.block import BlockType, FileType
|
||||
from skyvern.forge.sdk.workflow.models.parameter import ParameterType, WorkflowParameterType
|
||||
|
@ -154,6 +155,9 @@ class CodeBlockYAML(BlockYAML):
|
|||
parameter_keys: list[str] | None = None
|
||||
|
||||
|
||||
DEFAULT_TEXT_PROMPT_LLM_KEY = settings.SECONDARY_LLM_KEY or settings.LLM_KEY
|
||||
|
||||
|
||||
class TextPromptBlockYAML(BlockYAML):
|
||||
# There is a mypy bug with Literal. Without the type: ignore, mypy will raise an error:
|
||||
# Parameter 1 of Literal[...] cannot be of type "Any"
|
||||
|
@ -161,7 +165,7 @@ class TextPromptBlockYAML(BlockYAML):
|
|||
# to infer the type of the parameter_type attribute.
|
||||
block_type: Literal[BlockType.TEXT_PROMPT] = BlockType.TEXT_PROMPT # type: ignore
|
||||
|
||||
llm_key: str
|
||||
llm_key: str = DEFAULT_TEXT_PROMPT_LLM_KEY
|
||||
prompt: str
|
||||
parameter_keys: list[str] | None = None
|
||||
json_schema: dict[str, Any] | None = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue