Help us shape the future of Go! Take the 2026 Go Developer Survey

chatapi

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 31 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)

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"`
	UserEmailHeader string `json:"userEmailHeader"`
	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"`
	// Admins lists user IDs allowed to upload/download files outside work/
	// (absolute paths, global:/local: scopes, and other workspace paths).
	Admins []string `json:"admins,omitempty"`
}

func (*Config) SetDefaults added in v0.3.48

func (c *Config) SetDefaults()

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

func (*Config) Validate added in v0.3.48

func (c *Config) Validate() error

Validate implements pluginkit.Validator.

type Deps

type Deps struct {
	Commands     agentkit.Commands     `json:"commands,omitempty"`
	SessionStore agentkit.SessionStore `json:"sessionStore,omitempty"`
	Workspace    workspace.Service     `json:"workspace,omitempty"`
	// SessionIndex optional: list conversations from the same SQLite index as tool/session-query.
	SessionIndex capsessionindex.Service `json:"sessionIndex,omitempty"`
	Agents       []agentkit.Agent        `json:"agents,omitempty"`
}

type Platform

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

func (*Platform) HTTPHandler added in v0.3.48

func (p *Platform) HTTPHandler() http.Handler

HTTPHandler returns the Chat API mux for embedding and smoke/e2e tests.

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