@synsci/cli-darwin-x64 1.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/skills/accelerate/SKILL.md +332 -0
- package/bin/skills/accelerate/references/custom-plugins.md +453 -0
- package/bin/skills/accelerate/references/megatron-integration.md +489 -0
- package/bin/skills/accelerate/references/performance.md +525 -0
- package/bin/skills/audiocraft/SKILL.md +564 -0
- package/bin/skills/audiocraft/references/advanced-usage.md +666 -0
- package/bin/skills/audiocraft/references/troubleshooting.md +504 -0
- package/bin/skills/autogpt/SKILL.md +403 -0
- package/bin/skills/autogpt/references/advanced-usage.md +535 -0
- package/bin/skills/autogpt/references/troubleshooting.md +420 -0
- package/bin/skills/awq/SKILL.md +310 -0
- package/bin/skills/awq/references/advanced-usage.md +324 -0
- package/bin/skills/awq/references/troubleshooting.md +344 -0
- package/bin/skills/axolotl/SKILL.md +158 -0
- package/bin/skills/axolotl/references/api.md +5548 -0
- package/bin/skills/axolotl/references/dataset-formats.md +1029 -0
- package/bin/skills/axolotl/references/index.md +15 -0
- package/bin/skills/axolotl/references/other.md +3563 -0
- package/bin/skills/bigcode-evaluation-harness/SKILL.md +405 -0
- package/bin/skills/bigcode-evaluation-harness/references/benchmarks.md +393 -0
- package/bin/skills/bigcode-evaluation-harness/references/custom-tasks.md +424 -0
- package/bin/skills/bigcode-evaluation-harness/references/issues.md +394 -0
- package/bin/skills/bitsandbytes/SKILL.md +411 -0
- package/bin/skills/bitsandbytes/references/memory-optimization.md +521 -0
- package/bin/skills/bitsandbytes/references/qlora-training.md +521 -0
- package/bin/skills/bitsandbytes/references/quantization-formats.md +447 -0
- package/bin/skills/blip-2/SKILL.md +564 -0
- package/bin/skills/blip-2/references/advanced-usage.md +680 -0
- package/bin/skills/blip-2/references/troubleshooting.md +526 -0
- package/bin/skills/chroma/SKILL.md +406 -0
- package/bin/skills/chroma/references/integration.md +38 -0
- package/bin/skills/clip/SKILL.md +253 -0
- package/bin/skills/clip/references/applications.md +207 -0
- package/bin/skills/constitutional-ai/SKILL.md +290 -0
- package/bin/skills/crewai/SKILL.md +498 -0
- package/bin/skills/crewai/references/flows.md +438 -0
- package/bin/skills/crewai/references/tools.md +429 -0
- package/bin/skills/crewai/references/troubleshooting.md +480 -0
- package/bin/skills/deepspeed/SKILL.md +141 -0
- package/bin/skills/deepspeed/references/08.md +17 -0
- package/bin/skills/deepspeed/references/09.md +173 -0
- package/bin/skills/deepspeed/references/2020.md +378 -0
- package/bin/skills/deepspeed/references/2023.md +279 -0
- package/bin/skills/deepspeed/references/assets.md +179 -0
- package/bin/skills/deepspeed/references/index.md +35 -0
- package/bin/skills/deepspeed/references/mii.md +118 -0
- package/bin/skills/deepspeed/references/other.md +1191 -0
- package/bin/skills/deepspeed/references/tutorials.md +6554 -0
- package/bin/skills/dspy/SKILL.md +590 -0
- package/bin/skills/dspy/references/examples.md +663 -0
- package/bin/skills/dspy/references/modules.md +475 -0
- package/bin/skills/dspy/references/optimizers.md +566 -0
- package/bin/skills/faiss/SKILL.md +221 -0
- package/bin/skills/faiss/references/index_types.md +280 -0
- package/bin/skills/flash-attention/SKILL.md +367 -0
- package/bin/skills/flash-attention/references/benchmarks.md +215 -0
- package/bin/skills/flash-attention/references/transformers-integration.md +293 -0
- package/bin/skills/gguf/SKILL.md +427 -0
- package/bin/skills/gguf/references/advanced-usage.md +504 -0
- package/bin/skills/gguf/references/troubleshooting.md +442 -0
- package/bin/skills/gptq/SKILL.md +450 -0
- package/bin/skills/gptq/references/calibration.md +337 -0
- package/bin/skills/gptq/references/integration.md +129 -0
- package/bin/skills/gptq/references/troubleshooting.md +95 -0
- package/bin/skills/grpo-rl-training/README.md +97 -0
- package/bin/skills/grpo-rl-training/SKILL.md +572 -0
- package/bin/skills/grpo-rl-training/examples/reward_functions_library.py +393 -0
- package/bin/skills/grpo-rl-training/templates/basic_grpo_training.py +228 -0
- package/bin/skills/guidance/SKILL.md +572 -0
- package/bin/skills/guidance/references/backends.md +554 -0
- package/bin/skills/guidance/references/constraints.md +674 -0
- package/bin/skills/guidance/references/examples.md +767 -0
- package/bin/skills/hqq/SKILL.md +445 -0
- package/bin/skills/hqq/references/advanced-usage.md +528 -0
- package/bin/skills/hqq/references/troubleshooting.md +503 -0
- package/bin/skills/hugging-face-cli/SKILL.md +191 -0
- package/bin/skills/hugging-face-cli/references/commands.md +954 -0
- package/bin/skills/hugging-face-cli/references/examples.md +374 -0
- package/bin/skills/hugging-face-datasets/SKILL.md +547 -0
- package/bin/skills/hugging-face-datasets/examples/diverse_training_examples.json +239 -0
- package/bin/skills/hugging-face-datasets/examples/system_prompt_template.txt +196 -0
- package/bin/skills/hugging-face-datasets/examples/training_examples.json +176 -0
- package/bin/skills/hugging-face-datasets/scripts/dataset_manager.py +522 -0
- package/bin/skills/hugging-face-datasets/scripts/sql_manager.py +844 -0
- package/bin/skills/hugging-face-datasets/templates/chat.json +55 -0
- package/bin/skills/hugging-face-datasets/templates/classification.json +62 -0
- package/bin/skills/hugging-face-datasets/templates/completion.json +51 -0
- package/bin/skills/hugging-face-datasets/templates/custom.json +75 -0
- package/bin/skills/hugging-face-datasets/templates/qa.json +54 -0
- package/bin/skills/hugging-face-datasets/templates/tabular.json +81 -0
- package/bin/skills/hugging-face-evaluation/SKILL.md +656 -0
- package/bin/skills/hugging-face-evaluation/examples/USAGE_EXAMPLES.md +382 -0
- package/bin/skills/hugging-face-evaluation/examples/artificial_analysis_to_hub.py +141 -0
- package/bin/skills/hugging-face-evaluation/examples/example_readme_tables.md +135 -0
- package/bin/skills/hugging-face-evaluation/examples/metric_mapping.json +50 -0
- package/bin/skills/hugging-face-evaluation/requirements.txt +20 -0
- package/bin/skills/hugging-face-evaluation/scripts/evaluation_manager.py +1374 -0
- package/bin/skills/hugging-face-evaluation/scripts/inspect_eval_uv.py +104 -0
- package/bin/skills/hugging-face-evaluation/scripts/inspect_vllm_uv.py +317 -0
- package/bin/skills/hugging-face-evaluation/scripts/lighteval_vllm_uv.py +303 -0
- package/bin/skills/hugging-face-evaluation/scripts/run_eval_job.py +98 -0
- package/bin/skills/hugging-face-evaluation/scripts/run_vllm_eval_job.py +331 -0
- package/bin/skills/hugging-face-evaluation/scripts/test_extraction.py +206 -0
- package/bin/skills/hugging-face-jobs/SKILL.md +1041 -0
- package/bin/skills/hugging-face-jobs/index.html +216 -0
- package/bin/skills/hugging-face-jobs/references/hardware_guide.md +336 -0
- package/bin/skills/hugging-face-jobs/references/hub_saving.md +352 -0
- package/bin/skills/hugging-face-jobs/references/token_usage.md +546 -0
- package/bin/skills/hugging-face-jobs/references/troubleshooting.md +475 -0
- package/bin/skills/hugging-face-jobs/scripts/cot-self-instruct.py +718 -0
- package/bin/skills/hugging-face-jobs/scripts/finepdfs-stats.py +546 -0
- package/bin/skills/hugging-face-jobs/scripts/generate-responses.py +587 -0
- package/bin/skills/hugging-face-model-trainer/SKILL.md +711 -0
- package/bin/skills/hugging-face-model-trainer/references/gguf_conversion.md +296 -0
- package/bin/skills/hugging-face-model-trainer/references/hardware_guide.md +283 -0
- package/bin/skills/hugging-face-model-trainer/references/hub_saving.md +364 -0
- package/bin/skills/hugging-face-model-trainer/references/reliability_principles.md +371 -0
- package/bin/skills/hugging-face-model-trainer/references/trackio_guide.md +189 -0
- package/bin/skills/hugging-face-model-trainer/references/training_methods.md +150 -0
- package/bin/skills/hugging-face-model-trainer/references/training_patterns.md +203 -0
- package/bin/skills/hugging-face-model-trainer/references/troubleshooting.md +282 -0
- package/bin/skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +424 -0
- package/bin/skills/hugging-face-model-trainer/scripts/dataset_inspector.py +417 -0
- package/bin/skills/hugging-face-model-trainer/scripts/estimate_cost.py +150 -0
- package/bin/skills/hugging-face-model-trainer/scripts/train_dpo_example.py +106 -0
- package/bin/skills/hugging-face-model-trainer/scripts/train_grpo_example.py +89 -0
- package/bin/skills/hugging-face-model-trainer/scripts/train_sft_example.py +122 -0
- package/bin/skills/hugging-face-paper-publisher/SKILL.md +627 -0
- package/bin/skills/hugging-face-paper-publisher/examples/example_usage.md +327 -0
- package/bin/skills/hugging-face-paper-publisher/references/quick_reference.md +216 -0
- package/bin/skills/hugging-face-paper-publisher/scripts/paper_manager.py +508 -0
- package/bin/skills/hugging-face-paper-publisher/templates/arxiv.md +299 -0
- package/bin/skills/hugging-face-paper-publisher/templates/ml-report.md +358 -0
- package/bin/skills/hugging-face-paper-publisher/templates/modern.md +319 -0
- package/bin/skills/hugging-face-paper-publisher/templates/standard.md +201 -0
- package/bin/skills/hugging-face-tool-builder/SKILL.md +115 -0
- package/bin/skills/hugging-face-tool-builder/references/baseline_hf_api.py +57 -0
- package/bin/skills/hugging-face-tool-builder/references/baseline_hf_api.sh +40 -0
- package/bin/skills/hugging-face-tool-builder/references/baseline_hf_api.tsx +57 -0
- package/bin/skills/hugging-face-tool-builder/references/find_models_by_paper.sh +230 -0
- package/bin/skills/hugging-face-tool-builder/references/hf_enrich_models.sh +96 -0
- package/bin/skills/hugging-face-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
- package/bin/skills/hugging-face-tool-builder/references/hf_model_papers_auth.sh +171 -0
- package/bin/skills/hugging-face-trackio/SKILL.md +65 -0
- package/bin/skills/hugging-face-trackio/references/logging_metrics.md +206 -0
- package/bin/skills/hugging-face-trackio/references/retrieving_metrics.md +223 -0
- package/bin/skills/huggingface-tokenizers/SKILL.md +516 -0
- package/bin/skills/huggingface-tokenizers/references/algorithms.md +653 -0
- package/bin/skills/huggingface-tokenizers/references/integration.md +637 -0
- package/bin/skills/huggingface-tokenizers/references/pipeline.md +723 -0
- package/bin/skills/huggingface-tokenizers/references/training.md +565 -0
- package/bin/skills/instructor/SKILL.md +740 -0
- package/bin/skills/instructor/references/examples.md +107 -0
- package/bin/skills/instructor/references/providers.md +70 -0
- package/bin/skills/instructor/references/validation.md +606 -0
- package/bin/skills/knowledge-distillation/SKILL.md +458 -0
- package/bin/skills/knowledge-distillation/references/minillm.md +334 -0
- package/bin/skills/lambda-labs/SKILL.md +545 -0
- package/bin/skills/lambda-labs/references/advanced-usage.md +611 -0
- package/bin/skills/lambda-labs/references/troubleshooting.md +530 -0
- package/bin/skills/langchain/SKILL.md +480 -0
- package/bin/skills/langchain/references/agents.md +499 -0
- package/bin/skills/langchain/references/integration.md +562 -0
- package/bin/skills/langchain/references/rag.md +600 -0
- package/bin/skills/langsmith/SKILL.md +422 -0
- package/bin/skills/langsmith/references/advanced-usage.md +548 -0
- package/bin/skills/langsmith/references/troubleshooting.md +537 -0
- package/bin/skills/litgpt/SKILL.md +469 -0
- package/bin/skills/litgpt/references/custom-models.md +568 -0
- package/bin/skills/litgpt/references/distributed-training.md +451 -0
- package/bin/skills/litgpt/references/supported-models.md +336 -0
- package/bin/skills/litgpt/references/training-recipes.md +619 -0
- package/bin/skills/llama-cpp/SKILL.md +258 -0
- package/bin/skills/llama-cpp/references/optimization.md +89 -0
- package/bin/skills/llama-cpp/references/quantization.md +213 -0
- package/bin/skills/llama-cpp/references/server.md +125 -0
- package/bin/skills/llama-factory/SKILL.md +80 -0
- package/bin/skills/llama-factory/references/_images.md +23 -0
- package/bin/skills/llama-factory/references/advanced.md +1055 -0
- package/bin/skills/llama-factory/references/getting_started.md +349 -0
- package/bin/skills/llama-factory/references/index.md +19 -0
- package/bin/skills/llama-factory/references/other.md +31 -0
- package/bin/skills/llamaguard/SKILL.md +337 -0
- package/bin/skills/llamaindex/SKILL.md +569 -0
- package/bin/skills/llamaindex/references/agents.md +83 -0
- package/bin/skills/llamaindex/references/data_connectors.md +108 -0
- package/bin/skills/llamaindex/references/query_engines.md +406 -0
- package/bin/skills/llava/SKILL.md +304 -0
- package/bin/skills/llava/references/training.md +197 -0
- package/bin/skills/lm-evaluation-harness/SKILL.md +490 -0
- package/bin/skills/lm-evaluation-harness/references/api-evaluation.md +490 -0
- package/bin/skills/lm-evaluation-harness/references/benchmark-guide.md +488 -0
- package/bin/skills/lm-evaluation-harness/references/custom-tasks.md +602 -0
- package/bin/skills/lm-evaluation-harness/references/distributed-eval.md +519 -0
- package/bin/skills/long-context/SKILL.md +536 -0
- package/bin/skills/long-context/references/extension_methods.md +468 -0
- package/bin/skills/long-context/references/fine_tuning.md +611 -0
- package/bin/skills/long-context/references/rope.md +402 -0
- package/bin/skills/mamba/SKILL.md +260 -0
- package/bin/skills/mamba/references/architecture-details.md +206 -0
- package/bin/skills/mamba/references/benchmarks.md +255 -0
- package/bin/skills/mamba/references/training-guide.md +388 -0
- package/bin/skills/megatron-core/SKILL.md +366 -0
- package/bin/skills/megatron-core/references/benchmarks.md +249 -0
- package/bin/skills/megatron-core/references/parallelism-guide.md +404 -0
- package/bin/skills/megatron-core/references/production-examples.md +473 -0
- package/bin/skills/megatron-core/references/training-recipes.md +547 -0
- package/bin/skills/miles/SKILL.md +315 -0
- package/bin/skills/miles/references/api-reference.md +141 -0
- package/bin/skills/miles/references/troubleshooting.md +352 -0
- package/bin/skills/mlflow/SKILL.md +704 -0
- package/bin/skills/mlflow/references/deployment.md +744 -0
- package/bin/skills/mlflow/references/model-registry.md +770 -0
- package/bin/skills/mlflow/references/tracking.md +680 -0
- package/bin/skills/modal/SKILL.md +341 -0
- package/bin/skills/modal/references/advanced-usage.md +503 -0
- package/bin/skills/modal/references/troubleshooting.md +494 -0
- package/bin/skills/model-merging/SKILL.md +539 -0
- package/bin/skills/model-merging/references/evaluation.md +462 -0
- package/bin/skills/model-merging/references/examples.md +428 -0
- package/bin/skills/model-merging/references/methods.md +352 -0
- package/bin/skills/model-pruning/SKILL.md +495 -0
- package/bin/skills/model-pruning/references/wanda.md +347 -0
- package/bin/skills/moe-training/SKILL.md +526 -0
- package/bin/skills/moe-training/references/architectures.md +432 -0
- package/bin/skills/moe-training/references/inference.md +348 -0
- package/bin/skills/moe-training/references/training.md +425 -0
- package/bin/skills/nanogpt/SKILL.md +290 -0
- package/bin/skills/nanogpt/references/architecture.md +382 -0
- package/bin/skills/nanogpt/references/data.md +476 -0
- package/bin/skills/nanogpt/references/training.md +564 -0
- package/bin/skills/nemo-curator/SKILL.md +383 -0
- package/bin/skills/nemo-curator/references/deduplication.md +87 -0
- package/bin/skills/nemo-curator/references/filtering.md +102 -0
- package/bin/skills/nemo-evaluator/SKILL.md +494 -0
- package/bin/skills/nemo-evaluator/references/adapter-system.md +340 -0
- package/bin/skills/nemo-evaluator/references/configuration.md +447 -0
- package/bin/skills/nemo-evaluator/references/custom-benchmarks.md +315 -0
- package/bin/skills/nemo-evaluator/references/execution-backends.md +361 -0
- package/bin/skills/nemo-guardrails/SKILL.md +297 -0
- package/bin/skills/nnsight/SKILL.md +436 -0
- package/bin/skills/nnsight/references/README.md +78 -0
- package/bin/skills/nnsight/references/api.md +344 -0
- package/bin/skills/nnsight/references/tutorials.md +300 -0
- package/bin/skills/openrlhf/SKILL.md +249 -0
- package/bin/skills/openrlhf/references/algorithm-comparison.md +404 -0
- package/bin/skills/openrlhf/references/custom-rewards.md +530 -0
- package/bin/skills/openrlhf/references/hybrid-engine.md +287 -0
- package/bin/skills/openrlhf/references/multi-node-training.md +454 -0
- package/bin/skills/outlines/SKILL.md +652 -0
- package/bin/skills/outlines/references/backends.md +615 -0
- package/bin/skills/outlines/references/examples.md +773 -0
- package/bin/skills/outlines/references/json_generation.md +652 -0
- package/bin/skills/peft/SKILL.md +431 -0
- package/bin/skills/peft/references/advanced-usage.md +514 -0
- package/bin/skills/peft/references/troubleshooting.md +480 -0
- package/bin/skills/phoenix/SKILL.md +475 -0
- package/bin/skills/phoenix/references/advanced-usage.md +619 -0
- package/bin/skills/phoenix/references/troubleshooting.md +538 -0
- package/bin/skills/pinecone/SKILL.md +358 -0
- package/bin/skills/pinecone/references/deployment.md +181 -0
- package/bin/skills/pytorch-fsdp/SKILL.md +126 -0
- package/bin/skills/pytorch-fsdp/references/index.md +7 -0
- package/bin/skills/pytorch-fsdp/references/other.md +4249 -0
- package/bin/skills/pytorch-lightning/SKILL.md +346 -0
- package/bin/skills/pytorch-lightning/references/callbacks.md +436 -0
- package/bin/skills/pytorch-lightning/references/distributed.md +490 -0
- package/bin/skills/pytorch-lightning/references/hyperparameter-tuning.md +556 -0
- package/bin/skills/pyvene/SKILL.md +473 -0
- package/bin/skills/pyvene/references/README.md +73 -0
- package/bin/skills/pyvene/references/api.md +383 -0
- package/bin/skills/pyvene/references/tutorials.md +376 -0
- package/bin/skills/qdrant/SKILL.md +493 -0
- package/bin/skills/qdrant/references/advanced-usage.md +648 -0
- package/bin/skills/qdrant/references/troubleshooting.md +631 -0
- package/bin/skills/ray-data/SKILL.md +326 -0
- package/bin/skills/ray-data/references/integration.md +82 -0
- package/bin/skills/ray-data/references/transformations.md +83 -0
- package/bin/skills/ray-train/SKILL.md +406 -0
- package/bin/skills/ray-train/references/multi-node.md +628 -0
- package/bin/skills/rwkv/SKILL.md +260 -0
- package/bin/skills/rwkv/references/architecture-details.md +344 -0
- package/bin/skills/rwkv/references/rwkv7.md +386 -0
- package/bin/skills/rwkv/references/state-management.md +369 -0
- package/bin/skills/saelens/SKILL.md +386 -0
- package/bin/skills/saelens/references/README.md +70 -0
- package/bin/skills/saelens/references/api.md +333 -0
- package/bin/skills/saelens/references/tutorials.md +318 -0
- package/bin/skills/segment-anything/SKILL.md +500 -0
- package/bin/skills/segment-anything/references/advanced-usage.md +589 -0
- package/bin/skills/segment-anything/references/troubleshooting.md +484 -0
- package/bin/skills/sentence-transformers/SKILL.md +255 -0
- package/bin/skills/sentence-transformers/references/models.md +123 -0
- package/bin/skills/sentencepiece/SKILL.md +235 -0
- package/bin/skills/sentencepiece/references/algorithms.md +200 -0
- package/bin/skills/sentencepiece/references/training.md +304 -0
- package/bin/skills/sglang/SKILL.md +442 -0
- package/bin/skills/sglang/references/deployment.md +490 -0
- package/bin/skills/sglang/references/radix-attention.md +413 -0
- package/bin/skills/sglang/references/structured-generation.md +541 -0
- package/bin/skills/simpo/SKILL.md +219 -0
- package/bin/skills/simpo/references/datasets.md +478 -0
- package/bin/skills/simpo/references/hyperparameters.md +452 -0
- package/bin/skills/simpo/references/loss-functions.md +350 -0
- package/bin/skills/skypilot/SKILL.md +509 -0
- package/bin/skills/skypilot/references/advanced-usage.md +491 -0
- package/bin/skills/skypilot/references/troubleshooting.md +570 -0
- package/bin/skills/slime/SKILL.md +464 -0
- package/bin/skills/slime/references/api-reference.md +392 -0
- package/bin/skills/slime/references/troubleshooting.md +386 -0
- package/bin/skills/speculative-decoding/SKILL.md +467 -0
- package/bin/skills/speculative-decoding/references/lookahead.md +309 -0
- package/bin/skills/speculative-decoding/references/medusa.md +350 -0
- package/bin/skills/stable-diffusion/SKILL.md +519 -0
- package/bin/skills/stable-diffusion/references/advanced-usage.md +716 -0
- package/bin/skills/stable-diffusion/references/troubleshooting.md +555 -0
- package/bin/skills/tensorboard/SKILL.md +629 -0
- package/bin/skills/tensorboard/references/integrations.md +638 -0
- package/bin/skills/tensorboard/references/profiling.md +545 -0
- package/bin/skills/tensorboard/references/visualization.md +620 -0
- package/bin/skills/tensorrt-llm/SKILL.md +187 -0
- package/bin/skills/tensorrt-llm/references/multi-gpu.md +298 -0
- package/bin/skills/tensorrt-llm/references/optimization.md +242 -0
- package/bin/skills/tensorrt-llm/references/serving.md +470 -0
- package/bin/skills/tinker/SKILL.md +362 -0
- package/bin/skills/tinker/references/api-reference.md +168 -0
- package/bin/skills/tinker/references/getting-started.md +157 -0
- package/bin/skills/tinker/references/loss-functions.md +163 -0
- package/bin/skills/tinker/references/models-and-lora.md +139 -0
- package/bin/skills/tinker/references/recipes.md +280 -0
- package/bin/skills/tinker/references/reinforcement-learning.md +212 -0
- package/bin/skills/tinker/references/rendering.md +243 -0
- package/bin/skills/tinker/references/supervised-learning.md +232 -0
- package/bin/skills/tinker-training-cost/SKILL.md +187 -0
- package/bin/skills/tinker-training-cost/scripts/calculate_cost.py +123 -0
- package/bin/skills/torchforge/SKILL.md +433 -0
- package/bin/skills/torchforge/references/api-reference.md +327 -0
- package/bin/skills/torchforge/references/troubleshooting.md +409 -0
- package/bin/skills/torchtitan/SKILL.md +358 -0
- package/bin/skills/torchtitan/references/checkpoint.md +181 -0
- package/bin/skills/torchtitan/references/custom-models.md +258 -0
- package/bin/skills/torchtitan/references/float8.md +133 -0
- package/bin/skills/torchtitan/references/fsdp.md +126 -0
- package/bin/skills/transformer-lens/SKILL.md +346 -0
- package/bin/skills/transformer-lens/references/README.md +54 -0
- package/bin/skills/transformer-lens/references/api.md +362 -0
- package/bin/skills/transformer-lens/references/tutorials.md +339 -0
- package/bin/skills/trl-fine-tuning/SKILL.md +455 -0
- package/bin/skills/trl-fine-tuning/references/dpo-variants.md +227 -0
- package/bin/skills/trl-fine-tuning/references/online-rl.md +82 -0
- package/bin/skills/trl-fine-tuning/references/reward-modeling.md +122 -0
- package/bin/skills/trl-fine-tuning/references/sft-training.md +168 -0
- package/bin/skills/unsloth/SKILL.md +80 -0
- package/bin/skills/unsloth/references/index.md +7 -0
- package/bin/skills/unsloth/references/llms-full.md +16799 -0
- package/bin/skills/unsloth/references/llms-txt.md +12044 -0
- package/bin/skills/unsloth/references/llms.md +82 -0
- package/bin/skills/verl/SKILL.md +391 -0
- package/bin/skills/verl/references/api-reference.md +301 -0
- package/bin/skills/verl/references/troubleshooting.md +391 -0
- package/bin/skills/vllm/SKILL.md +364 -0
- package/bin/skills/vllm/references/optimization.md +226 -0
- package/bin/skills/vllm/references/quantization.md +284 -0
- package/bin/skills/vllm/references/server-deployment.md +255 -0
- package/bin/skills/vllm/references/troubleshooting.md +447 -0
- package/bin/skills/weights-and-biases/SKILL.md +590 -0
- package/bin/skills/weights-and-biases/references/artifacts.md +584 -0
- package/bin/skills/weights-and-biases/references/integrations.md +700 -0
- package/bin/skills/weights-and-biases/references/sweeps.md +847 -0
- package/bin/skills/whisper/SKILL.md +317 -0
- package/bin/skills/whisper/references/languages.md +189 -0
- package/bin/synsc +0 -0
- package/package.json +10 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
# LangChain Agents Guide
|
|
2
|
+
|
|
3
|
+
Complete guide to building agents with ReAct, tool calling, and streaming.
|
|
4
|
+
|
|
5
|
+
## What are agents?
|
|
6
|
+
|
|
7
|
+
Agents combine language models with tools to solve complex tasks through reasoning and action:
|
|
8
|
+
|
|
9
|
+
1. **Reasoning**: LLM decides what to do
|
|
10
|
+
2. **Acting**: Execute tools based on reasoning
|
|
11
|
+
3. **Observation**: Receive tool results
|
|
12
|
+
4. **Loop**: Repeat until task complete
|
|
13
|
+
|
|
14
|
+
This is the **ReAct pattern** (Reasoning + Acting).
|
|
15
|
+
|
|
16
|
+
## Basic agent creation
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from langchain.agents import create_agent
|
|
20
|
+
from langchain_anthropic import ChatAnthropic
|
|
21
|
+
|
|
22
|
+
# Define tools
|
|
23
|
+
def calculator(expression: str) -> str:
|
|
24
|
+
"""Evaluate a math expression."""
|
|
25
|
+
return str(eval(expression))
|
|
26
|
+
|
|
27
|
+
def search(query: str) -> str:
|
|
28
|
+
"""Search for information."""
|
|
29
|
+
return f"Results for: {query}"
|
|
30
|
+
|
|
31
|
+
# Create agent
|
|
32
|
+
agent = create_agent(
|
|
33
|
+
model=ChatAnthropic(model="claude-sonnet-4-5-20250929"),
|
|
34
|
+
tools=[calculator, search],
|
|
35
|
+
system_prompt="You are a helpful assistant. Use tools when needed."
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
# Run agent
|
|
39
|
+
result = agent.invoke({
|
|
40
|
+
"messages": [{"role": "user", "content": "What is 25 * 17?"}]
|
|
41
|
+
})
|
|
42
|
+
print(result["messages"][-1].content)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Agent components
|
|
46
|
+
|
|
47
|
+
### 1. Model - The reasoning engine
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from langchain_openai import ChatOpenAI
|
|
51
|
+
from langchain_anthropic import ChatAnthropic
|
|
52
|
+
|
|
53
|
+
# OpenAI
|
|
54
|
+
model = ChatOpenAI(model="gpt-4o", temperature=0)
|
|
55
|
+
|
|
56
|
+
# Anthropic (better for complex reasoning)
|
|
57
|
+
model = ChatAnthropic(model="claude-sonnet-4-5-20250929", temperature=0)
|
|
58
|
+
|
|
59
|
+
# Dynamic model selection
|
|
60
|
+
def select_model(task_complexity: str):
|
|
61
|
+
if task_complexity == "high":
|
|
62
|
+
return ChatAnthropic(model="claude-sonnet-4-5-20250929")
|
|
63
|
+
else:
|
|
64
|
+
return ChatOpenAI(model="gpt-4o-mini")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2. Tools - Actions the agent can take
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from langchain.tools import tool
|
|
71
|
+
|
|
72
|
+
# Simple function tool
|
|
73
|
+
@tool
|
|
74
|
+
def get_current_time() -> str:
|
|
75
|
+
"""Get the current time."""
|
|
76
|
+
from datetime import datetime
|
|
77
|
+
return datetime.now().strftime("%H:%M:%S")
|
|
78
|
+
|
|
79
|
+
# Tool with parameters
|
|
80
|
+
@tool
|
|
81
|
+
def fetch_weather(city: str, units: str = "fahrenheit") -> str:
|
|
82
|
+
"""Fetch weather for a city.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
city: City name
|
|
86
|
+
units: Temperature units (fahrenheit or celsius)
|
|
87
|
+
"""
|
|
88
|
+
# Your weather API call here
|
|
89
|
+
return f"Weather in {city}: 72°{units[0].upper()}"
|
|
90
|
+
|
|
91
|
+
# Tool with error handling
|
|
92
|
+
@tool
|
|
93
|
+
def risky_api_call(endpoint: str) -> str:
|
|
94
|
+
"""Call an external API that might fail."""
|
|
95
|
+
try:
|
|
96
|
+
response = requests.get(endpoint, timeout=5)
|
|
97
|
+
return response.text
|
|
98
|
+
except Exception as e:
|
|
99
|
+
return f"Error calling API: {str(e)}"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 3. System prompt - Agent behavior
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# General assistant
|
|
106
|
+
system_prompt = "You are a helpful assistant. Use tools when needed."
|
|
107
|
+
|
|
108
|
+
# Domain expert
|
|
109
|
+
system_prompt = """You are a financial analyst assistant.
|
|
110
|
+
- Use the calculator for precise calculations
|
|
111
|
+
- Search for recent financial data
|
|
112
|
+
- Provide data-driven recommendations
|
|
113
|
+
- Always cite your sources"""
|
|
114
|
+
|
|
115
|
+
# Constrained agent
|
|
116
|
+
system_prompt = """You are a customer support agent.
|
|
117
|
+
- Only use search_kb tool to find answers
|
|
118
|
+
- If answer not found, escalate to human
|
|
119
|
+
- Be concise and professional
|
|
120
|
+
- Never make up information"""
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Agent types
|
|
124
|
+
|
|
125
|
+
### 1. Tool-calling agent (recommended)
|
|
126
|
+
|
|
127
|
+
Uses native function calling for best performance:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from langchain.agents import create_tool_calling_agent, AgentExecutor
|
|
131
|
+
from langchain.prompts import ChatPromptTemplate
|
|
132
|
+
|
|
133
|
+
# Create prompt
|
|
134
|
+
prompt = ChatPromptTemplate.from_messages([
|
|
135
|
+
("system", "You are a helpful assistant"),
|
|
136
|
+
("human", "{input}"),
|
|
137
|
+
("placeholder", "{agent_scratchpad}"),
|
|
138
|
+
])
|
|
139
|
+
|
|
140
|
+
# Create agent
|
|
141
|
+
agent = create_tool_calling_agent(
|
|
142
|
+
llm=model,
|
|
143
|
+
tools=[calculator, search],
|
|
144
|
+
prompt=prompt
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
# Wrap in executor
|
|
148
|
+
agent_executor = AgentExecutor(
|
|
149
|
+
agent=agent,
|
|
150
|
+
tools=[calculator, search],
|
|
151
|
+
verbose=True,
|
|
152
|
+
max_iterations=5,
|
|
153
|
+
handle_parsing_errors=True
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
# Run
|
|
157
|
+
result = agent_executor.invoke({"input": "What is the weather in Paris?"})
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 2. ReAct agent (reasoning trace)
|
|
161
|
+
|
|
162
|
+
Shows step-by-step reasoning:
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
from langchain.agents import create_react_agent
|
|
166
|
+
|
|
167
|
+
# ReAct prompt shows thought process
|
|
168
|
+
react_prompt = """Answer the following questions as best you can. You have access to the following tools:
|
|
169
|
+
|
|
170
|
+
{tools}
|
|
171
|
+
|
|
172
|
+
Use the following format:
|
|
173
|
+
|
|
174
|
+
Question: the input question you must answer
|
|
175
|
+
Thought: you should always think about what to do
|
|
176
|
+
Action: the action to take, should be one of [{tool_names}]
|
|
177
|
+
Action Input: the input to the action
|
|
178
|
+
Observation: the result of the action
|
|
179
|
+
... (this Thought/Action/Action Input/Observation can repeat N times)
|
|
180
|
+
Thought: I now know the final answer
|
|
181
|
+
Final Answer: the final answer to the original input question
|
|
182
|
+
|
|
183
|
+
Begin!
|
|
184
|
+
|
|
185
|
+
Question: {input}
|
|
186
|
+
Thought: {agent_scratchpad}"""
|
|
187
|
+
|
|
188
|
+
agent = create_react_agent(
|
|
189
|
+
llm=model,
|
|
190
|
+
tools=[calculator, search],
|
|
191
|
+
prompt=ChatPromptTemplate.from_template(react_prompt)
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
# Run with visible reasoning
|
|
195
|
+
result = agent_executor.invoke({"input": "What is 25 * 17 + 142?"})
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 3. Conversational agent (with memory)
|
|
199
|
+
|
|
200
|
+
Remembers conversation history:
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
from langchain.agents import create_conversational_retrieval_agent
|
|
204
|
+
from langchain.memory import ConversationBufferMemory
|
|
205
|
+
|
|
206
|
+
# Add memory
|
|
207
|
+
memory = ConversationBufferMemory(
|
|
208
|
+
memory_key="chat_history",
|
|
209
|
+
return_messages=True
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
# Conversational agent
|
|
213
|
+
agent_executor = AgentExecutor(
|
|
214
|
+
agent=agent,
|
|
215
|
+
tools=[calculator, search],
|
|
216
|
+
memory=memory,
|
|
217
|
+
verbose=True
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
# Multi-turn conversation
|
|
221
|
+
agent_executor.invoke({"input": "My name is Alice"})
|
|
222
|
+
agent_executor.invoke({"input": "What's my name?"}) # Remembers "Alice"
|
|
223
|
+
agent_executor.invoke({"input": "What is 25 * 17?"})
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Tool execution patterns
|
|
227
|
+
|
|
228
|
+
### Parallel tool execution
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
# Agent automatically parallelizes independent calls
|
|
232
|
+
agent = create_tool_calling_agent(llm=model, tools=[get_weather, search])
|
|
233
|
+
|
|
234
|
+
# This calls get_weather("Paris") and get_weather("London") in parallel
|
|
235
|
+
result = agent_executor.invoke({
|
|
236
|
+
"input": "Compare weather in Paris and London"
|
|
237
|
+
})
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Sequential tool chaining
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
# Agent chains tools automatically
|
|
244
|
+
@tool
|
|
245
|
+
def search_company(name: str) -> str:
|
|
246
|
+
"""Search for company information."""
|
|
247
|
+
return f"Company ID: 12345, Industry: Tech"
|
|
248
|
+
|
|
249
|
+
@tool
|
|
250
|
+
def get_stock_price(company_id: str) -> str:
|
|
251
|
+
"""Get stock price for a company."""
|
|
252
|
+
return f"${150.00}"
|
|
253
|
+
|
|
254
|
+
# Agent will: search_company → get_stock_price
|
|
255
|
+
result = agent_executor.invoke({
|
|
256
|
+
"input": "What is Apple's current stock price?"
|
|
257
|
+
})
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Conditional tool usage
|
|
261
|
+
|
|
262
|
+
```python
|
|
263
|
+
# Agent decides when to use tools
|
|
264
|
+
@tool
|
|
265
|
+
def expensive_tool(query: str) -> str:
|
|
266
|
+
"""Use only when necessary - costs $0.10 per call."""
|
|
267
|
+
return perform_expensive_operation(query)
|
|
268
|
+
|
|
269
|
+
# Agent uses tool only if needed
|
|
270
|
+
result = agent_executor.invoke({
|
|
271
|
+
"input": "What is 2+2?" # Won't use expensive_tool
|
|
272
|
+
})
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Streaming
|
|
276
|
+
|
|
277
|
+
### Stream agent steps
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
# Stream intermediate steps
|
|
281
|
+
for step in agent_executor.stream({"input": "Research quantum computing"}):
|
|
282
|
+
if "actions" in step:
|
|
283
|
+
action = step["actions"][0]
|
|
284
|
+
print(f"Tool: {action.tool}, Input: {action.tool_input}")
|
|
285
|
+
if "steps" in step:
|
|
286
|
+
print(f"Observation: {step['steps'][0].observation}")
|
|
287
|
+
if "output" in step:
|
|
288
|
+
print(f"Final: {step['output']}")
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Stream LLM tokens
|
|
292
|
+
|
|
293
|
+
```python
|
|
294
|
+
from langchain.callbacks import StreamingStdOutCallbackHandler
|
|
295
|
+
|
|
296
|
+
# Stream model responses
|
|
297
|
+
agent_executor = AgentExecutor(
|
|
298
|
+
agent=agent,
|
|
299
|
+
tools=[calculator],
|
|
300
|
+
callbacks=[StreamingStdOutCallbackHandler()],
|
|
301
|
+
verbose=True
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
result = agent_executor.invoke({"input": "Explain quantum computing"})
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Error handling
|
|
308
|
+
|
|
309
|
+
### Tool error handling
|
|
310
|
+
|
|
311
|
+
```python
|
|
312
|
+
@tool
|
|
313
|
+
def fallible_tool(query: str) -> str:
|
|
314
|
+
"""A tool that might fail."""
|
|
315
|
+
try:
|
|
316
|
+
result = risky_operation(query)
|
|
317
|
+
return f"Success: {result}"
|
|
318
|
+
except Exception as e:
|
|
319
|
+
return f"Error: {str(e)}. Please try a different approach."
|
|
320
|
+
|
|
321
|
+
# Agent adapts to errors
|
|
322
|
+
agent_executor = AgentExecutor(
|
|
323
|
+
agent=agent,
|
|
324
|
+
tools=[fallible_tool],
|
|
325
|
+
handle_parsing_errors=True, # Handle malformed tool calls
|
|
326
|
+
max_iterations=5
|
|
327
|
+
)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Timeout handling
|
|
331
|
+
|
|
332
|
+
```python
|
|
333
|
+
from langchain.callbacks import TimeoutCallback
|
|
334
|
+
|
|
335
|
+
# Set timeout
|
|
336
|
+
agent_executor = AgentExecutor(
|
|
337
|
+
agent=agent,
|
|
338
|
+
tools=[slow_tool],
|
|
339
|
+
callbacks=[TimeoutCallback(timeout=30)], # 30 second timeout
|
|
340
|
+
max_iterations=10
|
|
341
|
+
)
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Retry logic
|
|
345
|
+
|
|
346
|
+
```python
|
|
347
|
+
from langchain.callbacks import RetryCallback
|
|
348
|
+
|
|
349
|
+
# Retry on failure
|
|
350
|
+
agent_executor = AgentExecutor(
|
|
351
|
+
agent=agent,
|
|
352
|
+
tools=[unreliable_tool],
|
|
353
|
+
callbacks=[RetryCallback(max_retries=3)],
|
|
354
|
+
max_execution_time=60
|
|
355
|
+
)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Advanced patterns
|
|
359
|
+
|
|
360
|
+
### Dynamic tool selection
|
|
361
|
+
|
|
362
|
+
```python
|
|
363
|
+
# Select tools based on context
|
|
364
|
+
def get_tools_for_user(user_role: str):
|
|
365
|
+
if user_role == "admin":
|
|
366
|
+
return [search, calculator, database_query, delete_data]
|
|
367
|
+
elif user_role == "analyst":
|
|
368
|
+
return [search, calculator, database_query]
|
|
369
|
+
else:
|
|
370
|
+
return [search, calculator]
|
|
371
|
+
|
|
372
|
+
# Create agent with role-based tools
|
|
373
|
+
tools = get_tools_for_user(current_user.role)
|
|
374
|
+
agent = create_agent(model=model, tools=tools)
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Multi-step reasoning
|
|
378
|
+
|
|
379
|
+
```python
|
|
380
|
+
# Agent plans multiple steps
|
|
381
|
+
system_prompt = """Break down complex tasks into steps:
|
|
382
|
+
1. Analyze the question
|
|
383
|
+
2. Determine required information
|
|
384
|
+
3. Use tools to gather data
|
|
385
|
+
4. Synthesize findings
|
|
386
|
+
5. Provide final answer"""
|
|
387
|
+
|
|
388
|
+
agent = create_agent(
|
|
389
|
+
model=model,
|
|
390
|
+
tools=[search, calculator, database],
|
|
391
|
+
system_prompt=system_prompt
|
|
392
|
+
)
|
|
393
|
+
|
|
394
|
+
result = agent.invoke({
|
|
395
|
+
"input": "Compare revenue growth of top 3 tech companies over 5 years"
|
|
396
|
+
})
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Structured output from agents
|
|
400
|
+
|
|
401
|
+
```python
|
|
402
|
+
from langchain_core.pydantic_v1 import BaseModel, Field
|
|
403
|
+
|
|
404
|
+
class ResearchReport(BaseModel):
|
|
405
|
+
summary: str = Field(description="Executive summary")
|
|
406
|
+
findings: list[str] = Field(description="Key findings")
|
|
407
|
+
sources: list[str] = Field(description="Source URLs")
|
|
408
|
+
|
|
409
|
+
# Agent returns structured output
|
|
410
|
+
structured_agent = agent.with_structured_output(ResearchReport)
|
|
411
|
+
report = structured_agent.invoke({"input": "Research AI safety"})
|
|
412
|
+
print(report.summary, report.findings)
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Middleware & customization
|
|
416
|
+
|
|
417
|
+
### Custom agent middleware
|
|
418
|
+
|
|
419
|
+
```python
|
|
420
|
+
from langchain.agents import AgentExecutor
|
|
421
|
+
|
|
422
|
+
def logging_middleware(agent_executor):
|
|
423
|
+
"""Log all agent actions."""
|
|
424
|
+
original_invoke = agent_executor.invoke
|
|
425
|
+
|
|
426
|
+
def wrapped_invoke(*args, **kwargs):
|
|
427
|
+
print(f"Agent invoked with: {args[0]}")
|
|
428
|
+
result = original_invoke(*args, **kwargs)
|
|
429
|
+
print(f"Agent result: {result}")
|
|
430
|
+
return result
|
|
431
|
+
|
|
432
|
+
agent_executor.invoke = wrapped_invoke
|
|
433
|
+
return agent_executor
|
|
434
|
+
|
|
435
|
+
# Apply middleware
|
|
436
|
+
agent_executor = logging_middleware(agent_executor)
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Custom stopping conditions
|
|
440
|
+
|
|
441
|
+
```python
|
|
442
|
+
from langchain.agents import EarlyStoppingMethod
|
|
443
|
+
|
|
444
|
+
# Stop early if confident
|
|
445
|
+
agent_executor = AgentExecutor(
|
|
446
|
+
agent=agent,
|
|
447
|
+
tools=[search],
|
|
448
|
+
early_stopping_method=EarlyStoppingMethod.GENERATE, # or FORCE
|
|
449
|
+
max_iterations=10
|
|
450
|
+
)
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
## Best practices
|
|
454
|
+
|
|
455
|
+
1. **Use tool-calling agents** - Fastest and most reliable
|
|
456
|
+
2. **Keep tool descriptions clear** - Agent needs to understand when to use each tool
|
|
457
|
+
3. **Add error handling** - Tools will fail, handle gracefully
|
|
458
|
+
4. **Set max_iterations** - Prevent infinite loops (default: 15)
|
|
459
|
+
5. **Enable streaming** - Better UX for long tasks
|
|
460
|
+
6. **Use verbose=True during dev** - See agent reasoning
|
|
461
|
+
7. **Test tool combinations** - Ensure tools work together
|
|
462
|
+
8. **Monitor with LangSmith** - Essential for production
|
|
463
|
+
9. **Cache tool results** - Avoid redundant API calls
|
|
464
|
+
10. **Version system prompts** - Track changes in behavior
|
|
465
|
+
|
|
466
|
+
## Common pitfalls
|
|
467
|
+
|
|
468
|
+
1. **Vague tool descriptions** - Agent won't know when to use tool
|
|
469
|
+
2. **Too many tools** - Agent gets confused (limit to 5-10)
|
|
470
|
+
3. **Tools without error handling** - One failure crashes agent
|
|
471
|
+
4. **Circular tool dependencies** - Agent gets stuck in loops
|
|
472
|
+
5. **Missing max_iterations** - Agent runs forever
|
|
473
|
+
6. **Poor system prompts** - Agent doesn't follow instructions
|
|
474
|
+
|
|
475
|
+
## Debugging agents
|
|
476
|
+
|
|
477
|
+
```python
|
|
478
|
+
# Enable verbose logging
|
|
479
|
+
agent_executor = AgentExecutor(
|
|
480
|
+
agent=agent,
|
|
481
|
+
tools=[calculator],
|
|
482
|
+
verbose=True, # See all steps
|
|
483
|
+
return_intermediate_steps=True # Get full trace
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
result = agent_executor.invoke({"input": "Calculate 25 * 17"})
|
|
487
|
+
|
|
488
|
+
# Inspect intermediate steps
|
|
489
|
+
for step in result["intermediate_steps"]:
|
|
490
|
+
print(f"Action: {step[0].tool}")
|
|
491
|
+
print(f"Input: {step[0].tool_input}")
|
|
492
|
+
print(f"Output: {step[1]}")
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
## Resources
|
|
496
|
+
|
|
497
|
+
- **ReAct Paper**: https://arxiv.org/abs/2210.03629
|
|
498
|
+
- **LangChain Agents Docs**: https://docs.langchain.com/oss/python/langchain/agents
|
|
499
|
+
- **LangSmith Debugging**: https://smith.langchain.com
|