Tôi có sơ đồ sau: [code] Đọc hiểu và giải thích về cấu trúc thư mục Contracts…
- User
User: Tôi có sơ đồ sau:
codegpt4free/ ├── src/ │ ├── Contracts/ # Interface definitions (Interface Segregation) │ │ ├── Http/ │ │ │ └── ClientInterface.php │ │ ├── Providers/ │ │ │ ├── AIProviderInterface.php │ │ │ ├── TextGenerationInterface.php │ │ │ └── ImageGenerationInterface.php │ │ └── Repositories/ │ │ └── RepositoryInterface.php │ │ │ ├── Services/ # Business logic (Single Responsibility) │ │ ├── AI/ │ │ │ ├── TextGeneration/ │ │ │ │ └── TextGenerationService.php │ │ │ └── ImageGeneration/ │ │ │ └── ImageGenerationService.php │ │ └── Factory/ │ │ └── AIProviderFactory.php │ │ │ ├── Providers/ # Concrete implementations (Open/Closed) │ │ ├── OpenAI/ │ │ │ ├── OpenAIProvider.php │ │ │ ├── OpenAITextGeneration.php │ │ │ └── OpenAIImageGeneration.php │ │ ├── Anthropic/ │ │ │ ├── AnthropicProvider.php │ │ │ └── AnthropicTextGeneration.php │ │ └── Google/ │ │ ├── GoogleProvider.php │ │ └── GoogleTextGeneration.php │ │ │ ├── Http/ # HTTP handling │ │ ├── Controllers/ │ │ │ ├── API/ │ │ │ │ ├── TextGenerationController.php │ │ │ │ └── ImageGenerationController.php │ │ │ └── AbstractController.php │ │ ├── Requests/ │ │ │ ├── TextGenerationRequest.php │ │ │ └── ImageGenerationRequest.php │ │ └── Responses/ │ │ ├── JsonResponse.php │ │ └── ErrorResponse.php │ │ │ ├── Repositories/ # Data access layer │ │ ├── Cache/ │ │ │ └── RedisCacheRepository.php │ │ └── AbstractRepository.php │ │ │ ├── Exceptions/ # Custom exceptions │ │ ├── Provider/ │ │ │ ├── ProviderException.php │ │ │ └── ProviderNotFoundException.php │ │ └── Http/ │ │ └── InvalidRequestException.php │ │ │ └── Utils/ # Utilities │ ├── Http/ │ │ └── HttpClient.php │ └── Helpers/ │ └── ResponseFormatter.php │ ├── config/ # Configuration │ ├── providers.php │ ├── cache.php │ └── services.php │ ├── tests/ # Tests │ ├── Unit/ │ │ ├── Services/ │ │ └── Providers/ │ └── Integration/ │ └── Http/ │ ├── docs/ # Documentation │ ├── api/ │ ├── examples/ │ └── README.md │ ├── public/ │ └── index.php │ ├── vendor/ ├── composer.json ├── phpunit.xml └── .gitignore - Assistant