{"id":23955,"library":"langwatch-scenario","title":"LangWatch Scenario","description":"LangWatch Scenario is an end-to-end agent testing library for Python (>=3.10) that lets you define, run, and evaluate LLM agent scenarios. It supports async execution, built-in judges, red-teaming, and integration with LangWatch observability. Current version: 0.7.26, released 2026-04-28. Active development with frequent releases.","status":"active","version":"0.7.26","language":"python","source_language":"en","source_url":"https://github.com/langwatch/scenario","tags":["testing","llm","agent","evaluation","scenario"],"install":[{"cmd":"pip install langwatch-scenario","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Package name uses underscore, not dot; wrong import causes ModuleNotFoundError.","wrong":"from langwatch.scenario import ScenarioRunner","symbol":"ScenarioRunner","correct":"from langwatch_scenario import ScenarioRunner"},{"note":"EventReporter is exposed at top-level, not in a submodule.","wrong":"from langwatch_scenario.reporter import EventReporter","symbol":"EventReporter","correct":"from langwatch_scenario import EventReporter"}],"quickstart":{"code":"from langwatch_scenario import ScenarioRunner\nimport asyncio\n\nasync def main():\n    runner = ScenarioRunner(api_key=os.environ.get('LANGWATCH_API_KEY', ''))\n    result = await runner.run('example-scenario')\n    print(result)\n\nif __name__ == '__main__':\n    asyncio.run(main())","lang":"python","description":"Create a ScenarioRunner with your API key and run a predefined scenario asynchronously."},"warnings":[{"fix":"Use underscore: pip install langwatch-scenario, import langwatch_scenario.","message":"The package import uses underscore: from langwatch_scenario import ..., not from langwatch.scenario.","severity":"gotcha","affected_versions":"all"},{"fix":"Use asyncio.run() in scripts or await inside async functions.","message":"Async functions are required: run() and arun() are async. Calling them without await leads to RuntimeWarning.","severity":"gotcha","affected_versions":">=0.7.24"},{"fix":"No code changes needed, but update license notices in your project if you were complying with AGPL terms.","message":"Relicensed from AGPLv3 to Apache 2.0 in v0.7.25 – ensure your project's license is compatible.","severity":"gotcha","affected_versions":">=0.7.25"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install langwatch-scenario and use from langwatch_scenario import ScenarioRunner","cause":"Incorrect import path; the package is langwatch_scenario, not langwatch.scenario.","error":"ModuleNotFoundError: No module named 'langwatch.scenario'"},{"fix":"Wrap in asyncio.run(): result = asyncio.run(runner.run('scenario-name'))","cause":"Calling async run() without await in a non-async context.","error":"RuntimeWarning: coroutine 'ScenarioRunner.run' was never awaited"},{"fix":"Set LANGWATCH_API_KEY environment variable or pass api_key='your_key' to ScenarioRunner.","cause":"Missing or incorrect LANGWATCH_API_KEY environment variable or api_key parameter.","error":"langwatch_scenario.exceptions.AuthenticationError: Invalid API key"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}