Skip to content

Commit

Permalink
Fix extra Anthropic import error.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Oct 7, 2024
1 parent 2337e4b commit 0793a71
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "readmeai"
version = "0.5.91"
version = "0.5.92"
description = "Automated README file generator, powered by AI."
authors = ["Eli <egsalamie@gmail.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion readmeai/models/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from readmeai.config.settings import ConfigLoader
from readmeai.errors import UnsupportedServiceError
from readmeai.ingestion.models import RepositoryContext
from readmeai.models.anthropic import AnthropicHandler
from readmeai.models.base import BaseModelHandler
from readmeai.models.claude import AnthropicHandler
from readmeai.models.gemini import GeminiHandler
from readmeai.models.offline import OfflineHandler
from readmeai.models.openai import OpenAIHandler
Expand Down
15 changes: 15 additions & 0 deletions repo-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tests/models/test_claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from readmeai.config.settings import ConfigLoader
from readmeai.ingestion.models import RepositoryContext
from readmeai.models.anthropic import AnthropicHandler
from readmeai.models.claude import AnthropicHandler


@pytest.fixture
Expand Down Expand Up @@ -34,7 +34,7 @@ async def test_build_payload(anthropic_handler):


@pytest.mark.asyncio
@patch("readmeai.models.anthropic.token_handler", new_callable=AsyncMock)
@patch("readmeai.models.claude.token_handler", new_callable=AsyncMock)
@patch("anthropic.AsyncAnthropic", new_callable=AsyncMock)
async def test_make_request_success(
mock_create, mock_token_handler, anthropic_handler: AnthropicHandler
Expand All @@ -57,7 +57,7 @@ async def test_make_request_success(


@pytest.mark.asyncio
@patch("readmeai.models.anthropic.token_handler", new_callable=AsyncMock)
@patch("readmeai.models.claude.token_handler", new_callable=AsyncMock)
@patch("anthropic.AsyncAnthropic", new_callable=AsyncMock)
async def test_make_request_api_error(
mock_create, mock_token_handler, anthropic_handler: AnthropicHandler
Expand All @@ -78,7 +78,7 @@ async def test_make_request_api_error(


@pytest.mark.asyncio
@patch("readmeai.models.anthropic.token_handler", new_callable=AsyncMock)
@patch("readmeai.models.claude.token_handler", new_callable=AsyncMock)
@patch("anthropic.AsyncAnthropic", new_callable=AsyncMock)
async def test_make_request_unexpected_error(
mock_create, mock_token_handler, anthropic_handler: AnthropicHandler
Expand Down

0 comments on commit 0793a71

Please sign in to comment.