zai

package
v0.1.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package zai provides Z.ai API integration for the LLM gateway.

Index

Constants

This section is empty.

Variables

View Source
var Registration = providers.Registration{
	Type: "zai",
	New:  New,
	Discovery: providers.DiscoveryConfig{
		DefaultBaseURL: defaultBaseURL,
	},
}

Registration provides factory registration for the Z.ai provider.

Functions

func New

New creates a new Z.ai provider.

Types

type Provider

type Provider struct {
	*openai.ChatCompatible
	// contains filtered or unexported fields
}

Provider implements the core.Provider interface for Z.ai. keys is retained to inject auth on the GLM-Realtime websocket target.

func NewWithHTTPClient

func NewWithHTTPClient(apiKey string, baseURL string, httpClient *http.Client, hooks llmclient.Hooks) *Provider

NewWithHTTPClient creates a new Z.ai provider with a custom HTTP client. If httpClient is nil, http.DefaultClient is used.

func (*Provider) RealtimeTarget

func (p *Provider) RealtimeTarget(_ context.Context, req *core.RealtimeRequest) (*core.RealtimeTarget, error)

RealtimeTarget implements core.RealtimeProvider for Z.ai / Zhipu GLM-Realtime, whose core event schema mirrors OpenAI's Realtime API. The host (region) comes from the configured base URL while the path is pinned to realtimePath so chat base variants like the Coding Plan endpoint still resolve correctly. Bearer auth is injected here and must never be logged.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL