Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/remove python dependencies selector #7494

Merged
merged 8 commits into from
Aug 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: incorrect-code-template
  • Loading branch information
Yeuoly committed Aug 21, 2024
commit 16020ae80c96cbafc49ec3d40c4f491007320484
6 changes: 3 additions & 3 deletions api/core/helper/code_executor/code_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from threading import Lock
from typing import Literal, Optional

from httpx import get, post
from httpx import Timeout, get, post
from pydantic import BaseModel
from yarl import URL

Expand All @@ -21,7 +21,7 @@
CODE_EXECUTION_ENDPOINT = dify_config.CODE_EXECUTION_ENDPOINT
CODE_EXECUTION_API_KEY = dify_config.CODE_EXECUTION_API_KEY

CODE_EXECUTION_TIMEOUT = (10, 60)
CODE_EXECUTION_TIMEOUT = Timeout(connect=10, read=60)

class CodeExecutionException(Exception):
pass
Expand Down Expand Up @@ -116,7 +116,7 @@ def execute_code(cls,
if response.data.error:
raise CodeExecutionException(response.data.error)

return response.data.stdout
return response.data.stdout or ''

@classmethod
def execute_workflow_code_template(cls, language: CodeLanguage, code: str, inputs: dict, dependencies: Optional[list[CodeDependency]] = None) -> dict:
Expand Down
Loading