adachsoft/ai-integration-anthropic

Anthropic Claude tool-calling SPI adapter for adachsoft/ai-integration.

Maintainers

Package info

gitlab.com/a.adach/ai-integration-anthropic

Issues

pkg:composer/adachsoft/ai-integration-anthropic

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.2.0 2026-03-31 20:40 UTC

This package is auto-updated.

Last update: 2026-03-31 18:40:19 UTC


README

Integracja Anthropic Claude (tool calling) z biblioteką adachsoft/ai-integration.

Wersja

Aktualna wersja: 0.1.0 (pierwsze publiczne wydanie).

Wymagania

  • PHP >= 8.3
  • guzzlehttp/guzzle ^7.0 || ^8.0
  • adachsoft/ai-integration ^0.6.3

Instalacja

composer require adachsoft/ai-integration-anthropic:^0.1.0

Konfiguracja w kodzie

Przykładowe spięcie z fasadą tool-calling z pakietu adachsoft/ai-integration:

use AdachSoft\AiIntegration\PublicApi\Builder\ToolCallingChatFacadeBuilder;
use AdachSoft\AiIntegrationAnthropic\AnthropicToolCallingChatSpi;

$apiKey = getenv('ANTHROPIC_KEY');

$builder = new ToolCallingChatFacadeBuilder();
$builder->withSpiProvider('anthropic', new AnthropicToolCallingChatSpi($apiKey));

$facade = $builder->build();

Szczegółowe przykłady użycia można znaleźć w testach produkcyjnych pod:

  • tests/Production/ToolCalling/AnthropicProviderProductionTest.php
  • tests/Production/ToolCalling/AnthropicFileToolsConversationProductionTest.php

Testy

Domyślnie konfiguracja phpunit.xml definiuje dwa zestawy testów:

  • unit – testy jednostkowe (bez testów produkcyjnych)
  • production – testy produkcyjne/integracyjne wymagające prawdziwego klucza API

Przykłady uruchomienia:

# Wszystkie testy
vendor/bin/phpunit

# Tylko unity
vendor/bin/phpunit --testsuite unit

# Tylko testy produkcyjne
ANTHROPIC_KEY=... vendor/bin/phpunit --testsuite production