### Install and Start agently-devtools Source: https://github.com/agentera/agently/blob/main/docs/en/observability/devtools.md Install the necessary packages and start the devtools service. This sets up local endpoints for observation and interactive UIs. ```bash pip install -U agently agently-devtools agently-devtools start ``` -------------------------------- ### Runtime Planner Effort Strategy Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Run an example demonstrating a runtime planner with an effort strategy. ```bash python examples/skills_executor/09_runtime_planner_effort_strategy.py ``` -------------------------------- ### Executable Education Course Pack Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Run an example demonstrating an executable education course pack. ```bash python examples/skills_executor/06_executable_education_course_pack.py ``` -------------------------------- ### Run All Cookbook Examples Source: https://github.com/agentera/agently/blob/main/examples/cookbook/README.md Execute all provided Agently cookbook examples using Python scripts. ```bash python examples/cookbook/01_action_loop_math_model.py python examples/cookbook/02_router_branching_model.py python examples/cookbook/03_todo_concurrent_model.py python examples/cookbook/04_reflection_loop_model.py python examples/cookbook/05_safe_shell_policy_model.py ``` -------------------------------- ### Install Agently and DevTools Source: https://github.com/agentera/agently/blob/main/examples/devtools/README.md Install the necessary Agently and Agently-DevTools packages using pip. This is a prerequisite for running the examples. ```bash pip install -U agently agently-devtools ``` -------------------------------- ### Start Agent with Actions and Skills Source: https://github.com/agentera/agently/blob/main/docs/en/start/auto-orchestration.md Use this to start an agent with specific actions and skills packs, defining input and output formats. ```python result = ( agent .use_actions([market_data_action]) .use_skills_packs(["equity-research"]) .input("Review this renewal risk.") .output({"answer": (str, "final answer", True)}) .start() ) ``` -------------------------------- ### Minimum FastAPI Setup Source: https://github.com/agentera/agently/blob/main/docs/en/services/fastapi.md Demonstrates the minimum setup for exposing an Agently agent using FastAPIHelper with a POST endpoint for chat interactions. ```APIDOC ## POST /chat ### Description Handles chat requests to an Agently agent. ### Method POST ### Endpoint /chat ### Parameters #### Request Body - **data** (object) - Required - Contains input for the agent. - **input** (string) - Required - The user's input message. - **options** (object) - Optional - Additional options for the request. ### Request Example ```json { "data": { "input": "hello" }, "options": {} } ``` ### Response #### Success Response (200) - **status** (integer) - The status code of the response. - **data** (any) - The serialized response from the agent. - **msg** (null) - Null for successful responses. #### Response Example ```json { "status": 200, "data": , "msg": null } ``` #### Error Response (422, 504, 400) - **status** (integer) - The status code indicating an error. - **data** (null) - Null for error responses. - **msg** (string) - An error message. - **error** (object) - Detailed error information. - **type** (string) - The type of exception raised. - **message** (string) - The error message. - **args** (array) - Arguments passed to the exception. #### Error Response Example ```json { "status": 422, "data": null, "msg": "...error message...", "error": { "type": "ValueError", "message": "...", "args": [...] } } ``` ``` -------------------------------- ### Stock Research Business Minimal Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Run a minimal example for stock research using business-oriented skills. ```bash python examples/skills_executor/03_stock_research_business_minimal.py ``` -------------------------------- ### Model Pool Key Pool Resolution Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Execute an example for model pool and key pool resolution. ```bash python examples/skills_executor/10_model_pool_key_pool_resolution.py ``` -------------------------------- ### Minimum FastAPI Setup Source: https://github.com/agentera/agently/blob/main/docs/en/services/fastapi.md Demonstrates the basic setup for exposing an agent using FastAPIHelper. Ensure uvicorn is used for running the application. The default POST body expects 'data' and 'options' fields. ```python from agently import Agently from agently.integrations.fastapi import FastAPIHelper agent = Agently.create_agent() app = FastAPIHelper(response_provider=agent) app.use_post("/chat") ``` -------------------------------- ### Verify Model Connectivity Source: https://github.com/agentera/agently/blob/main/docs/en/start/model-setup.md Use this snippet to verify that your model setup is working by creating an agent and starting a conversation. If this returns text, your model setup is successful. Authentication or connection errors indicate issues with `base_url`, `api_key`, or network reachability. ```python result = ( Agently.create_agent() .input("Say hello in one short sentence.") .start() ) print(result) ``` -------------------------------- ### Dynamic Task Creation and Execution Source: https://github.com/agentera/agently/blob/main/README.md Create and execute a dynamic task with a defined DAG. This example shows how to define local handlers and a task graph with dependencies, then start the task execution. ```python from agently import Agently async def local_handler(context): return {"task_id": context.task.id, "deps": dict(context.dependency_results)} task = Agently.create_dynamic_task( target="review policy", plan={ "graph_id": "review", "task_schema_version": "task_dag/v1", "tasks": [ {"id": "extract", "kind": "local", "binding": "local_handler"}, {"id": "final", "kind": "local", "binding": "local_handler", "depends_on": ["extract"]}, ], "semantic_outputs": {"final": "final"}, }, handlers={"local_handler": local_handler}, ) snapshot = await task.async_start(timeout=10) ``` -------------------------------- ### Install Agently Source: https://github.com/agentera/agently/blob/main/README.md Install the Agently library using pip. ```bash pip install -U agently ``` -------------------------------- ### Install and Initialize Agently DevTools Source: https://github.com/agentera/agently/blob/main/README.md Installs the agently-devtools package and initializes a new project. Recommended for local observation, evaluation, and project scaffolding. ```bash pip install agently-devtools agently-devtools init my_project ``` -------------------------------- ### Deepseek External Skill Cards Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Execute an example that utilizes Deepseek for external skill cards. ```bash python examples/skills_executor/02_deepseek_external_skill_cards.py ``` -------------------------------- ### Start Local DevTools Listener Source: https://github.com/agentera/agently/blob/main/examples/devtools/README.md Start the local DevTools listener. This is required for observation and evaluation examples, as well as for inspecting runs in the DevTools console. ```bash agently-devtools start ``` -------------------------------- ### Configure and Install Local Skills Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Configure the skills executor for local development and install skills from a specified directory. The skill ID is derived from the frontmatter name. ```python # Local authoring path: Skill = SKILL.md guidance plus optional standard frontmatter Agently.skills_executor.configure(registry_root=reg_dir, allowed_trust_levels=["local"]) contract = Agently.skills_executor.install_skills(skill_dir, trust_level="local", update=True) skill_id = contract["skill_id"] # slug of the frontmatter `name` ``` -------------------------------- ### Architecture Diagram Skill Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Execute a skill that generates an architecture diagram. ```bash python examples/skills_executor/08_architecture_diagram_skill.py ``` -------------------------------- ### Dynamic To-Do Triggerflow Real Case Example Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Demonstrates a real-case scenario of a dynamic to-do list managed by a triggerflow. ```bash python examples/skills_executor/04_dynamic_todo_triggerflow_realcase.py ``` -------------------------------- ### Register and Inspect Search Action Locally Source: https://github.com/agentera/agently/blob/main/examples/builtin_actions/README.md Demonstrates how to mount the Search action using agent.use_actions() and inspect its registered actions. This example does not require a model. ```python python examples/builtin_actions/01_search_package_registration_local.py ``` -------------------------------- ### Define and Run a Simple Hello Flow Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/overview.md Demonstrates how to define a TriggerFlow, chain a handler, create an execution, start it with input, and retrieve the final state snapshot. ```python import asyncio from agently import TriggerFlow, TriggerFlowRuntimeData async def hello(): flow = TriggerFlow(name="hello") async def greet(data: TriggerFlowRuntimeData): await data.async_set_state("greeting", f"Hello, {data.input}!") flow.to(greet) execution = flow.create_execution() await execution.async_start("World") snapshot = await execution.async_close() print(snapshot["greeting"]) # Hello, World! asyncio.run(hello()) ``` -------------------------------- ### Minimal MCP Example Source: https://github.com/agentera/agently/blob/main/docs/en/actions/mcp.md Connects to an MCP server using a URL and queries for weather information. Ensure environment variables for OpenAI compatibility are set. ```python import os import asyncio from dotenv import load_dotenv, find_dotenv from agently import Agently load_dotenv(find_dotenv()) Agently.set_settings("OpenAICompatible", { "base_url": "${ENV.OPENAI_BASE_URL}", "api_key": "${ENV.OPENAI_API_KEY}", "model": "${ENV.OPENAI_MODEL}", }) agent = Agently.create_agent() async def main(): result = ( await agent.use_mcp(f"https://mcp.amap.com/mcp?key={os.environ.get('AMAP_API_KEY')}") .input("What's the weather like in Shanghai today?") .async_start() ) print(result) asyncio.run(main()) ``` -------------------------------- ### Install Local Skill Directory Source: https://github.com/agentera/agently/blob/main/docs/en/development/skills-executor.md Use `install_skills(...)` to copy a local Skill directory into the registry. This is suitable for authoring and smoke-testing local Skills. ```python contract = Agently.skills_executor.install_skills("./release-review") agent.use_skills([contract["skill_id"]], mode="model_decision") ``` -------------------------------- ### Worked Example: Approval Flow Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/pause-and-resume.md This example demonstrates a complete TriggerFlow with pausing for approval and resuming the execution. It requires creating an execution with `flow.create_execution(...)` to allow external control via `async_continue_with`. ```python import asyncio from agently import TriggerFlow, TriggerFlowRuntimeData async def main(): flow = TriggerFlow(name="approval") async def ask(data: TriggerFlowRuntimeData): return await data.async_pause_for( type="exchange", exchange_kind="approval", payload={"question": f"Approve refund for ticket {data.input}?"}, resume_to="next", ) async def commit(data: TriggerFlowRuntimeData): await data.async_set_state("decision", data.input) flow.to(ask).to(commit) execution = flow.create_execution(auto_close=False) await execution.async_start("T-001") # In a real system the UI / webhook would call continue_with later. # Here we resume from the same coroutine for demo purposes. interrupt_id = next(iter(execution.get_pending_interrupts())) await execution.async_continue_with(interrupt_id, {"approved": True}) snapshot = await execution.async_close() print(snapshot["decision"]) asyncio.run(main()) ``` -------------------------------- ### Prompt File with Slots and Output Contracts Source: https://github.com/agentera/agently/blob/main/README.md Example of a prompt file defining an instruction and specifying the expected output contract with types and ensuring fields. ```yaml .request: instruct: | You are a concise editor. Keep facts intact. output: title: $type: str $ensure: true body: $type: str $ensure: true ``` -------------------------------- ### Install Remote Skill Pack Source: https://github.com/agentera/agently/blob/main/docs/en/development/skills-executor.md Use `install_skills_pack(...)` for advanced pool management like prewarming, offline mirrors, or explicit registry maintenance. This clones the repository and installs the Skill into Agently's local registry. ```python report = Agently.skills_executor.install_skills_pack( "anthropics/skills", fetch=True, subpath="skills/docx", trust_level="remote", ) ``` -------------------------------- ### Basic Declarative Skills Execution Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Run a basic example of declarative skills without needing a specific model. ```bash python examples/skills_executor/01_basic_declarative_skills.py # no model needed ``` -------------------------------- ### Install Agently Skills via CLI Source: https://github.com/agentera/agently/blob/main/docs/en/development/coding-agents.md Install the default Agently app bundle of skills using the 'skills add' command. This command iterates through the core skills and adds them to your agent. ```bash for skill in \ agently \ agently-request \ agently-runtime \ agently-dynamic-task \ agently-triggerflow do npx skills add AgentEra/Agently-Skills --agent "$AGENT" --skill "$skill" -y done ``` -------------------------------- ### Run Local Browser Environment Browse Source: https://github.com/agentera/agently/blob/main/examples/execution_environment/README.md Demonstrates using a managed browser resource with `Browse(use_browser_environment=True)`. Requires Playwright and a compatible browser (like Chromium) to be installed. ```bash python examples/execution_environment/07_browser_environment_browse_local.py ``` -------------------------------- ### Start TriggerFlow and Get Close Snapshot Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/execution-result.md For simple scripts, use the close snapshot directly after starting the flow. This is a straightforward way to get the final outcome. ```python snapshot = await flow.async_start(input_data) ``` -------------------------------- ### Explicit Execution Draft Capture Source: https://github.com/agentera/agently/blob/main/docs/en/start/auto-orchestration.md Capture an execution draft explicitly for multi-statement setup, allowing for chained input and output definitions before starting the agent. ```python execution = agent.create_execution() execution.input("Review this renewal risk.") execution.output({"answer": (str, "final answer", True)}) result = await execution.async_start() ``` -------------------------------- ### Start an execution explicitly Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/lifecycle.md Use `flow.async_start_execution` to get an execution handle, allowing for more control over its lifecycle. This is ideal for services, streaming, or scenarios requiring external interaction before closing. ```python execution = await flow.async_start_execution("input value") # ... do something with the handle ... snapshot = await execution.async_close() ``` -------------------------------- ### Start flow and always get close snapshot (New) Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/compatibility.md Use `await flow.async_start()` to initiate a flow and always receive the complete close snapshot. This is the modern approach for waiting for a result. ```python snapshot = await flow.async_start("input") # always returns close snapshot ``` -------------------------------- ### Basic Request with Schema Source: https://github.com/agentera/agently/blob/main/docs/en/requests/overview.md Constructs a basic request by defining the input prompt and the desired output schema. The `start()` method executes the request and applies the validation pipeline. ```python from agently import Agently agent = Agently.create_agent() result = ( agent .input("Summarize this article in three bullets.") .output({ "title": (str, "Title", True), "bullets": [(str, "Bullet point", True)], }) .start() ) ``` -------------------------------- ### Load YAML Prompt and Execute Source: https://github.com/agentera/agently/blob/main/docs/en/requests/prompt-management.md Load a prompt configuration from a YAML file and execute an agent with specific input. This demonstrates setting execution-scoped prompts and starting the agent. ```yaml # prompts/triage.yaml $ensure_all_keys: true .agent: system: You are a ticket triage assistant. info: severities: ["P0", "P1", "P2", "P3"] .execution: instruct: Classify the ticket text. output: $format: json severity: $type: str $desc: One of P0/P1/P2/P3 $ensure: true rationale: $type: str $desc: One-line reason $ensure: true ``` ```python agent = Agently.create_agent().load_yaml_prompt("prompts/triage.yaml") result = ( agent .create_execution() .set_execution_prompt("input", "Login fails for all users in EU region.") .start() ) ``` -------------------------------- ### Async Handler Example Source: https://github.com/agentera/agently/blob/main/docs/en/requests/output-control.md An example of an asynchronous handler that performs an external check and returns a boolean result. ```python async def check_remote(result, ctx): ok = await some_external_check(result["answer"]) return ok ``` -------------------------------- ### Create and Start a Dynamic Task Source: https://github.com/agentera/agently/blob/main/docs/en/dynamic-task/README.md Use Agently.create_dynamic_task to create a task with a target and then start its execution asynchronously. ```python task = Agently.create_dynamic_task(target="review policy") result = await task.async_start() ``` -------------------------------- ### Core Creation Styles Source: https://github.com/agentera/agently/blob/main/docs/en/start/quickstart.md Demonstrates direct constructors and factory helpers for creating Agently core instances like Agents, TriggerFlows, and Workspaces. ```python from agently import Agent, Agently, TriggerFlow agent = Agent("repo-worker") factory_agent = Agently.create_agent("repo-worker") flow = TriggerFlow(name="review-flow") factory_flow = Agently.create_trigger_flow("review-flow") workspace = Agently.create_workspace("./.agently/runs/review-flow") ``` -------------------------------- ### Using Built-in Action Packages Source: https://github.com/agentera/agently/blob/main/README.md Integrate pre-built action packages like Search and Browse into the agent's capabilities. ```python from agently.builtins.actions import Browse, Search agent.use_actions(Search(timeout=15, backend="duckduckgo")) agent.use_actions(Browse()) ``` -------------------------------- ### Run Local Node.js Environment Action Source: https://github.com/agentera/agently/blob/main/examples/execution_environment/README.md Demonstrates enabling and calling a Node.js action with a local execution environment. Requires Node.js to be installed and available in the system's PATH. ```bash python examples/execution_environment/05_action_nodejs_environment_local.py ``` -------------------------------- ### API Response Example Source: https://github.com/agentera/agently/blob/main/examples/fastapi/no_integrated/production_env_server_example/README.md Example of a successful JSON response from the `/request_model` API endpoint, containing a status ('ok'), structured data, and a text representation of the data. ```json { "ok": true, "data": { "thinking": "OK, user asked me about who am I, I shall response politely.", "reply": "Hi, I am an AI assistant that can help you. Please ask me anything." }, "text": "```json\n{\"thinking\": \"OK, user asked me about who am I, I shall response politely.\",\"reply\": \"Hi, I am an AI assistant that can help you. Please ask me anything.\"}```" } ``` -------------------------------- ### Setting and Getting State in TriggerFlow Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/state-and-resources.md Demonstrates how to set and get state within a TriggerFlow execution. Use async variants for writes to maintain an async-first approach. ```python async def step(data: TriggerFlowRuntimeData): await data.async_set_state("greeting", f"hello {data.input}") current = data.get_state("greeting") ``` -------------------------------- ### Single-Server Resume with Redis Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/persistence-and-blueprint.md Demonstrates saving an execution state to Redis and then restoring it later. Ensure Redis is set up and accessible. ```python flow.declare_resource_requirement("approval_service") saved = execution.save() redis.set(f"flow:{exec_id}", json.dumps(saved)) # later saved = json.loads(redis.get(f"flow:{exec_id}")) restored = flow.create_execution(auto_close=False) await restored.async_load( saved, runtime_resources={"approval_service": approval_service}, ) ``` -------------------------------- ### Using Skills with Host Tool and Prompt-Only Skill Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md This snippet demonstrates how to use a list of skills, including remote ones from OctagonAI and Anthropic, and a host tool for fetching market data before agent execution. It's suitable for applications needing integrated research and analysis. ```python agent.use_skills([ {"source": "OctagonAI/skills", "subpath": "skills/market-analyst-master"}, {"source": "OctagonAI/skills", "subpath": "skills/financial-analyst-master"}, {"source": "OctagonAI/skills", "subpath": "skills/sec-analyst-master"}, {"source": "OctagonAI/skills", "subpath": "skills/earnings-analyst-master"}, {"source": "anthropics/skills", "subpath": "skills/docx"}, {"source": "anthropics/skills", "subpath": "skills/xlsx"}, ], mode="required") market_data = fetch_equity_market_data("NVDA, AMD, AVGO") # host tool, real I/O execution = agent.run_skills_task( f"Analyze NVDA/AMD/AVGO. market_data: {market_data}", mode="required", effort="normal", output={...}, ) result = execution.output ``` -------------------------------- ### Get snapshot using async_close() (New) Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/compatibility.md Use `await execution.async_close()` to get the final snapshot of the execution. This is the modern alternative to `get_result()` when you need the entire snapshot. ```python snapshot = await execution.async_close() answer = snapshot["answer"] ``` -------------------------------- ### Start a pre-built execution (auto_close=True) Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/lifecycle.md When `auto_close` is True (default), `execution.async_start` returns the close snapshot directly. This is useful for simple executions where you want the flow to automatically finalize after starting. ```python execution = flow.create_execution(auto_close=True) snapshot = await execution.async_start("input") # returns close snapshot ``` -------------------------------- ### Initialize ChromaDB Collection with Embeddings Source: https://github.com/agentera/agently/blob/main/examples/cheatsheet_for_coding_agent_en.txt Set up a ChromaDB collection for knowledge base integration. Requires an embeddings agent configured with a compatible model and base URL. ```python from agently.integrations.chromadb import ChromaCollection embedding = Agently.create_agent() embedding.set_settings( "OpenAICompatible", { "model": "qwen3-embedding:0.6b", "base_url": "http://127.0.0.1:11434/v1/", "auth": "nothing", "model_type": "embeddings", }, ) collection = ChromaCollection(collection_name="agently_examples", embedding_agent=embedding) ``` -------------------------------- ### Minimal Async Example in Agently Source: https://github.com/agentera/agently/blob/main/docs/en/start/async-first.md Demonstrates a basic asynchronous interaction with an Agently agent, including streaming results and retrieving final data. Use this for understanding the core async workflow. ```python import asyncio from agently import Agently agent = Agently.create_agent() async def main(): result = ( agent .input("Give me a title and two bullets.") .output({ "title": (str, "Title", True), "items": [(str, "Bullet point", True)], }) .get_result() ) async for item in result.get_async_generator(type="instant"): if item.delta: print(item.path, "+", item.delta) if item.is_complete: print(item.path, "done") final = await result.async_get_data() print(final) asyncio.run(main()) ``` -------------------------------- ### Build Skills Context Pack Source: https://github.com/agentera/agently/blob/main/docs/en/development/skills-executor.md Use `async_build_skills_context_pack` to create a context pack for DAG consumers. This includes skill guidance, references, examples, and metadata without executing the full skill route. Specify skills, intent, and budget for the pack. ```python pack = await agent.async_build_skills_context_pack( "Generate DeepSeek provider setup code.", skills=["model-setup"], intent="generate_code", include_examples="auto", include_references="auto", budget_chars=12000, ) ``` -------------------------------- ### Parallel Agent Starts Source: https://github.com/agentera/agently/blob/main/docs/en/start/auto-orchestration.md Execute multiple agent summarization tasks concurrently using asyncio.gather for efficiency. ```python results = await asyncio.gather( agent.input("Summarize request A").async_start(), agent.input("Summarize request B").async_start(), agent.input("Summarize request C").async_start(), ) ``` -------------------------------- ### Using Older Compatibility Surface for Tools Source: https://github.com/agentera/agently/blob/main/docs/en/actions/action-runtime.md Demonstrates how to use the older compatibility surface for defining and using tools. These methods map to the new action runtime internally and remain valid. ```python @agent.tool_func def add(a: int, b: int) -> int: return a + b agent.use_tool(add) agent.use_tools([add]) agent.use_mcp("https://...") agent.use_sandbox(...) extra.tool_logs # equivalent to extra.action_logs at the old surface ``` -------------------------------- ### Configure DeepSeek Environment Source: https://github.com/agentera/agently/blob/main/examples/cookbook/README.md Set environment variables to use DeepSeek as the model provider for Agently cookbook examples. ```bash export COOKBOOK_MODEL_PROVIDER=deepseek export DEEPSEEK_API_KEY=... ``` -------------------------------- ### Start a TriggerFlow Execution Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/persistence-and-blueprint.md Initiates a TriggerFlow execution with specific runtime resources. Use `async_start` for finite workflows. ```python # my_app/api.py from my_app.policy_flow import policy_flow snapshot = await policy_flow.async_start( "travel subsidy?", runtime_resources={ "agent_factory": make_agent, "prompts_path": PROMPTS_DIR / "policy.yaml", "policy_doc": tenant_policy_doc, }, ) ``` -------------------------------- ### Combo Skillpack Diagnostics with Fetch Missing Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Execute a combined skillpack for diagnostics, including fetching missing components. ```bash python examples/skills_executor/05_combo_skillpack_diagnostics.py --fetch-missing ``` -------------------------------- ### Get TriggerFlow Close Snapshot Source: https://github.com/agentera/agently/blob/main/docs/en/triggerflow/execution-result.md The close snapshot is the canonical completed state of a TriggerFlow. It is obtained after explicitly closing the execution. ```python snapshot = await execution.async_close() ``` -------------------------------- ### Loading and Using a YAML Prompt Source: https://github.com/agentera/agently/blob/main/docs/en/start/project-framework.md Python code demonstrating how to load a YAML prompt and use it with an Agently agent. The agent is created, the prompt is loaded, and then an input is processed to start the agent. ```python from agently import Agently agent = Agently.create_agent().load_yaml_prompt("prompts/summarize.yaml") result = agent.input(article_text).start() ``` -------------------------------- ### Enable Runtime Logs Source: https://github.com/agentera/agently/blob/main/docs/en/start/settings.md Configure runtime logging levels for different components. Options include False/"off", True/"simple", or "detail". "simple" shows summaries, while "detail" shows the full event stream. ```python Agently.set_settings("runtime.show_model_logs", True) ``` ```python Agently.set_settings("runtime.show_action_logs", True) ``` ```python Agently.set_settings("runtime.show_trigger_flow_logs", True) ``` ```python Agently.set_settings("runtime.show_runtime_logs", "detail") ``` -------------------------------- ### Configure Ollama Environment Source: https://github.com/agentera/agently/blob/main/examples/cookbook/README.md Set environment variables to use a local Ollama instance as the model provider for Agently cookbook examples. ```bash export COOKBOOK_MODEL_PROVIDER=ollama export OLLAMA_BASE_URL=http://localhost:11434/v1 export OLLAMA_DEFAULT_MODEL=qwen2.5:7b ``` -------------------------------- ### Configure Skills Executor Registry Source: https://github.com/agentera/agently/blob/main/examples/skills_executor/README.md Configure the skills executor registry with the root path and allowed trust levels. This is a one-time setup. ```python Agently.skills_executor.configure(registry_root=..., allowed_trust_levels=["local"]) ```