Disable codeblock (#910)
This commit is contained in:
@@ -13,6 +13,11 @@ class SkyvernHTTPException(SkyvernException):
|
|||||||
super().__init__(message)
|
super().__init__(message)
|
||||||
|
|
||||||
|
|
||||||
|
class DisabledBlockExecutionError(SkyvernHTTPException):
|
||||||
|
def __init__(self, message: str | None = None):
|
||||||
|
super().__init__(message, status_code=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
||||||
class InvalidOpenAIResponseFormat(SkyvernException):
|
class InvalidOpenAIResponseFormat(SkyvernException):
|
||||||
def __init__(self, message: str | None = None):
|
def __init__(self, message: str | None = None):
|
||||||
super().__init__(f"Invalid response format: {message}")
|
super().__init__(f"Invalid response format: {message}")
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ from pydantic import BaseModel, Field
|
|||||||
from skyvern.config import settings
|
from skyvern.config import settings
|
||||||
from skyvern.exceptions import (
|
from skyvern.exceptions import (
|
||||||
ContextParameterValueNotFound,
|
ContextParameterValueNotFound,
|
||||||
|
DisabledBlockExecutionError,
|
||||||
FailedToNavigateToUrl,
|
FailedToNavigateToUrl,
|
||||||
MissingBrowserStatePage,
|
MissingBrowserStatePage,
|
||||||
TaskNotFound,
|
TaskNotFound,
|
||||||
@@ -534,6 +535,7 @@ class CodeBlock(Block):
|
|||||||
return self.parameters
|
return self.parameters
|
||||||
|
|
||||||
async def execute(self, workflow_run_id: str, **kwargs: dict) -> BlockResult:
|
async def execute(self, workflow_run_id: str, **kwargs: dict) -> BlockResult:
|
||||||
|
raise DisabledBlockExecutionError("CodeBlock is disabled")
|
||||||
# get workflow run context
|
# get workflow run context
|
||||||
workflow_run_context = self.get_workflow_run_context(workflow_run_id)
|
workflow_run_context = self.get_workflow_run_context(workflow_run_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user