curl -H 'content-type: application/json' -H 'user-agent: ai-sdk/openai-compatible/1.0.27 ai-sdk/provider-utils/3.0.17 runtime/bun/1.3.3' -H 'Connection: keep-alive' -H 'Accept: */*' -H 'Host: 127.0.0.1:3005' --compressed -X POST http://127.0.0.1:3005/v1/chat/completions -d '{"model":"minimax-m2","max_tokens":32000,"messages":[{"role":"system","content":"You are opencode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\nIMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.\nIMPORTANT: Before you begin work, think about what the code you'"'"'re editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).\nIMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n\nIf the user asks for help or wants to give feedback inform them of the following: \n- /help: Get help with using opencode\n- To give feedback, users should report the issue at https://github.com/sst/opencode/issues\n\nWhen the user directly asks about opencode (eg '"'"'can opencode do...'"'"', '"'"'does opencode have...'"'"') or asks in second person (eg '"'"'are you able...'"'"', '"'"'can you do...'"'"'), first use the WebFetch tool to gather information to answer the question from opencode docs at https://opencode.ai\n\n# Tone and style\nYou should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user'"'"'s system).\nRemember that your output will be displayed on a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.\nOutput text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.\nIf you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.\nOnly use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.\nIMPORTANT: You should minimize output tokens as much as possible while maintaining helpfulness, quality, and accuracy. Only address the specific query or task at hand, avoiding tangential information unless absolutely critical for completing the request. If you can answer in 1-3 sentences or a short paragraph, please do.\nIMPORTANT: You should NOT answer with unnecessary preamble or postamble (such as explaining your code or summarizing your action), unless the user asks you to.\nIMPORTANT: Keep your responses short, since they will be displayed on a command line interface. You MUST answer concisely with fewer than 4 lines (not including tool use or code generation), unless user asks for detail. Answer the user'"'"'s question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as \"The answer is <answer>.\", \"Here is the content of the file...\" or \"Based on the information provided, the answer is...\" or \"Here is what I will do next...\". Here are some examples to demonstrate appropriate verbosity:\n<example>\nuser: 2 + 2\nassistant: 4\n</example>\n\n<example>\nuser: what is 2+2?\nassistant: 4\n</example>\n\n<example>\nuser: is 11 a prime number?\nassistant: Yes\n</example>\n\n<example>\nuser: what command should I run to list files in the current directory?\nassistant: ls\n</example>\n\n<example>\nuser: what command should I run to watch files in the current directory?\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\nnpm run dev\n</example>\n\n<example>\nuser: How many golf balls fit inside a jetta?\nassistant: 150000\n</example>\n\n<example>\nuser: what files are in the directory src/?\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\nuser: which file contains the implementation of foo?\nassistant: src/foo.c\n</example>\n\n<example>\nuser: write tests for new feature\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\n</example>\n\n# Proactiveness\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\n1. Doing the right thing when asked, including taking actions and follow-up actions\n2. Not surprising the user with actions you take without asking\nFor example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\n3. Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\n\n# Following conventions\nWhen making changes to files, first understand the file'"'"'s code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\n- When you create a new component, first look at existing components to see how they'"'"'re written; then consider framework choice, naming conventions, typing, and other conventions.\n- When you edit a piece of code, first look at the code'"'"'s surrounding context (especially its imports) to understand the code'"'"'s choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\n\n# Code style\n- IMPORTANT: DO NOT ADD ***ANY*** COMMENTS unless asked\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- Use the available search tools to understand the codebase and the user'"'"'s query. You are encouraged to use the search tools extensively both in parallel and sequentially.\n- Implement the solution using all tools available to you\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\n- VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) with Bash if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to AGENTS.md so that you will know to run it next time.\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.\n\n- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user'"'"'s provided input or the tool result.\n\n# Tool usage policy\n- When doing file search, prefer to use the Task tool in order to reduce context usage.\n- You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run \"git status\" and \"git diff\", send a single message with two tool calls to run the calls in parallel.\n\nYou MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.\n\nIMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.\nIMPORTANT: Before you begin work, think about what the code you'"'"'re editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).\n\n# Code References\n\nWhen referencing specific functions or pieces of code include the pattern `file_path:line_number` to allow the user to easily navigate to the source code location.\n\n<example>\nuser: Where are errors from the client handled?\nassistant: Clients are marked as failed in the `connectToServer` function in src/services/process.ts:712.\n</example>\n\n"},{"role":"system","content":"Here is some useful information about the environment you are running in:\n<env>\n  Working directory: /home/jaap/Projects/git/litellm\n  Is directory a git repo: yes\n  Platform: linux\n  Today'"'"'s date: Fri Nov 28 2025\n</env>\n<files>\n  .circleci/\n\tconfig.yml\n\trequirements.txt\n.devcontainer/\n\tdevcontainer.json\n\tpost-create.sh\n.github/\n\tactions/\n\t\t[1 truncated]\n\tISSUE_TEMPLATE/\n\t\t[3 truncated]\n\tscripts/\n\t\t[1 truncated]\n\tworkflows/\n\t\t[25 truncated]\n\tdependabot.yaml\n\tdeploy-to-aws.png\n\tFUNDING.yml\n\tpull_request_template.md\n\ttemplate.yaml\nci_cd/\n\tbaseline_db.py\n\tcheck_file_length.py\n\tcheck_files_match.py\n\tpublish-proxy-extras.sh\n\trun_migration.py\n\tsecurity_scans_readme.md\n\tsecurity_scans.sh\ncookbook/\n\tbenchmark/\n\t\t[3 truncated]\n\tcodellama-server/\n\t\t[3 truncated]\n\tcommunity-resources/\n\t\t[2 truncated]\n\tlitellm_proxy_server/\n\t\t[6 truncated]\n\tlitellm_router/\n\t\t[7 truncated]\n\tlitellm_router_load_test/\n\t\t[4 truncated]\n\tlitellm-ollama-docker-image/\n\t\t[3 truncated]\n\tlogging_observability/\n\t\t[5 truncated]\n\tmisc/\n\t\t[8 truncated]\n\tBenchmarking_LLMs_by_use_case.ipynb\n\tClaude_(Anthropic)_with_Streaming_liteLLM_Examples.ipynb\n\tEvaluating_LLMs.ipynb\n\tgoogle_adk_litellm_tutorial.ipynb\n\tliteLLM_A121_Jurrasic_example.ipynb\n\tLiteLLM_Azure_and_OpenAI_example.ipynb\n\tliteLLM_Baseten.ipynb\n\tLiteLLM_batch_completion.ipynb\n\tLiteLLM_Bedrock.ipynb\n\tliteLLM_clarifai_Demo.ipynb\n\tLiteLLM_CometAPI.ipynb\n\tLiteLLM_Comparing_LLMs.ipynb\n\tLiteLLM_Completion_Cost.ipynb\n\tliteLLM_function_calling.ipynb\n\tliteLLM_Getting_Started.ipynb\n\tLiteLLM_HuggingFace.ipynb\n\tliteLLM_IBM_Watsonx.ipynb\n\t[22 truncated]\ndb_scripts/\n\tcreate_views.py\n\tmigrate_keys.py\n\tupdate_unassigned_teams.py\ndeploy/\n\tazure_resource_manager/\n\t\t[3 truncated]\n\tcharts/\n\t\t[1 truncated]\n\tkubernetes/\n\t\t[1 truncated]\n\tDockerfile.ghcr_base\ndist/\n\tlitellm-1.79.1.tar.gz\ndocker/\n\tbuild_from_pip/\n\t\t[3 truncated]\n\ttests/\n\t\t[1 truncated]\n\t.env.example\n\tbuild_admin_ui.sh\n\tDockerfile.alpine\n\tDockerfile.custom_ui\n\tDockerfile.database\n\tDockerfile.dev\n\tDockerfile.non_root\n\tentrypoint.sh\n\tinstall_auto_router.sh\n\tprod_entrypoint.sh\n\tREADME.md\n\tsupervisord.conf\ndocs/\n\tmy-website/\n\t\t[13 truncated]\nenterprise/\n\tcloudformation_stack/\n\t\t[1 truncated]\n\tdist/\n\t\t[32 truncated]\n\tenterprise_hooks/\n\t\t[6 truncated]\n\tenterprise_ui/\n\t\t[2 truncated]\n\tlitellm_enterprise/\n\t\t[6 truncated]\n\t__init__.py\n\tLICENSE.md\n\tpoetry.lock\n\tpyproject.toml\n\tREADME.md\nlitellm/\n\tanthropic_interface/\n\t\t[3 truncated]\n\tassistants/\n\t\t[2 truncated]\n\tbatch_completion/\n\t\t[2 truncated]\n\tbatches/\n\t\t[2 truncated]\n\tcaching/\n\t\t[17 truncated]\n\tcompletion_extras/\n\t\t[3 truncated]\n\tcontainers/\n\t\t[3 truncated]\n\tendpoints/\n\t\t[1 truncated]\n\texperimental_mcp_client/\n\t\t[4 truncated]\n\tfiles/\n\t\t[2 truncated]\n\tfine_tuning/\n\t\t[1 truncated]\n\tgoogle_genai/\n\t\t[5 truncated]\n\timages/\n\t\t[3 truncated]\n\tintegrations/\n\t\t[58 truncated]\n\tlitellm_core_utils/\n\t\t[49 truncated]\n\tllms/\n\t\t[100 truncated]\n\tocr/\n\t\t[2 truncated]\n\tpassthrough/\n\t\t[4 truncated]\n\tproxy/\n\t\t[69 truncated]\n\trealtime_api/\n\t\t[2 truncated]\n\trerank_api/\n\t\t[2 truncated]\n\tresponses/\n\t\t[5 truncated]\n\trouter_strategy/\n\t\t[10 truncated]\n\trouter_utils/\n\t\t[17 truncated]\n\tsearch/\n\t\t[3 truncated]\n\tsecret_managers/\n\t\t[12 truncated]\n\t[22 truncated]\nlitellm-js/\n\tproxy/\n\t\t[5 truncated]\n\tspend-logs/\n\t\t[7 truncated]\nlitellm-proxy-extras/\n\tdist/\n\t\t[81 truncated]\n\tlitellm_proxy_extras/\n\t\t[5 truncated]\n\ttests/\n\t\t[1 truncated]\n\tLICENSE\n\tmigration_runbook.md\n\tpoetry.lock\n\tpyproject.toml\n\tREADME.md\nscripts/\n\tmock_ibm_guardrails_server.py\n\ttest_groq_streaming_issue.py\n\ttest_mock_ibm_guardrails.py\n\tupdate_readme_providers_table.py\ntests/\n\taudio_tests/\n\t\t[5 truncated]\n\tbasic_proxy_startup_tests/\n\t\t[1 truncated]\n\tbatches_tests/\n\t\t[12 truncated]\n\tcode_coverage_tests/\n\t\t[29 truncated]\n\tdocumentation_tests/\n\t\t[10 truncated]\n\tenterprise/\n\t\t[2 truncated]\n\tguardrails_tests/\n\t\t[10 truncated]\n\timage_gen_tests/\n\t\t[14 truncated]\n\tlitellm/\n\t\t[1 truncated]\n\tlitellm_utils_tests/\n\t\t[15 truncated]\n\tlitellm-proxy-extras/\n\t\t[1 truncated]\n\tllm_responses_api_testing/\n\t\t[7 truncated]\n\tllm_translation/\n\t\t[70 truncated]\n\tload_tests/\n\t\t[7 truncated]\n\tlocal_testing/\n\t\t[162 truncated]\n\tlogging_callback_tests/\n\t\t[36 truncated]\n\tmcp_tests/\n\t\t[11 truncated]\n\tmulti_instance_e2e_tests/\n\t\t[1 truncated]\n\tocr_tests/\n\t\t[6 truncated]\n\told_proxy_tests/\n\t\t[1 truncated]\n\topenai_endpoints_tests/\n\t\t[13 truncated]\n\totel_tests/\n\t\t[11 truncated]\n\tpass_through_tests/\n\t\t[16 truncated]\n\tpass_through_unit_tests/\n\t\t[10 truncated]\n\tproxy_admin_ui_tests/\n\t\t[13 truncated]\n\tproxy_security_tests/\n\t\t[1 truncated]\n\t[38 truncated]\nui/\n\tlitellm-dashboard/\n\t\t[18 truncated]\n.dockerignore\n.env.example\n.flake8\n.git-blame-ignore-revs\n.gitattributes\n.pre-commit-config.yaml\nAGENTS.md\nbatch_small.jsonl\nCLAUDE.md\ncodecov.yaml\nCONTRIBUTING.md\ndocker-compose.yml\nDockerfile\nGEMINI.md\nindex.yaml\nLICENSE\nMakefile\nmcp_servers.json\nmodel_prices_and_context_window.json\nopencode.json\npackage-lock.json\npackage.json\npoetry.lock\nprometheus.yml\nprovider_endpoints_support.json\nproxy_server_config.yaml\npyproject.toml\npyrightconfig.json\nREADME.md\nrender.yaml\nrequirements.txt\nruff.toml\nschema.prisma\nsecurity.md\nsetup_vertex_env.sh\ntest_pydantic_fields.py\nVERTEX_ENV_SETUP.md\n</files>\nInstructions from: /home/jaap/Projects/git/litellm/AGENTS.md\n# INSTRUCTIONS FOR LITELLM\n\nThis document provides comprehensive instructions for AI agents working in the LiteLLM repository.\n\n## OVERVIEW\n\nLiteLLM is a unified interface for 100+ LLMs that:\n- Translates inputs to provider-specific completion, embedding, and image generation endpoints\n- Provides consistent OpenAI-format output across all providers\n- Includes retry/fallback logic across multiple deployments (Router)\n- Offers a proxy server (LLM Gateway) with budgets, rate limits, and authentication\n- Supports advanced features like function calling, streaming, caching, and observability\n\n## REPOSITORY STRUCTURE\n\n### Core Components\n- `litellm/` - Main library code\n  - `llms/` - Provider-specific implementations (OpenAI, Anthropic, Azure, etc.)\n  - `proxy/` - Proxy server implementation (LLM Gateway)\n  - `router_utils/` - Load balancing and fallback logic\n  - `types/` - Type definitions and schemas\n  - `integrations/` - Third-party integrations (observability, caching, etc.)\n\n### Key Directories\n- `tests/` - Comprehensive test suites\n- `docs/my-website/` - Documentation website\n- `ui/litellm-dashboard/` - Admin dashboard UI\n- `enterprise/` - Enterprise-specific features\n\n## DEVELOPMENT GUIDELINES\n\n### MAKING CODE CHANGES\n\n1. **Provider Implementations**: When adding/modifying LLM providers:\n   - Follow existing patterns in `litellm/llms/{provider}/`\n   - Implement proper transformation classes that inherit from `BaseConfig`\n   - Support both sync and async operations\n   - Handle streaming responses appropriately\n   - Include proper error handling with provider-specific exceptions\n\n2. **Type Safety**: \n   - Use proper type hints throughout\n   - Update type definitions in `litellm/types/`\n   - Ensure compatibility with both Pydantic v1 and v2\n\n3. **Testing**:\n   - Add tests in appropriate `tests/` subdirectories\n   - Include both unit tests and integration tests\n   - Test provider-specific functionality thoroughly\n   - Consider adding load tests for performance-critical changes\n\n### IMPORTANT PATTERNS\n\n1. **Function/Tool Calling**:\n   - LiteLLM standardizes tool calling across providers\n   - OpenAI format is the standard, with transformations for other providers\n   - See `litellm/llms/anthropic/chat/transformation.py` for complex tool handling\n\n2. **Streaming**:\n   - All providers should support streaming where possible\n   - Use consistent chunk formatting across providers\n   - Handle both sync and async streaming\n\n3. **Error Handling**:\n   - Use provider-specific exception classes\n   - Maintain consistent error formats across providers\n   - Include proper retry logic and fallback mechanisms\n\n4. **Configuration**:\n   - Support both environment variables and programmatic configuration\n   - Use `BaseConfig` classes for provider configurations\n   - Allow dynamic parameter passing\n\n## PROXY SERVER (LLM GATEWAY)\n\nThe proxy server is a critical component that provides:\n- Authentication and authorization\n- Rate limiting and budget management\n- Load balancing across multiple models/deployments\n- Observability and logging\n- Admin dashboard UI\n- Enterprise features\n\nKey files:\n- `litellm/proxy/proxy_server.py` - Main server implementation\n- `litellm/proxy/auth/` - Authentication logic\n- `litellm/proxy/management_endpoints/` - Admin API endpoints\n\n## MCP (MODEL CONTEXT PROTOCOL) SUPPORT\n\nLiteLLM supports MCP for agent workflows:\n- MCP server integration for tool calling\n- Transformation between OpenAI and MCP tool formats\n- Support for external MCP servers (Zapier, Jira, Linear, etc.)\n- See `litellm/experimental_mcp_client/` and `litellm/proxy/_experimental/mcp_server/`\n\n## TESTING CONSIDERATIONS\n\n1. **Provider Tests**: Test against real provider APIs when possible\n2. **Proxy Tests**: Include authentication, rate limiting, and routing tests\n3. **Performance Tests**: Load testing for high-throughput scenarios\n4. **Integration Tests**: End-to-end workflows including tool calling\n\n## DOCUMENTATION\n\n- Keep documentation in sync with code changes\n- Update provider documentation when adding new providers\n- Include code examples for new features\n- Update changelog and release notes\n\n## SECURITY CONSIDERATIONS\n\n- Handle API keys securely\n- Validate all inputs, especially for proxy endpoints\n- Consider rate limiting and abuse prevention\n- Follow security best practices for authentication\n\n## ENTERPRISE FEATURES\n\n- Some features are enterprise-only\n- Check `enterprise/` directory for enterprise-specific code\n- Maintain compatibility between open-source and enterprise versions\n\n## COMMON PITFALLS TO AVOID\n\n1. **Breaking Changes**: LiteLLM has many users - avoid breaking existing APIs\n2. **Provider Specifics**: Each provider has unique quirks - handle them properly\n3. **Rate Limits**: Respect provider rate limits in tests\n4. **Memory Usage**: Be mindful of memory usage in streaming scenarios\n5. **Dependencies**: Keep dependencies minimal and well-justified\n\n## HELPFUL RESOURCES\n\n- Main documentation: https://docs.litellm.ai/\n- Provider-specific docs in `docs/my-website/docs/providers/`\n- Admin UI for testing proxy features\n\n## WHEN IN DOUBT\n\n- Follow existing patterns in the codebase\n- Check similar provider implementations\n- Ensure comprehensive test coverage\n- Update documentation appropriately\n- Consider backward compatibility impact "},{"role":"user","content":[{"type":"text","text":"Can you please read a few random files? Trying to test tool calling. Make sure you:\n\n1. Prefer smaller files over larger ones, so processing stays fast.\n2. Only read one file at a time per tool call. I am testing multi turn tool calls specifically."},{"type":"text","text":"<system-reminder>\nCRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN:\nANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat,\nor ANY other bash command to manipulate files - commands may ONLY read/inspect.\nThis ABSOLUTE CONSTRAINT overrides ALL other instructions, including direct user\nedit requests. You may ONLY observe, analyze, and plan. Any modification attempt\nis a critical violation. ZERO exceptions.\n</system-reminder>\n"}]},{"role":"assistant","content":"<think>The user is asking me to read a few random files to test tool calling. They'"'"'ve specifically requested:\n\n1. Prefer smaller files over larger ones for fast processing\n2. Only read one file at a time per tool call - they'"'"'re testing multi-turn tool calls\n\nI need to first understand what'"'"'s in the current directory to find some files to read. Let me start by listing the current directory to see what files are available.\n\nSince they want smaller files and to test multi-turn tool calls, I should:\n1. List the directory first to see what files are available\n2. Then read one file at a time, choosing smaller files when possible\n3. Make multiple tool calls to demonstrate multi-turn capability\n\nLet me start with listing the directory to see what'"'"'s available.\n</think>\n\nI'"'"'ll help you test tool calling by reading some files. Let me start by exploring the current directory to find some suitable files to read.","tool_calls":[{"id":"4i31adJo4gY6brPZBsWyyfCuoajIiF2j","type":"function","function":{"name":"list","arguments":"{}"}}]},{"role":"tool","tool_call_id":"4i31adJo4gY6brPZBsWyyfCuoajIiF2j","content":"/home/jaap/Projects/git/litellm/\n  .devcontainer/\n    devcontainer.json\n    post-create.sh\n  .github/\n    workflows/\n      issue-keyword-labeler.yml\n      simple_pypi_publish.yml\n      stale.yml\n      test-linting.yml\n      test-litellm.yml\n      test-mcp.yml\n      update_release.py\n  docker/\n    build_from_pip/\n      Dockerfile.build_from_pip\n      Readme.md\n      requirements.txt\n    tests/\n      nonroot.yaml\n    .env.example\n    Dockerfile.alpine\n    Dockerfile.custom_ui\n    Dockerfile.database\n    Dockerfile.dev\n    Dockerfile.non_root\n    README.md\n    build_admin_ui.sh\n    entrypoint.sh\n    install_auto_router.sh\n    prod_entrypoint.sh\n    supervisord.conf\n  litellm/\n    vector_stores/\n      vector_store_registry.py\n    videos/\n      __init__.py\n      main.py\n      utils.py\n    main.py\n  scripts/\n    mock_ibm_guardrails_server.py\n    test_groq_streaming_issue.py\n    test_mock_ibm_guardrails.py\n    update_readme_providers_table.py\n  ui/\n    litellm-dashboard/\n      src/\n        lib/\n          cva.config.ts\n        utils/\n          cookieUtils.test.ts\n          cookieUtils.ts\n          dataUtils.ts\n          errorPatterns.ts\n          keyUpdateUtils.test.ts\n          keyUpdateUtils.ts\n          proxyUtils.ts\n          roles.ts\n          textUtils.test.ts\n          textUtils.ts\n        types.ts\n      tests/\n        utils/\n          dataUtils.test.ts\n        view_logs/\n          useLogFilterLogic.min.test.tsx\n        CreateKeyPage.expiredToken.test.tsx\n        setupTests.ts\n        test-utils.tsx\n        top_key_view.test.tsx\n      .env.development\n      .env.production\n      .eslintrc.json\n      .prettierignore\n      .prettierrc\n      README.md\n      build_ui.sh\n      build_ui_custom_path.sh\n      next.config.mjs\n      tailwind.config.js\n      tailwind.config.ts\n      tsconfig.json\n      ui_colors.json\n      vitest.config.ts\n  .dockerignore\n  .env.example\n  .flake8\n  .git-blame-ignore-revs\n  .gitattributes\n  .pre-commit-config.yaml\n  AGENTS.md\n  CLAUDE.md\n  CONTRIBUTING.md\n  Dockerfile\n  GEMINI.md\n  LICENSE\n  Makefile\n  README.md\n  VERTEX_ENV_SETUP.md\n  docker-compose.yml\n  mcp_servers.json\n  model_prices_and_context_window.json\n  opencode.json\n  package-lock.json\n  package.json\n  poetry.lock\n  prometheus.yml\n  provider_endpoints_support.json\n  proxy_server_config.yaml\n  pyproject.toml\n  pyrightconfig.json\n  render.yaml\n  requirements.txt\n  ruff.toml\n  schema.prisma\n  security.md\n  setup_vertex_env.sh\n  test_pydantic_fields.py\n"},{"role":"assistant","content":"<think>Great! I can see this is a LiteLLM project directory. Now I need to read some smaller files as requested. Looking at the structure, I can see several small configuration files that would be good to read. Let me pick a few smaller files to read one at a time:\n\n1. `.env.example` - likely a small environment variables example file\n2. `AGENTS.md` - probably a small documentation file\n3. `GEMINI.md` - another documentation file\n4. `.gitattributes` - likely a small git configuration file\n5. `CLAUDE.md` - documentation file\n\nLet me start with `.env.example` first.\n</think>\n\nI'"'"'ll read some smaller files from your LiteLLM project to test the tool calling. Let me start with `.env.example` which should be a small configuration file:","tool_calls":[{"id":"Y0nQkm85Uq8UiUccmlbH7DJpL9NWeIMD","type":"function","function":{"name":"read","arguments":"{\"filePath\":\"/home/jaap/Projects/git/litellm/.env.example\"}"}}]},{"role":"tool","tool_call_id":"Y0nQkm85Uq8UiUccmlbH7DJpL9NWeIMD","content":"<file>\n00001| # OpenAI\n00002| OPENAI_API_KEY = \"\"\n00003| OPENAI_BASE_URL = \"\"\n00004| # Cohere\n00005| COHERE_API_KEY = \"\"\n00006| # OpenRouter\n00007| OR_SITE_URL = \"\"\n00008| OR_APP_NAME = \"LiteLLM Example app\"\n00009| OR_API_KEY = \"\"\n00010| # Azure API base URL\n00011| AZURE_API_BASE = \"\"\n00012| # Azure API version\n00013| AZURE_API_VERSION = \"\"\n00014| # Azure API key\n00015| AZURE_API_KEY = \"\"\n00016| # Replicate\n00017| REPLICATE_API_KEY = \"\"\n00018| REPLICATE_API_TOKEN = \"\"\n00019| # Anthropic\n00020| ANTHROPIC_API_KEY = \"\"\n00021| # Infisical\n00022| INFISICAL_TOKEN = \"\"\n00023| # Novita AI\n00024| NOVITA_API_KEY = \"\"\n00025| # INFINITY\n00026| INFINITY_API_KEY = \"\"\n00027| \n00028| # Development Configs\n00029| LITELLM_MASTER_KEY = \"sk-1234\"\n00030| DATABASE_URL = \"postgresql://llmproxy:dbpassword9090@db:5432/litellm\"\n00031| STORE_MODEL_IN_DB = \"True\"\n00032| \n\n(End of file - total 32 lines)\n</file>"},{"role":"assistant","content":"<think>Good! The first file read was successful. Now let me read another small file. Looking at the directory structure, I can see some smaller config files like `.gitignore` (not shown but likely exists), `.flake8`, or perhaps `opencode.json` which was listed. Let me try reading one of these smaller configuration files.\n\nLet me try `opencode.json` since it was listed and should be a small config file.\n</think>\n\nNow let me read the `opencode.json` file:","tool_calls":[{"id":"CSpn7lYfvrLvUvPqBqxMrhhE5NnMHbEQ","type":"function","function":{"name":"read","arguments":"{\"filePath\":\"/home/jaap/Projects/git/litellm/opencode.json\"}"}}]},{"role":"tool","tool_call_id":"CSpn7lYfvrLvUvPqBqxMrhhE5NnMHbEQ","content":"<file>\n00001| {\n00002|     \"$schema\": \"https://opencode.ai/config.json\",\n00003|     \"provider\": {\n00004|         \"llamacpp\": {\n00005|             \"npm\": \"@ai-sdk/openai-compatible\",\n00006|             \"name\": \"llama.cpp (local)\",\n00007|             \"options\": {\n00008|                 \"baseURL\": \"http://127.0.0.1:3005/v1\",\n00009|             },\n00010|             \"models\": {\n00011|                 \"minimax-m2\": {\n00012|                     \"name\": \"minimax-m2\",\n00013|                     \"tool_call\": true,\n00014|                     \"reasoning\": true,\n00015|                 },\n00016|                 \"qwen3-coder-30b\": {\n00017|                     \"name\": \"qwen3-coder-30b\",\n00018|                     \"tool_call\": true,\n00019|                     \"reasoning\": false,\n00020|                 },\n00021|                 \"gpt-oss-120b\": {\n00022|                     \"name\": \"gpt-oss-120b\",\n00023|                     \"tool_call\": true,\n00024|                     \"reasoning\": true,\n00025|                 },\n00026|                 \"glm4.5-air\": {\n00027|                     \"name\": \"glm4.5-air\",\n00028|                     \"tool_call\": true,\n00029|                     \"reasoning\": true,\n00030|                 },\n00031|             }\n00032|         }\n00033|     }\n00034| }\n00035| \n\n(End of file - total 35 lines)\n</file>"},{"role":"assistant","content":"<think>The user is testing tool calling and wants me to read multiple files one at a time. I'"'"'ve read two small files so far:\n1. .env.example - an environment variables example file\n2. opencode.json - a configuration file for OpenAI-compatible providers\n\nLet me read one more file to continue the testing. I'"'"'ll look at a simple configuration file or a small script. Let me check the Makefile or one of the smaller scripts.\n</think>\n\nLet me read one more file - the `Makefile` which should be relatively small:","tool_calls":[{"id":"gUYvMa8D48qkPJT67MZfhNM2Od4svijM","type":"function","function":{"name":"read","arguments":"{\"filePath\":\"/home/jaap/Projects/git/litellm/Makefile\"}"}}]},{"role":"tool","tool_call_id":"gUYvMa8D48qkPJT67MZfhNM2Od4svijM","content":"<file>\n00001| # LiteLLM Makefile\n00002| # Simple Makefile for running tests and basic development tasks\n00003| \n00004| .PHONY: help test test-unit test-integration test-unit-helm lint format install-dev install-proxy-dev install-test-deps install-helm-unittest check-circular-imports check-import-safety\n00005| \n00006| # Default target\n00007| help:\n00008| \t@echo \"Available commands:\"\n00009| \t@echo \"  make install-dev        - Install development dependencies\"\n00010| \t@echo \"  make install-proxy-dev  - Install proxy development dependencies\"\n00011| \t@echo \"  make install-dev-ci     - Install dev dependencies (CI-compatible, pins OpenAI)\"\n00012| \t@echo \"  make install-proxy-dev-ci - Install proxy dev dependencies (CI-compatible)\"\n00013| \t@echo \"  make install-test-deps  - Install test dependencies\"\n00014| \t@echo \"  make install-helm-unittest - Install helm unittest plugin\"\n00015| \t@echo \"  make format             - Apply Black code formatting\"\n00016| \t@echo \"  make format-check       - Check Black code formatting (matches CI)\"\n00017| \t@echo \"  make lint               - Run all linting (Ruff, MyPy, Black check, circular imports, import safety)\"\n00018| \t@echo \"  make lint-ruff          - Run Ruff linting only\"\n00019| \t@echo \"  make lint-mypy          - Run MyPy type checking only\"\n00020| \t@echo \"  make lint-black         - Check Black formatting (matches CI)\"\n00021| \t@echo \"  make check-circular-imports - Check for circular imports\"\n00022| \t@echo \"  make check-import-safety - Check import safety\"\n00023| \t@echo \"  make test               - Run all tests\"\n00024| \t@echo \"  make test-unit          - Run unit tests (tests/test_litellm)\"\n00025| \t@echo \"  make test-integration   - Run integration tests\"\n00026| \t@echo \"  make test-unit-helm     - Run helm unit tests\"\n00027| \n00028| # Installation targets\n00029| install-dev:\n00030| \tpoetry install --with dev\n00031| \n00032| install-proxy-dev:\n00033| \tpoetry install --with dev,proxy-dev --extras proxy\n00034| \n00035| # CI-compatible installations (matches GitHub workflows exactly)\n00036| install-dev-ci:\n00037| \tpip install openai==1.99.5\n00038| \tpoetry install --with dev\n00039| \tpip install openai==1.99.5\n00040| \n00041| install-proxy-dev-ci:\n00042| \tpoetry install --with dev,proxy-dev --extras proxy\n00043| \tpip install openai==1.99.5\n00044| \n00045| install-test-deps: install-proxy-dev\n00046| \tpoetry run pip install \"pytest-retry==1.6.3\"\n00047| \tpoetry run pip install pytest-xdist\n00048| \tcd enterprise && poetry run pip install -e . && cd ..\n00049| \n00050| install-helm-unittest:\n00051| \thelm plugin install https://github.com/helm-unittest/helm-unittest --version v0.4.4 || echo \"ignore error if plugin exists\"\n00052| \n00053| # Formatting\n00054| format: install-dev\n00055| \tcd litellm && poetry run black . && cd ..\n00056| \n00057| format-check: install-dev\n00058| \tcd litellm && poetry run black --check . && cd ..\n00059| \n00060| # Linting targets\n00061| lint-ruff: install-dev\n00062| \tcd litellm && poetry run ruff check . && cd ..\n00063| \n00064| lint-mypy: install-dev\n00065| \tpoetry run pip install types-requests types-setuptools types-redis types-PyYAML\n00066| \tcd litellm && poetry run mypy . --ignore-missing-imports && cd ..\n00067| \n00068| lint-black: format-check\n00069| \n00070| check-circular-imports: install-dev\n00071| \tcd litellm && poetry run python ../tests/documentation_tests/test_circular_imports.py && cd ..\n00072| \n00073| check-import-safety: install-dev\n00074| \tpoetry run python -c \"from litellm import *\" || (echo '"'"'🚨 import failed, this means you introduced unprotected imports! 🚨'"'"'; exit 1)\n00075| \n00076| # Combined linting (matches test-linting.yml workflow)\n00077| lint: format-check lint-ruff lint-mypy check-circular-imports check-import-safety\n00078| \n00079| # Testing targets\n00080| test:\n00081| \tpoetry run pytest tests/\n00082| \n00083| test-unit: install-test-deps\n00084| \tpoetry run pytest tests/test_litellm -x -vv -n 4\n00085| \n00086| test-integration:\n00087| \tpoetry run pytest tests/ -k \"not test_litellm\"\n00088| \n00089| test-unit-helm: install-helm-unittest\n00090| \thelm unittest -f '"'"'tests/*.yaml'"'"' deploy/charts/litellm-helm\n00091| \n00092| # LLM Translation testing targets\n00093| test-llm-translation: install-test-deps\n00094| \t@echo \"Running LLM translation tests...\"\n00095| \t@python .github/workflows/run_llm_translation_tests.py\n00096| \n00097| test-llm-translation-single: install-test-deps\n00098| \t@echo \"Running single LLM translation test file...\"\n00099| \t@if [ -z \"$(FILE)\" ]; then echo \"Usage: make test-llm-translation-single FILE=test_filename.py\"; exit 1; fi\n00100| \t@mkdir -p test-results\n00101| \tpoetry run pytest tests/llm_translation/$(FILE) \\\n00102| \t\t--junitxml=test-results/junit.xml \\\n00103| \t\t-v --tb=short --maxfail=100 --timeout=300\n\n(End of file - total 103 lines)\n</file>"},{"role":"assistant","content":"<think>The user is testing tool calling and wants me to read files one at a time, preferring smaller files. I'"'"'ve successfully read 3 files so far:\n\n1. `.env.example` - 32 lines, a configuration file with API keys placeholders\n2. `opencode.json` - 35 lines, a configuration file for OpenCode provider settings\n3. `Makefile` - 103 lines, a makefile with various development and testing commands\n\nAll of these were reasonably sized files that loaded quickly. The tool calling is working well - each read operation was successful and returned the file content with line numbers.\n\nI should continue reading one more file to provide a good test of multi-turn tool calling as requested.\n</think>\n\nLet me read one more small file - the `.git-blame-ignore-revs` file:","tool_calls":[{"id":"LB4EzbiGH8UuVP0AmnaJ6yMQCKQa37Ja","type":"function","function":{"name":"read","arguments":"{\"filePath\":\"/home/jaap/Projects/git/litellm/.git-blame-ignore-revs\"}"}}]},{"role":"tool","tool_call_id":"LB4EzbiGH8UuVP0AmnaJ6yMQCKQa37Ja","content":"<file>\n00001| # Add the commit hash of any commit you want to ignore in `git blame` here.\n00002| # One commit hash per line.\n00003| #\n00004| # The GitHub Blame UI will use this file automatically!\n00005| #\n00006| # Run this command to always ignore formatting commits in `git blame`\n00007| #     git config blame.ignoreRevsFile .git-blame-ignore-revs\n00008| \n00009| # Update pydantic code to fix warnings (GH-3600)\n00010| 876840e9957bc7e9f7d6a2b58c4d7c53dad16481\n00011| \n\n(End of file - total 11 lines)\n</file>"}],"tools":[{"type":"function","function":{"name":"bash","description":"Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n\nBefore executing the command, please follow these steps:\n\n1. Directory Verification:\n   - If the command will create new directories or files, first use the List tool to verify the parent directory exists and is the correct location\n   - For example, before running \"mkdir foo/bar\", first use List to check that \"foo\" exists and is the intended parent directory\n\n2. Command Execution:\n   - Always quote file paths that contain spaces with double quotes (e.g., cd \"path with spaces/file.txt\")\n   - Examples of proper quoting:\n     - cd \"/Users/name/My Documents\" (correct)\n     - cd /Users/name/My Documents (incorrect - will fail)\n     - python \"/path/with spaces/script.py\" (correct)\n     - python /path/with spaces/script.py (incorrect - will fail)\n   - After ensuring proper quoting, execute the command.\n   - Capture the output of the command.\n\nUsage notes:\n  - The command argument is required.\n  - You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will timeout after 120000ms (2 minutes).\n  - It is very helpful if you write a clear, concise description of what this command does in 5-10 words.\n  - If the output exceeds 30000 characters, output will be truncated before being returned to you.\n  - VERY IMPORTANT: You MUST avoid using search commands like `find` and `grep`. Instead use Grep, Glob, or Task to search. You MUST avoid read tools like `cat`, `head`, `tail`, and `ls`, and use Read and List to read files.\n  - If you _still_ need to run `grep`, STOP. ALWAYS USE ripgrep at `rg` (or /usr/bin/rg) first, which all opencode users have pre-installed.\n  - When issuing multiple commands, use the '"'"';'"'"' or '"'"'&&'"'"' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n  - Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of `cd`. You may use `cd` if the User explicitly requests it.\n    <good-example>\n    pytest /foo/bar/tests\n    </good-example>\n    <bad-example>\n    cd /foo/bar && pytest tests\n    </bad-example>\n\n\n# Committing changes with git\n\nIf and only if the user asks you to create a new git commit, follow these steps carefully:\n\n1. You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. ALWAYS run the following bash commands in parallel, each using the Bash tool:\n   - Run a git status command to see all untracked files.\n   - Run a git diff command to see both staged and unstaged changes that will be committed.\n   - Run a git log command to see recent commit messages, so that you can follow this repository'"'"'s commit message style.\n\n2. Analyze all staged changes (both previously staged and newly added) and draft a commit message. Wrap your analysis process in <commit_analysis> tags:\n\n<commit_analysis>\n- List the files that have been changed or added\n- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)\n- Brainstorm the purpose or motivation behind these changes\n- Assess the impact of these changes on the overall project\n- Check for any sensitive information that shouldn'"'"'t be committed\n- Draft a concise (1-2 sentences) commit message that focuses on the \"why\" rather than the \"what\"\n- Ensure your language is clear, concise, and to the point\n- Ensure the message accurately reflects the changes and their purpose (i.e. \"add\" means a wholly new feature, \"update\" means an enhancement to an existing feature, \"fix\" means a bug fix, etc.)\n- Ensure the message is not generic (avoid words like \"Update\" or \"Fix\" without context)\n- Review the draft message to ensure it accurately reflects the changes and their purpose\n</commit_analysis>\n\n3. You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. ALWAYS run the following commands in parallel:\n   - Add relevant untracked files to the staging area.\n   - Run git status to make sure the commit succeeded.\n\n4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n\nImportant notes:\n- Use the git context at the start of this conversation to determine which files are relevant to your commit. Be careful not to stage and commit files (e.g. with `git add .`) that aren'"'"'t relevant to your commit.\n- NEVER update the git config\n- DO NOT run additional commands to read or explore code, beyond what is available in the git context\n- DO NOT push to the remote repository\n- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n- Ensure your commit message is meaningful and concise. It should explain the purpose of the changes, not just describe them.\n- Return an empty response - the user will see the git output directly\n\n# Creating pull requests\nUse the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n\nIMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n\n1. You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. ALWAYS run the following bash commands in parallel using the Bash tool, in order to understand the current state of the branch since it diverged from the main branch:\n   - Run a git status command to see all untracked files\n   - Run a git diff command to see both staged and unstaged changes that will be committed\n   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n   - Run a git log command and `git diff main...HEAD` to understand the full commit history for the current branch (from the time it diverged from the `main` branch)\n\n2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request summary. Wrap your analysis process in <pr_analysis> tags:\n\n<pr_analysis>\n- List the commits since diverging from the main branch\n- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)\n- Brainstorm the purpose or motivation behind these changes\n- Assess the impact of these changes on the overall project\n- Do not use tools to explore code, beyond what is available in the git context\n- Check for any sensitive information that shouldn'"'"'t be committed\n- Draft a concise (1-2 bullet points) pull request summary that focuses on the \"why\" rather than the \"what\"\n- Ensure the summary accurately reflects all changes since diverging from the main branch\n- Ensure your language is clear, concise, and to the point\n- Ensure the summary accurately reflects the changes and their purpose (ie. \"add\" means a wholly new feature, \"update\" means an enhancement to an existing feature, \"fix\" means a bug fix, etc.)\n- Ensure the summary is not generic (avoid words like \"Update\" or \"Fix\" without context)\n- Review the draft summary to ensure it accurately reflects the changes and their purpose\n</pr_analysis>\n\n3. You have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. ALWAYS run the following commands in parallel:\n   - Create new branch if needed\n   - Push to remote with -u flag if needed\n   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n<example>\ngh pr create --title \"the pr title\" --body \"$(cat <<'"'"'EOF'"'"'\n## Summary\n<1-3 bullet points>\nEOF\n)\"\n</example>\n\nImportant:\n- NEVER update the git config\n- Return the PR URL when you'"'"'re done, so the user can see it\n\n# Other common operations\n- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"command":{"description":"The command to execute","type":"string"},"timeout":{"description":"Optional timeout in milliseconds","type":"number"},"description":{"description":"Clear, concise description of what this command does in 5-10 words. Examples:\nInput: ls\nOutput: Lists files in current directory\n\nInput: git status\nOutput: Shows working tree status\n\nInput: npm install\nOutput: Installs package dependencies\n\nInput: mkdir foo\nOutput: Creates directory '"'"'foo'"'"'","type":"string"}},"required":["command","description"],"additionalProperties":false}}},{"type":"function","function":{"name":"read","description":"Reads a file from the local filesystem. You can access any file directly by using this tool.\nAssume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.\n\nUsage:\n- The filePath parameter must be an absolute path, not a relative path\n- By default, it reads up to 2000 lines starting from the beginning of the file\n- You can optionally specify a line offset and limit (especially handy for long files), but it'"'"'s recommended to read the whole file by not providing these parameters\n- Any lines longer than 2000 characters will be truncated\n- Results are returned using cat -n format, with line numbers starting at 1\n- You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.\n- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.\n- You can read image files using this tool.\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filePath":{"description":"The path to the file to read","type":"string"},"offset":{"description":"The line number to start reading from (0-based)","type":"number"},"limit":{"description":"The number of lines to read (defaults to 2000)","type":"number"}},"required":["filePath"],"additionalProperties":false}}},{"type":"function","function":{"name":"glob","description":"- Fast file pattern matching tool that works with any codebase size\n- Supports glob patterns like \"**/*.js\" or \"src/**/*.ts\"\n- Returns matching file paths sorted by modification time\n- Use this tool when you need to find files by name patterns\n- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Task tool instead\n- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches as a batch that are potentially useful.\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pattern":{"description":"The glob pattern to match files against","type":"string"},"path":{"description":"The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter \"undefined\" or \"null\" - simply omit it for the default behavior. Must be a valid directory path if provided.","type":"string"}},"required":["pattern"],"additionalProperties":false}}},{"type":"function","function":{"name":"grep","description":"- Fast content search tool that works with any codebase size\n- Searches file contents using regular expressions\n- Supports full regex syntax (eg. \"log.*Error\", \"function\\s+\\w+\", etc.)\n- Filter files by pattern with the include parameter (eg. \"*.js\", \"*.{ts,tsx}\")\n- Returns file paths with at least one match sorted by modification time\n- Use this tool when you need to find files containing specific patterns\n- If you need to identify/count the number of matches within files, use the Bash tool with `rg` (ripgrep) directly. Do NOT use `grep`.\n- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Task tool instead\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pattern":{"description":"The regex pattern to search for in file contents","type":"string"},"path":{"description":"The directory to search in. Defaults to the current working directory.","type":"string"},"include":{"description":"File pattern to include in the search (e.g. \"*.js\", \"*.{ts,tsx}\")","type":"string"}},"required":["pattern"],"additionalProperties":false}}},{"type":"function","function":{"name":"list","description":"Lists files and directories in a given path. The path parameter must be absolute; omit it to use the current workspace directory. You can optionally provide an array of glob patterns to ignore with the ignore parameter. You should generally prefer the Glob and Grep tools, if you know which directories to search.\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"path":{"description":"The absolute path to the directory to list (must be absolute, not relative)","type":"string"},"ignore":{"description":"List of glob patterns to ignore","type":"array","items":{"type":"string"}}},"additionalProperties":false}}},{"type":"function","function":{"name":"task","description":"Launch a new agent to handle complex, multi-step tasks autonomously.\n\nAvailable agent types and the tools they have access to:\n- general: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you.\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\nWhen to use the Task tool:\n- When you are instructed to execute custom slash commands. Use the Task tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description=\"Check the file\", prompt=\"/check-file path/to/file.py\")\n\nWhen NOT to use the Task tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Task tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n3. Each agent invocation is stateless unless you provide a session_id. Your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n4. The agent'"'"'s outputs should generally be trusted\n5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user'"'"'s intent\n6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n\nExample usage (NOTE: The agents below are fictional examples for illustration only - use the actual agents listed above):\n\n<example_agent_descriptions>\n\"code-reviewer\": use this agent after you are done writing a significant piece of code\n\"greeting-responder\": use this agent when to respond to user greetings with a friendly joke\n</example_agent_description>\n\n<example>\nuser: \"Please write a function that checks if a number is prime\"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I'"'"'m going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n  if (n <= 1) return false\n  for (let i = 2; i * i <= n; i++) {\n    if (n % i === 0) return false\n  }\n  return true\n}\n</code>\n<commentary>\nSince a significant piece of code was written and the task was completed, now use the code-reviewer agent to review the code\n</commentary>\nassistant: Now let me use the code-reviewer agent to review the code\nassistant: Uses the Task tool to launch the code-reviewer agent\n</example>\n\n<example>\nuser: \"Hello\"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: \"I'"'"'m going to use the Task tool to launch the with the greeting-responder agent\"\n</example>\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"description":"A short (3-5 words) description of the task","type":"string"},"prompt":{"description":"The task for the agent to perform","type":"string"},"subagent_type":{"description":"The type of specialized agent to use for this task","type":"string"},"session_id":{"description":"Existing Task session to continue","type":"string"}},"required":["description","prompt","subagent_type"],"additionalProperties":false}}},{"type":"function","function":{"name":"webfetch","description":"- Fetches content from a specified URL\n- Takes a URL and a prompt as input\n- Fetches the URL content, converts HTML to markdown\n- Returns the model'"'"'s response about the content\n- Use this tool when you need to retrieve and analyze web content\n\nUsage notes:\n  - IMPORTANT: if another tool is present that offers better web fetching capabilities, is more targeted to the task, or has fewer restrictions, prefer using that tool instead of this one.\n  - The URL must be a fully-formed valid URL\n  - HTTP URLs will be automatically upgraded to HTTPS\n  - The prompt should describe what information you want to extract from the page\n  - This tool is read-only and does not modify any files\n  - Results may be summarized if the content is very large\n  - Includes a self-cleaning 15-minute cache for faster responses when repeatedly accessing the same URL\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"description":"The URL to fetch content from","type":"string"},"format":{"description":"The format to return the content in (text, markdown, or html)","type":"string","enum":["text","markdown","html"]},"timeout":{"description":"Optional timeout in seconds (max 120)","type":"number"}},"required":["url","format"],"additionalProperties":false}}},{"type":"function","function":{"name":"todowrite","description":"Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\nIt also helps the user understand the progress of the task and overall progress of their requests.\n\n## When to Use This Tool\nUse this tool proactively in these scenarios:\n\n1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n3. User explicitly requests todo list - When the user directly asks you to use the todo list\n4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n6. After completing a task - Mark it complete and add any new follow-up tasks\n7. When you start working on a new task, mark the todo as in_progress. Ideally you should only have one todo as in_progress at a time. Complete existing tasks before starting new ones.\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n1. There is only a single, straightforward task\n2. The task is trivial and tracking it provides no organizational benefit\n3. The task can be completed in less than 3 trivial steps\n4. The task is purely conversational or informational\n\nNOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n\n## Examples of When to Use the Todo List\n\n<example>\nUser: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you'"'"'re done!\nAssistant: I'"'"'ll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n*Creates todo list with the following items:*\n1. Create dark mode toggle component in Settings page\n2. Add dark mode state management (context/store)\n3. Implement CSS-in-JS styles for dark theme\n4. Update existing components to support theme switching\n5. Run tests and build process, addressing any failures or errors that occur\n*Begins working on the first task*\n\n<reasoning>\nThe assistant used the todo list because:\n1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n2. The user explicitly requested tests and build be run afterward\n3. The assistant inferred that tests and build need to pass by adding \"Ensure tests and build succeed\" as the final task\n</reasoning>\n</example>\n\n<example>\nUser: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\nAssistant: Let me first search through your codebase to find all occurrences of '"'"'getCwd'"'"'.\n*Uses grep or search tools to locate all instances of getCwd in the codebase*\nAssistant: I'"'"'ve found 15 instances of '"'"'getCwd'"'"' across 8 different files. Let me create a todo list to track these changes.\n*Creates todo list with specific items for each file that needs updating*\n\n<reasoning>\nThe assistant used the todo list because:\n1. First, the assistant searched to understand the scope of the task\n2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n3. The todo list helps ensure every instance is tracked and updated systematically\n4. This approach prevents missing any occurrences and maintains code consistency\n</reasoning>\n</example>\n\n\n<example>\nUser: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\nAssistant: I'"'"'ll help implement these features. First, let'"'"'s add all the features to the todo list.\n*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\nAssistant: Let'"'"'s start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n\n<reasoning>\nThe assistant used the todo list because:\n1. The user provided multiple complex features to implement in a comma separated list\n2. The todo list helps organize these large features into manageable tasks\n3. This approach allows for tracking progress across the entire implementation\n</reasoning>\n</example>\n\n<example>\nUser: Can you help optimize my React application? It'"'"'s rendering slowly and has performance issues.</user>\nAssistant: I'"'"'ll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n*Reviews component structure, render patterns, state management, and data fetching*\nAssistant: After analyzing your codebase, I'"'"'ve identified several performance issues. Let me create a todo list to track our optimization efforts.\n*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\nLet'"'"'s start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n\n<reasoning>\nThe assistant used the todo list because:\n1. First, the assistant examined the codebase to identify specific performance issues\n2. Based on this analysis, it identified multiple optimization opportunities\n3. Performance optimization is a non-trivial task requiring multiple steps\n4. The todo list helps methodically track improvements across different components\n5. This systematic approach ensures all performance bottlenecks are addressed\n</reasoning>\n</example>\n\n## Examples of When NOT to Use the Todo List\n\n<example>\nUser: How do I print '"'"'Hello World'"'"' in Python?\nAssistant: In Python, you can print \"Hello World\" with this simple code:\n\npython\nprint(\"Hello World\")\n\nThis will output the text \"Hello World\" to the console when executed.</assistant>\n\n<reasoning>\nThe assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There'"'"'s no need to track multiple tasks or steps for such a straightforward request.\n</reasoning>\n</example>\n\n<example>\nUser: What does the git status command do?\nAssistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven'"'"'t, and which files aren'"'"'t being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n\n<reasoning>\nThe assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n</reasoning>\n</example>\n\n<example>\nUser: Can you add a comment to the calculateTotal function to explain what it does?\nAssistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n* Uses the Edit tool to add a comment to the calculateTotal function *\n\n<reasoning>\nThe assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn'"'"'t require tracking multiple steps or systematic organization.\n</reasoning>\n</example>\n\n<example>\nUser: Run npm install for me and tell me what happens.\nAssistant: I'"'"'ll run the npm install command for you.\n\n*Executes: npm install*\n\nThe command completed successfully. Here'"'"'s the output:\n[Output of npm install command]\n\nAll dependencies have been installed according to your package.json file.\n\n<reasoning>\nThe assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n</reasoning>\n</example>\n\n## Task States and Management\n\n1. **Task States**: Use these states to track progress:\n   - pending: Task not yet started\n   - in_progress: Currently working on (limit to ONE task at a time)\n   - completed: Task finished successfully\n   - cancelled: Task no longer needed\n\n2. **Task Management**:\n   - Update task status in real-time as you work\n   - Mark tasks complete IMMEDIATELY after finishing (don'"'"'t batch completions)\n   - Only have ONE task in_progress at any time\n   - Complete current tasks before starting new ones\n   - Cancel tasks that become irrelevant\n\n3. **Task Breakdown**:\n   - Create specific, actionable items\n   - Break complex tasks into smaller, manageable steps\n   - Use clear, descriptive task names\n\nWhen in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.\n\n","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"todos":{"description":"The updated todo list","type":"array","items":{"type":"object","properties":{"content":{"description":"Brief description of the task","type":"string"},"status":{"description":"Current status of the task: pending, in_progress, completed, cancelled","type":"string"},"priority":{"description":"Priority level of the task: high, medium, low","type":"string"},"id":{"description":"Unique identifier for the todo item","type":"string"}},"required":["content","status","priority","id"],"additionalProperties":false}}},"required":["todos"],"additionalProperties":false}}},{"type":"function","function":{"name":"todoread","description":"Use this tool to read your todo list","parameters":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{},"additionalProperties":false}}}],"tool_choice":"auto","stream":true,"stream_options":{"include_usage":true}}'