itzmekhokan/ai-provider-for-xai 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

itzmekhokan/ai-provider-for-xai

Composer 安装命令:

composer require itzmekhokan/ai-provider-for-xai

包简介

AI Provider for xAI (Grok) for the PHP AI Client SDK. Works as both a Composer package and WordPress plugin.

README 文档

README

AI Provider for xAI (Grok) for the WordPress AI Client. Works as both a Composer package and a WordPress plugin.

This provider registers xAI with the AI Client, exposing the Grok model family for text generation through xAI's OpenAI-compatible Chat Completions API.

Requirements

How it works

xAI exposes an OpenAI-compatible API, so this provider is intentionally thin:

Class Responsibility
Provider\XaiProvider Registers the provider, base URL (https://api.x.ai/v1), API-key auth, and metadata.
Metadata\XaiModelMetadataDirectory Lists models from GET /v1/models and maps capabilities/options.
Models\XaiTextGenerationModel Sends POST /v1/chat/completions via the shared OpenAI-compatible base class.

Because Grok speaks the Chat Completions format, XaiTextGenerationModel extends AbstractOpenAiCompatibleTextGenerationModel from the SDK and only overrides request construction.

Supported capabilities

  • Text generation (chat) with the Grok model family
  • Multimodal (image) input for vision-capable models (e.g. the Grok 4 family)
  • Function calling and JSON / structured output

Installation

As a WordPress plugin

Copy this directory into wp-content/plugins/ and activate it alongside the WordPress AI Client.

As a Composer package

composer require itzmekhokan/ai-provider-for-xai

Author

Khokan Sardar

License

GPL-2.0-or-later

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固