Skip to content

Commit

Permalink
chore: Remove the _verify_docker_image method, as the image is now bu…
Browse files Browse the repository at this point in the history
…ilt in the Docker Compose file and delete test code node file (#146)
  • Loading branch information
Onelevenvy authored Dec 8, 2024
1 parent addf33c commit 647e314
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 165 deletions.
10 changes: 5 additions & 5 deletions backend/app/core/workflow/node/code/code_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def __init__(
self.memory_limit = memory_limit
self.image_tag = image_tag
self.client = docker.from_env()
self._verify_docker_image()
# self._verify_docker_image()
self._pool = ContainerPool(
image_tag=image_tag, pool_size=pool_size, memory_limit=memory_limit
)
Expand Down Expand Up @@ -395,13 +395,13 @@ async def work(self, state: TeamState, config: RunnableConfig) -> ReturnTeamStat
# If code_result is a string, return it as it is
code_result = code_execution_result
elif isinstance(code_execution_result, dict):
if "code_result" in code_execution_result:
if "res" in code_execution_result:
# If the dictionary contains the "result" key, return its value
code_result = code_execution_result["code_result"]
code_result = code_execution_result["res"]
else:
code_result = "Error: The Code Execution Result must return a dictionary with the 'code_result' key."
code_result = "Error: The Code Execution Result must return a dictionary with the 'res' key."
else:
code_result = "Error: Invalid code return type, please return a dictionary with the 'code_result' key."
code_result = "Error: Invalid code return type, please return a dictionary with the 'res' key."

result = ToolMessage(
content=code_result,
Expand Down
85 changes: 0 additions & 85 deletions backend/app/core/workflow/node/code/test_code.py

This file was deleted.

72 changes: 0 additions & 72 deletions backend/app/core/workflow/node/code/test_code_node.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const CodeNodeProperties: React.FC<CodeNodePropertiesProps> = ({
{ name: "arg2", value: "" },
];
setArgs(defaultArgs);
const defaultCode = `def main(arg1: str, arg2: str) -> dict:\n return {"code_result": ""}\n`;
const defaultCode = `def main(arg1: str, arg2: str) -> dict:\n return {"res": ""}\n`;
onNodeDataChange(node.id, "code", defaultCode);
}

Expand Down
4 changes: 2 additions & 2 deletions web/src/components/WorkFlow/Nodes/nodeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ export const nodeConfig: Record<string, NodeConfigItem> = {
sources: ["left", "right"],
targets: ["left", "right"],
},
outputVariables: ["result", "output"],
inputVariables: ["input"],
outputVariables: ["code_result"],
inputVariables: [],
initialData: {
code: "",
language: "python",
Expand Down

0 comments on commit 647e314

Please sign in to comment.