{"id":8812,"library":"agent-framework-claude","title":"Microsoft Agent Framework Integration for Claude","description":"The `agent-framework-claude` library provides an integration for using Anthropic's Claude models within Microsoft's Agent Framework. Currently in beta version `1.0.0b260409`, it is part of an actively developed monorepo (`microsoft/agentframework`) with frequent pre-releases, indicating potential for rapid changes and feature updates.","status":"active","version":"1.0.0b260409","language":"en","source_language":"en","source_url":"https://github.com/microsoft/agentframework/tree/main/src/python/agentframework-claude","tags":["agent","ai","claude","anthropic","microsoft","framework","llm","orchestration"],"install":[{"cmd":"pip install agent-framework-claude","lang":"bash","label":"Install latest beta"}],"dependencies":[{"reason":"This package is an integration layer built on top of the core Agent Framework.","package":"agentframework-core","optional":false},{"reason":"Required for interacting with the Anthropic Claude API.","package":"anthropic","optional":false}],"imports":[{"note":"The library is part of the 'agentframework' monorepo, so its module path is nested under `agentframework.integrations`.","wrong":"from agent_framework_claude import ClaudeAgent","symbol":"ClaudeAgent","correct":"from agentframework.integrations.claude import ClaudeAgent"}],"quickstart":{"code":"import os\nimport asyncio\nfrom agentframework.integrations.claude import ClaudeAgent\n\nasync def main():\n    # Ensure ANTHROPIC_API_KEY is set in your environment\n    anthropic_api_key = os.environ.get('ANTHROPIC_API_KEY', '')\n    if not anthropic_api_key:\n        print(\"Warning: ANTHROPIC_API_KEY environment variable not set. Agent may not function.\")\n\n    agent = ClaudeAgent(\n        name=\"Claude\",\n        description=\"An agent that uses Claude for general purpose reasoning.\",\n        anthropic_api_key=anthropic_api_key,\n        model=\"claude-3-opus-20240229\" # Specify your desired Claude model\n    )\n\n    # Example interaction\n    response = await agent.invoke(\"What is the capital of France?\")\n    print(f\"Claude's response: {response}\")\n\nif __name__ == '__main__':\n    asyncio.run(main())","lang":"python","description":"This quickstart initializes a `ClaudeAgent` and demonstrates a simple asynchronous interaction. Ensure your `ANTHROPIC_API_KEY` is set as an environment variable or passed directly. The `model` parameter is recommended for explicit control."},"warnings":[{"fix":"Always pin to specific versions (e.g., `agent-framework-claude==1.0.0b260409`) and consult the latest GitHub documentation for updates.","message":"As a beta package (`1.0.0b...`), `agent-framework-claude` is subject to frequent breaking changes without major version bumps. API signatures, class names, or core functionalities may change between minor pre-release versions.","severity":"breaking","affected_versions":"All `1.0.0bX` pre-release versions"},{"fix":"Ensure `os.environ['ANTHROPIC_API_KEY']` is set, or pass `anthropic_api_key='YOUR_API_KEY'` directly to the `ClaudeAgent` constructor.","message":"The `ClaudeAgent` constructor requires an `anthropic_api_key`. If this is not provided, or if the `ANTHROPIC_API_KEY` environment variable is not set, API calls will fail with authentication errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Wrap your agent interactions in `async def` functions and use `await`. Run your main async function using `asyncio.run(main())`.","message":"The library is built on `asyncio`. All interactions with the agent (e.g., `agent.invoke()`) are asynchronous and must be `await`ed within an `async` function. Calling them directly will result in a `coroutine object` being returned, not the actual result.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Use `from agentframework.integrations.claude import ClaudeAgent`.","cause":"Incorrect import path. The package is part of the broader `agentframework` and its module is nested.","error":"ModuleNotFoundError: No module named 'agent_framework_claude'"},{"fix":"Set the `ANTHROPIC_API_KEY` environment variable or pass a valid key directly to `ClaudeAgent(anthropic_api_key='...')`. Double-check the key for typos and ensure it has the correct permissions.","cause":"The Anthropic API key is missing or invalid.","error":"anthropic.types.errors.AuthenticationError: invalid x-api-key: ..."},{"fix":"Check `ClaudeAgent` initialization parameters, especially `anthropic_api_key` and `model`. Ensure the API key is valid and the model name exists and is accessible.","cause":"Often occurs when an asynchronous method (like `agent.invoke()`) returns `None` due to an error during initialization, and `await` is called on it.","error":"TypeError: object NoneType can't be used in 'await' expression"}]}