ElGraph.Actions.CodeExec (ElGraph v0.3.0)

Copy Markdown View Source

에이전트 생성 코드를 격리 실행하는 Action (트렌드 보고서 Tier 3.10).

스키마 하나에서 파라미터 검증 + LLM tool 스펙을 만들고, 실제 실행은 설정된 ElGraph.Sandbox 백엔드에 위임한다 — 인프로세스 eval은 절대 하지 않는다. 백엔드 미설정 시 명확히 에러.

백엔드 해석 순서:

  1. ctx.assigns[:sandbox] ({module, opts}) — invoke(graph, input, assigns: %{...})로 주입
  2. context[:sandbox] ({module, opts}) 맵 — 직접 execute(params, %{sandbox: ...}) 호출 시
  3. Application.get_env(:el_graph, :code_exec_sandbox)
  4. 없음 → {:error, :no_sandbox_configured}

Summary

Functions

Action 설명 (LLM tool 설명으로 쓰인다).

검증 후 run/2를 실행한다.

Action 이름 (LLM tool 이름으로 쓰인다).

원본 스키마 정의.

LLM tool-calling 스펙(JSON Schema)을 생성한다.

파라미터를 검증하고 기본값을 적용한다.

Functions

description()

Action 설명 (LLM tool 설명으로 쓰인다).

execute(params, context)

검증 후 run/2를 실행한다.

name()

Action 이름 (LLM tool 이름으로 쓰인다).

schema()

원본 스키마 정의.

to_tool_spec()

LLM tool-calling 스펙(JSON Schema)을 생성한다.

validate(params)

파라미터를 검증하고 기본값을 적용한다.