承接 token27/nexus-ai-content 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

token27/nexus-ai-content

Composer 安装命令:

composer require token27/nexus-ai-content

包简介

Generic content orchestration layer for NexusAI workflows, prompts, tracking, pricing, and domain extensions.

README 文档

README

CI PHPStan Level 8 Latest Version PHP 8.3+ License: MIT Tests

A framework-agnostic, workflow-first PHP 8.3+ content orchestration layer for the NexusAI ecosystem. Compose versioned prompts, AI drivers, resumable workflows, tracking, pricing, and domain extensions behind one fluent API.

Why nexus-ai-content?

Article generation, social posts, newsletters, scripts, product descriptions, and future content types all need the same foundation:

  • choose a content type and workflow
  • resolve versioned prompts from nexus-ai-prompts
  • execute nodes through nexus-ai-workflows
  • call providers through nexus-ai
  • track every run through nexus-ai-tracking
  • calculate cost and enforce budgets through nexus-ai-pricing
  • keep domain packages focused on their domain instead of infrastructure

nexus-ai-content is that shared layer. It is intentionally not an article generator. Article logic belongs in nexus-ai-content-articles.

Features

  • Engine + Builder + Registry pattern consistent with the NexusAI libraries.
  • Fluent content API for provider/model selection, workflow selection, variables, language, run id, tracking, pricing, and budgets.
  • Workflow registry keyed by contentType/workflowName.
  • Prompt-aware AI node with ContentAINode.
  • Tracking-ready execution with run id, prompt id, prompt version, content type, workflow, provider, model, tokens, cost, and latency.
  • Pricing-ready execution with post-request cost calculation and optional pre-request budget checks.
  • Extension bootstrap so packages like nexus-ai-content-articles can register workflows cleanly.
  • Test-friendly driver injection through withDriver().

Installation

composer require token27/nexus-ai-content

Requires: PHP 8.3+ and the core NexusAI packages listed in composer.json.

Quick Start

use Token27\NexusAI\Content\ContentEngine;
use Token27\NexusAI\Content\Node\ContentAINode;
use Token27\NexusAI\Workflows\Engine\WorkflowBuilder;

$workflow = WorkflowBuilder::named('default')
    ->addNode('draft', new ContentAINode(
        promptIdentifier: 'content/draft',
        outputKey: 'content',
        promptVersion: '1.0.0',
    ))
    ->build();

$engine = ContentEngine::create()
    ->withPromptRegistry($promptRegistry)
    ->withTracking($tracking)
    ->withPricing($pricing);

$engine->getRegistry()->register('article', $workflow);

$result = $engine
    ->for('openai', 'gpt-4o-mini')
    ->withContentType('article')
    ->withLanguage('es')
    ->withVariable('topic', 'Calidad de contenido con IA')
    ->withBudget(0.25)
    ->generate();

echo $result->text;

For tests, inject a pre-built driver:

$result = $engine
    ->for('fake', 'test-model')
    ->withContentType('article')
    ->withDriver($fakeDriver)
    ->generate();

Documentation

Guide Description
Documentation Home Full documentation map
Installation Composer, dependencies, and first setup
Quick Start First workflow with a fake driver
Fluent API Engine and builder methods
Workflows Registering and running content workflows
Prompts Using nexus-ai-prompts with ContentAINode
Tracking and Pricing Telemetry, costs, budgets, and tokenizer notes
Extending Creating domain extensions
Testing Testing content workflows and nodes
Contributing Development setup and collaboration rules
Architecture Why this package exists before article domains
Troubleshooting Common failures and fixes

Examples

The examples/ directory contains runnable production-style examples that read .env, configure real providers through NexusAI, load prompts, enable pricing, and optionally write tracking events:

Quality Gates

composer validate --strict
vendor/bin/php-cs-fixer fix --dry-run --diff
vendor/bin/phpstan analyse --level=8 src tests
vendor/bin/phpunit

License

MIT. See LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固