PHPackages                             srcker/openai - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. srcker/openai

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

srcker/openai
=============

常用大模型请求结构

1.2.1(1y ago)010Apache-2.0PHP

Since Dec 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/srcker/php-ai-srcker)[ Packagist](https://packagist.org/packages/srcker/openai)[ RSS](/packages/srcker-openai/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

srcker-open-ai
==============

[](#srcker-open-ai)

```
       $chatCompletionRequest = new ChatCompletionRequest();

        $chatCompletionRequest
            ->setModel("ep-20241220124901-pc5gs")
            ->addMessage(new ChatMessage(Role::USER, '介绍下自己'));

        $result = $this->factory
            ->withApiKey("****-6904-***-ba03-**")
            ->withBaseUrl("https://ark.cn-beijing.volces.com/api/v3/chat/completions")
            ->withHttpHeader("Content-Type", "application/json")
            ->withOptions([])
            ->withProxy($this->proxy) //格式: "http://user:password@host:port"
            ->withChatCompletionRequest($chatCompletionRequest)
            ->make();

        print_r($result);
```

```
        $chatCompletionRequest = new ChatCompletionRequest();

        $chatCompletionRequest
            ->setModel("ep-20241220124901-pc5gs")
            ->addMessage(new ChatMessage(Role::USER, '介绍下自己'));

        $this->factory
            ->withApiKey("****-333-****-ba03-***")
            ->withBaseUrl("https://ark.cn-beijing.volces.com/api/v3/chat/completions")
            ->withHttpHeader("Content-Type", "application/json")
            ->withOptions([])
            ->withProxy($this->proxy) //格式: "http://user:password@host:port"
            ->withChatCompletionRequest($chatCompletionRequest)
            ->withStreamHandler(function ($chunk) {
                echo $chunk;
            })
            ->makeStreamHandler();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance42

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

4

Last Release

459d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6daffb3b186092853fbaac1cfa27a85f58399088f9b8e381626ac43c100bc280?d=identicon)[Sinda](/maintainers/Sinda)

---

Top Contributors

[![srcker](https://avatars.githubusercontent.com/u/6512197?v=4)](https://github.com/srcker "srcker (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/srcker-openai/health.svg)

```
[![Health](https://phpackages.com/badges/srcker-openai/health.svg)](https://phpackages.com/packages/srcker-openai)
```

###  Alternatives

[funct/funct

A PHP library with commonly used code blocks

605141.2k75](/packages/funct-funct)[imanghafoori/laravel-terminator

A minimal yet powerful package to give you opportunity to refactor your controllers.

25353.0k](/packages/imanghafoori-laravel-terminator)[hanson/chinese

简繁体转换.

2317.0k](/packages/hanson-chinese)[maisondunet/module-gtm-cookie-consent

A simple cookie consent module for magento. It relies on new GTM consent functionality.

134.5k](/packages/maisondunet-module-gtm-cookie-consent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
