twilight-ai

Guide provider-agnostic integration development for the Twilight AI Go SDK.

Updated May 14, 2026
One-click install
npx skills add https://github.com/pbweb-studio/pb-memoh-studio --skill twilight-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: twilight-ai
Source: https://github.com/pbweb-studio/pb-memoh-studio/tree/main/.agents/skills/twilight-ai
Command: npx skills add https://github.com/pbweb-studio/pb-memoh-studio --skill twilight-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps engineers implement and maintain provider-agnostic integrations for the Twilight AI Go SDK, reducing the effort and risk of wiring models, embeddings, tool calling, streaming, and MCP support across backends.

Core Features & Use Cases

  • Provider development guidance: Implement or update chat provider contracts and ensure correct request/response mapping and typed streaming events.
  • Embeddings support: Add or adjust embedding providers for single and batch embedding flows without mixing concerns with chat providers.
  • Tool calling and MCP integration: Design reliable multi-step tool loops, typed stream parts, and remote tool execution via MCP.
  • Use case: Add a new OpenAI-compatible endpoint or a new embedding backend, then validate that streaming, finish reasons, usage accounting, and tool/MCP behavior remain consistent.

Quick Start

Ask an AI to help you add a new Twilight AI provider implementation by selecting the correct provider type, mapping streaming/tool events to the SDK’s typed StreamPart model, and aligning finish reasons and usage fields with the SDK constants.

Frequently Asked Questions about twilight-ai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new AI provider to a Go SDK without breaking existing chat and embedding integrations?

To add a new AI provider to a Go SDK, implement the provider-agnostic integration layer by preserving the Provider interface contract, mapping request/response fields, and producing correct typed StreamPart lifecycles for chat and embedding flows.

What is the best way to implement tool calling and streaming in an AI Go SDK?

Implementing tool calling and streaming in an AI Go SDK requires designing reliable multi-step tool loops and mapping streaming events to the SDK's typed StreamPart model to ensure consistent finish reasons and usage accounting.

How does MCP integration work with AI providers in a Go SDK?

MCP integration with AI providers works by translating MCP tool schemas into jsonschema and delegating remote tool execution through the Go SDK, ensuring typed stream parts and consistent behavior across backends.

Can I use a single integration layer for both chat completions and batch embeddings?

Yes, you can use a single provider-agnostic integration layer, but you must add or adjust embedding providers for single and batch embedding flows separately to avoid mixing concerns with chat provider implementations.

Why do my AI provider's streaming responses have incorrect finish reasons and usage fields?

Streaming responses show incorrect finish reasons and usage fields when the provider implementation fails to properly map these values to the SDK constants and typed StreamPart lifecycle during the integration process.