# spark.chatgpt.tinywan.com **Repository Path**: Tinywan_admin/spark.chatgpt.tinywan.com ## Basic Information - **Project Name**: spark.chatgpt.tinywan.com - **Description**: 讯飞星火大模型 PHP API 接口,快捷方便地在 PHP 项目中引入星火模型 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2023-10-22 - **Last Updated**: 2023-11-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 介绍 讯飞星火大模型 PHP API 接口,快捷方便地在 PHP 项目中引入星火模型。 # 案例代码 代码仓库地址:https://gitee.com/Tinywan_admin/spark.chatgpt.tinywan.com ## 获取代码 方便大家直接可以使用,尽管只有一个文件也就打包到码云了,方便下载和调试。 克隆码云仓库代码 ``` git clone git@gitee.com:Tinywan_admin/spark.chatgpt.tinywan.com.git ``` ## 安装 > 由于该调用示例应用了三方的websocket库,Github地址:https://github.com/Textalk/websocket-php 进入到文件目录 ``` cd spark.chatgpt.tinywan.com ``` > 安装依赖包 ```php $ composer require textalk/websocket ./composer.json has been created Running composer update textalk/websocket Loading composer repositories with package information Updating dependencies Lock file operations: 6 installs, 0 updates, 0 removals - Locking phrity/net-uri (1.3.0) - Locking phrity/util-errorhandler (1.0.1) - Locking psr/http-factory (1.0.2) - Locking psr/http-message (1.1) - Locking psr/log (1.1.4) - Locking textalk/websocket (1.6.3) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 6 installs, 0 updates, 0 removals - Downloading psr/http-message (1.1) - Downloading phrity/util-errorhandler (1.0.1) - Downloading phrity/net-uri (1.3.0) - Downloading textalk/websocket (1.6.3) - Installing psr/http-message (1.1): Extracting archive - Installing psr/http-factory (1.0.2): Extracting archive - Installing psr/log (1.1.4): Extracting archive - Installing phrity/util-errorhandler (1.0.1): Extracting archive - Installing phrity/net-uri (1.3.0): Extracting archive - Installing textalk/websocket (1.6.3): Extracting archive Generating autoload files No security vulnerability advisories found Using version ^1.6 for textalk/websocket ``` ## 修改配置 > 从开放平台控制台中获取密钥信息,填写在`Spark.php`文件的对应位置 ``` $Appid = "007e50a0"; $Apikey = "UyZmNjNxxxxxxxxxxxxGY1Mzk3"; $ApiSecret ="5459f0f1xxxxxxxxxxxxxxxd9ef7af4e"; ``` ![输入图片说明](01.png) ## 运行测试 > 使用PHP语言实现一个冒泡排序代码 ![输入图片说明](02.png) > Tinywan都是有那些Casbin相关视频教程 ![输入图片说明](03.png)