MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / buildable_json_crew

Function buildable_json_crew

lib/cli/tests/test_run_usage.py:1287–1304  ·  view source on GitHub ↗

A JSON crew crewAI builds for real, its one agent on LLM.

(folder: Path, llm: str | dict[str, str])

Source from the content-addressed store, hash-verified

1285
1286
1287def buildable_json_crew(folder: Path, llm: str | dict[str, str]) -> Path:
1288 """A JSON crew crewAI builds for real, its one agent on LLM."""
1289 # crewAI loads a `.env` when it is first imported: import it before a test
1290 # sets the keys.
1291 import crewai.project.crew_loader # noqa: F401
1292
1293 write(folder / "pyproject.toml", JSON_CREW_PYPROJECT)
1294 write(
1295 folder / "agents" / "researcher.jsonc",
1296 json.dumps(
1297 {"role": "Researcher", "goal": "Research", "backstory": "Curious", "llm": llm}
1298 ),
1299 )
1300 return write(
1301 folder / "crew.jsonc",
1302 '{"name": "Demo", "agents": ["researcher"], "memory": false, "tasks": '
1303 '[{"description": "Say hi", "expected_output": "hi", "agent": "researcher"}]}',
1304 )
1305
1306
1307def keyless_json_crew(folder: Path, monkeypatch: pytest.MonkeyPatch, llm: str) -> None:

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected