ai_team

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	log.Log
	// contains filtered or unexported fields
}

func New

func New(ctx *config.Context) *API

func (*API) Route

func (a *API) Route(r *wkhttp.WKHttp)

type Agent

type Agent struct {
	ID             int64          `db:"id" json:"-"`
	SpaceID        string         `db:"space_id" json:"space_id"`
	UserUID        string         `db:"user_uid" json:"user_uid"`
	BotID          string         `db:"bot_id" json:"bot_id"`
	BotName        string         `db:"bot_name" json:"bot_name"`
	GroupNo        string         `db:"group_no" json:"group_no,omitempty"`
	IsAdded        int            `db:"is_added" json:"is_added"`
	ContainerState int            `db:"container_state" json:"container_state"`
	SessionCount   int64          `db:"session_count" json:"session_count"`
	CreatedAt      time.Time      `db:"created_at" json:"created_at"`
	UpdatedAt      time.Time      `db:"updated_at" json:"updated_at"`
	GroupType      AgentGroupType `db:"agent_group" json:"-"`
}

type AgentGroup

type AgentGroup struct {
	Type  AgentGroupType `json:"type"`
	Count int64          `json:"count"`
	Items []*Agent       `json:"items"`
}

type AgentGroupType

type AgentGroupType string
const (
	AgentGroupTypeCloudClone        AgentGroupType = "cloud_clone"
	AgentGroupTypePersonalAssistant AgentGroupType = "personal_assistant"
	AgentGroupTypeDigitalEmployee   AgentGroupType = "digital_employee"
)

type AgentPage

type AgentPage struct {
	Groups     []*AgentGroup `json:"groups"`
	NextCursor string        `json:"next_cursor,omitempty"`
}

type Service

type Service struct {
	log.Log
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx *config.Context) *Service

func (*Service) AddAgent

func (s *Service) AddAgent(spaceID, userUID, botID string) (*Agent, error)

func (*Service) ArchiveSession

func (s *Service) ArchiveSession(spaceID, userUID, shortID string, archive bool) error

func (*Service) CreateSession

func (s *Service) CreateSession(spaceID, userUID, botID, idempotencyKey, name string) (*Session, error)

func (*Service) DeleteSession

func (s *Service) DeleteSession(spaceID, userUID, shortID string) error

DeleteSession applies the existing thread soft-delete contract: the thread is hidden and its IM channel is banned, while persisted history is not physically erased. Ownership is resolved from the AI association before the thread service performs its own parent membership and creator checks.

func (*Service) GetSession

func (s *Service) GetSession(spaceID, userUID, shortID string) (*Session, error)

func (*Service) ListAgents

func (s *Service) ListAgents(spaceID, userUID string, beforeID int64, limit int) (*AgentPage, error)

func (*Service) ListSessions

func (s *Service) ListSessions(spaceID, userUID, botID string, statuses []int, pageIndex, pageSize int) (*SessionPage, error)

func (*Service) RemoveAgent

func (s *Service) RemoveAgent(spaceID, userUID, botID string) error

func (*Service) RenameSession

func (s *Service) RenameSession(spaceID, userUID, shortID, name string) error

func (*Service) UpdateSessionSetting

func (s *Service) UpdateSessionSetting(spaceID, userUID, shortID string, settings map[string]interface{}) error

type Session

type Session struct {
	ID                 int64      `db:"id" json:"-"`
	AgentID            int64      `db:"agent_id" json:"-"`
	ShortID            string     `db:"short_id" json:"session_id"`
	GroupNo            string     `db:"group_no" json:"group_no"`
	ChannelID          string     `db:"-" json:"channel_id"`
	Name               string     `db:"name" json:"name"`
	Status             int        `db:"status" json:"status"`
	MessageCount       int64      `db:"message_count" json:"message_count"`
	LastMessageContent string     `db:"last_message_content" json:"last_message_content,omitempty"`
	LastMessageAt      *time.Time `db:"last_message_at" json:"last_message_at,omitempty"`
	CreatedAt          time.Time  `db:"created_at" json:"created_at"`
	UpdatedAt          time.Time  `db:"updated_at" json:"updated_at"`
	State              int        `db:"state" json:"state"`
	ManualTitle        int        `db:"manual_title" json:"manual_title"`
	Mute               int        `db:"mute" json:"mute"`
	IsPinned           bool       `db:"is_pinned" json:"is_pinned"`
	RequestHash        string     `db:"request_hash" json:"-"`
}

type SessionPage

type SessionPage struct {
	Items     []*Session `json:"items"`
	PageIndex int        `json:"page_index"`
	PageSize  int        `json:"page_size"`
	HasMore   bool       `json:"has_more"`
}

Jump to

Keyboard shortcuts

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