Search by

adachsoft / web-content-fetch-deepseek

Arkadiusz Adach

DeepSeek Fetch API implementation of adachsoft/web-content-fetch-contract for extracting web content.

Package info

gitlab.com/a.adach/web-content-fetch-deepseek

Issues

pkg:composer/adachsoft/web-content-fetch-deepseek

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-11-10 17:47 UTC

This package is not auto-updated.

Last update: 2026-11-11 05:26:42 UTC


README

adachsoft/web-content-fetch-deepseek implements the adachsoft/web-content-fetch-contract interface using the DeepSeek Fetch API.

Installation

composer require adachsoft/web-content-fetch-deepseek

The package includes Guzzle as its default PSR-18 HTTP client and PSR-17 request and stream factories. You can provide your own PSR-18 and PSR-17 implementations through the factory.

Usage

use AdachSoft\WebContentFetchDeepseek\Factory\DeepseekWebContentFetcherFactory;

$fetcher = (new DeepseekWebContentFetcherFactory())->create('your-deepseek-api-key');
$content = $fetcher->fetchContent('https://example.com');

The factory sends requests to https://api.deepseek.com/v1/tools/fetch by default. A custom API base URL can be supplied with BaseUrlVo.

The only supported per-request option is a positive integer timeout, in seconds:

$content = $fetcher->fetchContent('https://example.com', ['timeout' => 30]);

Unsupported options and invalid URLs raise exceptions from adachsoft/web-content-fetch-contract. Invalid API keys and base URLs raise InvalidApiKeyException and InvalidBaseUrlException, respectively.

Configuration

The API key is passed explicitly to the factory; the production package does not read environment variables or configuration files. For local end-to-end testing, copy .env.example to .env and set DEEPSEEK_API_KEY.

Testing

Run the unit and integration tests with:

vendor/bin/phpunit

The real-API test belongs to the production group and can be run with:

vendor/bin/phpunit --group production tests

The production test is skipped when DEEPSEEK_API_KEY is not configured in the environment or .env file.