Chatoyant - v0.2.1
    Preparing search index...

      Chatoyant - v0.2.1

      Chatoyant - Typesafe LLM provider clients for TypeScript.

      Native fetch, streaming, structured outputs, zero dependencies.

      // Unified high-level API (recommended)
      import { Chat, genText, genData } from 'chatoyant';

      const answer = await genText("What is 2+2?");

      const chat = new Chat({ model: "gpt-4o" });
      for await (const chunk of chat.user("Hello").stream()) {
      process.stdout.write(chunk);
      }

      // Low-level provider clients
      import { createOpenAIClient } from 'chatoyant/providers/openai';
      import { createAnthropicClient } from 'chatoyant/providers/anthropic';
      import { createXAIClient } from 'chatoyant/providers/xai';

      // Utilities
      import { Schema } from 'chatoyant/schema';
      import { estimateTokens, calculateCost } from 'chatoyant/tokens';

      Classes

      Chat
      Message
      Tool
      AnthropicClient
      ProviderError
      OpenAIClient
      XAIClient
      SchemaError
      Schema

      Interfaces

      ChatJSON
      GenerateResult
      StreamDelta
      MessageJSON
      CommonOptions
      GenerateOptions
      StreamOptions
      ToolOptions
      GenerateWithToolsOptions
      ChatConfig
      GenTextOptions
      GenDataOptions
      GenStreamOptions
      ToolContext
      ToolInput
      ToolDefinition
      ToolCall
      ToolResult
      AnthropicClientConfig
      OpenAIClientConfig
      ProviderMeta
      XAIClientConfig
      BaseFieldOptions
      StringFieldOptions
      NumberFieldOptions
      IntegerFieldOptions
      BooleanFieldOptions
      ArrayFieldOptions
      ObjectFieldOptions
      EnumFieldOptions
      LiteralFieldOptions
      FieldDescriptor
      SchemaConstructor
      SchemaInstance
      JSONSchemaProperty
      JSONSchemaDocument

      Type Aliases

      MessageRole
      OpenAIModel
      AnthropicModel
      XAIModel
      KnownModel
      ProviderId
      ProviderRegistry
      InferSchema
      Proxied
      JSONSchemaType
      StringFormat

      Variables

      DEFAULT_TIMEOUT
      DEFAULT_RETRIES
      DEFAULT_MAX_TOOL_ITERATIONS
      DEFAULT_TOOL_TIMEOUT
      OPENAI_MODELS
      ANTHROPIC_MODELS
      XAI_MODELS
      MODELS_BY_PROVIDER
      PROVIDERS
      PROVIDER_IDS

      Functions

      mergeOptions
      genText
      genData
      genStream
      genStreamAccumulate
      createTool
      createAnthropicClient
      isProviderActive
      activeProviders
      detectProviderByModel
      assertProviderActive
      getApiKey
      getBaseUrl
      resolveProvider
      getModelsForProvider
      isKnownModel
      getAllKnownModels
      createOpenAIClient
      createXAIClient