chatapi

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, deps Deps) (agentkit.Platform, error)

New registers platform/chat-api: Dify-like HTTP + SSE API for custom apps and BFFs.

Types

type Config

type Config struct {
	common.AgentRoutingConfig
	ListenAddr string `json:"listenAddr"`
	// RegisterOnly mounts routes on http.DefaultServeMux and does not listen.
	// Use with platform/http (or any plugin that serves DefaultServeMux).
	// listenAddr "-" is an alias for registerOnly.
	RegisterOnly   bool   `json:"registerOnly"`
	Path           string `json:"path"`
	APIToken       string `json:"apiToken"`
	UserHeader     string `json:"userHeader"`
	UserNameHeader string `json:"userNameHeader"`
	ChannelHeader  string `json:"channelHeader"`
	// MetadataHeaders lists HTTP headers copied into MessageEvent.Metadata.
	MetadataHeaders    []string `json:"metadataHeaders"`
	CORSOrigins        []string `json:"corsOrigins"`
	RequestTimeout     string   `json:"requestTimeout"`
	InteractionTimeout string   `json:"interactionTimeout"`
	// Interactive enables permission/ask_user prompts via SSE (default true when unset).
	Interactive   *bool  `json:"interactive,omitempty"`
	BusyPolicy    string `json:"busyPolicy"`
	MaxRuns       int    `json:"maxRuns"`
	MaxUploadSize int64  `json:"maxUploadSize"`
	PublicBaseURL string `json:"publicBaseUrl"`
	DebugUI       bool   `json:"debugUi"`
	SessionsDir   string `json:"sessionsDir"`
	// Agents lists selectable agent ids for debug UI and request validation.
	Agents []string `json:"agents"`
}

type Deps

type Deps struct {
	Commands     agentkit.Commands     `json:"commands,omitempty"`
	SessionStore agentkit.SessionStore `json:"sessionStore,omitempty"`
	Workspace    workspace.Service     `json:"workspace,omitempty"`
	Agents       []agentkit.Agent      `json:"agents,omitempty"`
}

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

func (*Platform) PermissionCapability

func (p *Platform) PermissionCapability() permission.Capability

func (*Platform) PlatformID

func (p *Platform) PlatformID() string

func (*Platform) Receive

func (p *Platform) Receive(ctx context.Context) (agentkit.MessageEvent, error)

func (*Platform) Send

func (p *Platform) Send(ctx context.Context, event agentkit.OutboundEvent) error

Jump to

Keyboard shortcuts

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