chatapi

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 28 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"`
	Path               string   `json:"path"`
	APIToken           string   `json:"apiToken"`
	UserHeader         string   `json:"userHeader"`
	UserNameHeader     string   `json:"userNameHeader"`
	ChannelHeader      string   `json:"channelHeader"`
	CORSOrigins        []string `json:"corsOrigins"`
	RequestTimeout     string   `json:"requestTimeout"`
	InteractionTimeout string   `json:"interactionTimeout"`
	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