Skip to content

change namespace and adding change logs #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CHANGELOG

## [2.x] - 2025-02-01

If you are upgrading from a version `1.x` to `2.x`, please perform the following steps:

### Breaking Changes

### 1. Namespace Change
- **Old Namespace:** `DeepseekPhp`
- **New Namespace:** `DeepSeek`

**Action Required:**
Update all imports in your codebase.

##### Replace:
```php
use DeepseekPhp\DeepseekClient;
```

##### With:
```php
use DeepSeek\DeepseekClient;
```

### Migration Guide
1. Replace all occurrences of `DeepseekPhp` with `DeepSeek` in your code.
3. Run tests to ensure everything works as expected.

If you encounter issues, please refer to our documentation or open an issue on GitHub.

180 changes: 110 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,152 +1,192 @@
<p align="center">
<a href="https://deepseek-php/deepseek-php-client" target="_blank">
<img src="https://raw.githubusercontent.com/deepseek-php/deepseek-php-client/master/public/images/deepseek_screenshot.png" alt="Gpdf">
</a>
<h1 align="center">DeepSeek PHP Client</h1>
<p align="center">🚀 Community-Driven PHP SDK for DeepSeek AI API Integration</p>

<p align="center">
<a href="https://packagist.org/packages/deepseek-php/deepseek-php-client">
<img src="https://img.shields.io/packagist/v/deepseek-php/deepseek-php-client" alt="Latest Version">
</a>
<a href="https://php.net">
<img src="https://img.shields.io/badge/PHP-8.1%2B-blue" alt="PHP Version">
</a>
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/license-MIT-brightgreen" alt="License">
</a>
<a href="https://github.com/deepseek-php/deepseek-php-client/actions">
<img src="https://img.shields.io/github/actions/workflow/status/deepseek-php/deepseek-php-client/tests.yml" alt="Tests Status">
</a>
</p>
</p>

# Deepseek PHP Client

## Table of Contents
- [Overview](#Overview)
- [Features](#key-Features)
- [Installation](#installation)
- [Quick Start Guide](#quick-start-guide)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
- [Use With Frameworks](#use-with-frameworks)
- [Testing](#testing)
- [Contributors](#contributors-)
- [License](#license)
- [✨ Features](#-features)
- [📦 Installation](#-installation)
- [🚀 Quick Start](#-quick-start)
- [Basic Usage](#basic-usage)
- [Advanced Configuration](#advanced-configuration)
- [Framework Integration](#-framework-integration)
- [🆕 Migration Guide](#-migration-guide)
- [📝 Changelog](#-changelog)
- [🧪 Testing](#-testing)
- [🔒 Security](#-security)
- [🤝 Contributors](#-contributors)
- [📄 License](#-license)

---
## Overview
**Deepseek PHP Client** is a robust and community-driven PHP client library for seamless integration with the [Deepseek](https://www.deepseek.com/) API.
### Key Features
- **Easy Integration:** Simplifies interaction with the Deepseek API using a PHP client.
- **Method Chaining:** Supports fluent method chaining for building requests.
- **Customizable:** Allows setting different models, query roles, and streaming options.
- **PSR-18 Compliance:** Utilizes PSR-18 HTTP client for making API requests.

## ✨ Features

- **Seamless API Integration**: PHP-first interface for DeepSeek's AI capabilities
- **Fluent Builder Pattern**: Chainable methods for intuitive request building
- **Enterprise Ready**: PSR-18 compliant HTTP client integration
- **Model Flexibility**: Support for multiple DeepSeek models (Coder, Chat, etc.)
- **Streaming Ready**: Built-in support for real-time response handling
- **Framework Friendly**: Laravel & Symfony packages available

---

## Installation
## 📦 Installation

You can install the package via Composer:
Require the package via Composer:

```bash
composer require deepseek-php/deepseek-php-client
```

**Ensure your project meets the following requirements:**
- PHP 8.1 or later
**Requirements**:
- PHP 8.1+

---

## Quick Start Guide
## 🚀 Quick Start

### Basic Usage

```php
use DeepseekPhp\DeepseekClient;
Get started with just two lines of code:

$apiKey = 'your-api-key';
```php
use DeepSeek\DeepSeekClient;

$response = DeepseekClient::build($apiKey)
->query('Hello Deepseek, how are you today?')
$response = DeepSeekClient::build('your-api-key')
->query('Explain quantum computing in simple terms')
->run();

echo 'API Response:'.$response;
echo $response; // "Quantum computing uses qubits to..."
```

**Note**: in easy mode it will take defaults for all configs [Check Default Values](https://github.com/deepseek-php/deepseek-php-client/blob/master/src/Enums/Configs/DefaultConfigs.php)
📌 Defaults used:
- Model: `deepseek-chat`
- Temperature: 0.8

### Advanced Usage
### Advanced Configuration

```php
use DeepseekPhp\DeepseekClient;
use DeepseekPhp\Enums\Queries\QueryRoles;
use DeepseekPhp\Enums\Models;
use DeepSeek\DeepSeekClient;
use DeepSeek\Enums\Models;

$apiKey = 'your-api-key';

$response = DeepseekClient::build($apiKey, 'https://api.deepseek.com/v2', 500)
->query('System setup query', 'system')
->query('User input message', 'user')
->withModel(Models::CODER->value)
->setTemperature(1.5)
$response = DeepSeekClient::build('your-api-key')
->withBaseUrl('https://api.deepseek.com/v2')
->withModel(Models::CODER)
->withTemperature(1.2)
->run();

echo 'API Response:'.$response;
```

## Use With Frameworks
### 🛠 Framework Integration

### [Laravel Deepseek Package](https://github.com/deepseek-php/deepseek-laravel)

### [Symfony Deepseek Package](https://github.com/deepseek-php/deepseek-symfony)

---

## Testing
## 🚧 Migration Guide

tests will come soon .
Upgrading from v1.x? Check our comprehensive [Migration Guide](MIGRATION.md) for breaking changes and upgrade instructions.

## Changelog
---

See [CHANGELOG](CHANGELOG.md) for recent changes.
## 📝 Changelog

## Contributors ✨
Detailed release notes available in [CHANGELOG.md](CHANGELOG.md)

Thanks to these wonderful people for contributing to this project! 💖
---

## 🧪 Testing

```bash
composer test
```

Test coverage coming in v2.1.

---

## 🔒 Security

**Report Vulnerabilities**: to [omaralwi2010@gmail.com](mailto:omaralwi2010@gmail.com)

---

## 🤝 Contributors

A huge thank you to these amazing people who have contributed to this project! 🎉💖

<table>
<tr>
<td align="center">
<a href="https://github.com/omaralalwi">
<img src="https://avatars.githubusercontent.com/u/25439498?v=4" width="50px;" alt="Omar AlAlwi"/>
<img src="https://avatars.githubusercontent.com/u/25439498?v=4" width="60px;" style="border-radius:50%;" alt="Omar AlAlwi"/>
<br />
<sub><b>Omar AlAlwi</b></sub>
<b>Omar AlAlwi</b>
</a>
<br />
🏆 Creator
</td>
<td align="center">
<a href="https://github.com/aymanalhattami">
<img src="https://avatars.githubusercontent.com/u/34315778?v=4" width="50px;" alt="ayman alhattami"/>
<img src="https://avatars.githubusercontent.com/u/34315778?v=4" width="60px;" style="border-radius:50%;" alt="Ayman Alhattami"/>
<br />
<sub><b>ayman alhattami</b></sub>
<b>Ayman Alhattami</b>
</a>
<br />
🏆 Contributer
⭐ Contributor
</td>
<td align="center">
<a href="https://github.com/moassaad">
<img src="https://avatars.githubusercontent.com/u/155223476?v=4" width="50px;" alt="Mohammad Asaad"/>
<img src="https://avatars.githubusercontent.com/u/155223476?v=4" width="60px;" style="border-radius:50%;" alt="Mohammad Asaad"/>
<br />
<sub><b>Mohammad Asaad</b></sub>
<b>Mohammad Asaad</b>
</a>
<br />
🏆 Contributer
⭐ Contributor
</td>
<td align="center">
<a href="https://github.com/OpadaAlzaiede">
<img src="https://avatars.githubusercontent.com/u/48367429?v=4" width="50px;" alt="Opada Alzaiede"/>
<img src="https://avatars.githubusercontent.com/u/48367429?v=4" width="60px;" style="border-radius:50%;" alt="Opada Alzaiede"/>
<br />
<sub><b>Opada Alzaiede</b></sub>
<b>Opada Alzaiede</b>
</a>
<br />
🏆 Contributer
⭐ Contributor
</td>
<td align="center">
<a href="https://github.com/hishamco">
<img src="https://avatars.githubusercontent.com/u/3237266?v=4" width="60px;" style="border-radius:50%;" alt="Hisham Abdullah"/>
<br />
<b>Hisham Abdullah</b>
</a>
<br />
⭐ Contributor
</td>
<!-- Contributors -->
</tr>
</table>

Want to contribute? Check out the [contributing guidelines](./CONTRIBUTING.md) and submit a pull request! 🚀

## Security
**Want to contribute?** Check out the [contributing guidelines](./CONTRIBUTING.md) and submit a pull request! 🚀

If you discover any security-related issues, please email creator : `omaralwi2010@gmail.com`.
---

## License
## 📄 License

The MIT License (MIT). See [LICENSE](LICENSE.md) for more information.
This package is open-source software licensed under the [MIT License](LICENSE.md).
54 changes: 19 additions & 35 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,32 @@
"description": "deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.",
"keywords": [
"deepseek",
"deepseek-php-client",
"deepseek-api",
"DeepSeek-R1",
"DeepSeek-R1-Zero",
"php-deepseek",
"deepseek-coder",
"deepseek-chat",
"deepseek-math",
"deepseek-integration",
"openai",
"ai",
"sdk",
"codex",
"GPT-3",
"DALL-E",
"api",
"php",
"client",
"deepseek-sdk",
"llm",
"nlp",
"openai",
"qwen",
"machine-learning",
"php-sdk",
"php-ai",
"ai-for-php",
"ai-sdk",
"ai-api",
"natural",
"language",
"processing",
"deepseek-php-library",
"deepseek-client",
"natural-language-processing",
"ai-integration",
"machine-learning",
"php-machine-learning",
"php-iot",
"nlp",
"data-processing",
"deep-learning",
"deepseek-library",
"php-library",
"api-integration",
"php-api-client",
"deepseek-ai",
"php-openai-alternative",
"ai-client-library"
"ai-client-library",
"text-generation",
"generative-ai",
"api-wrapper",
"rest-client",
"developer-tools",
"php-ai-integration",
"deepseek-api",
"openai-alternative"
],
"homepage": "https://github.com/deepseek-php/deepseek-php-client",
"license": "MIT",
Expand All @@ -61,7 +45,7 @@
"role": "creator"
}
],
"version": "1.0.2",
"version": "2.0.0",
"require": {
"php": "^8.1.0",
"php-http/discovery": "^1.20.0",
Expand All @@ -86,12 +70,12 @@
},
"autoload": {
"psr-4": {
"DeepseekPhp\\": "src/"
"DeepSeek\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"DeepseekPhp\\Tests\\": "tests/"
"DeepSeek\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/DeepseekClientContract.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DeepSeekPhp\Contracts;
namespace DeepSeek\Contracts;

use DeepSeekPhp\DeepseekClient;
use DeepSeek\DeepSeekClient;

interface DeepseekClientContract
{
Expand Down
Loading