Versions in this module Expand all Collapse all v0 v0.1.0 Feb 24, 2026 Changes in this version + const DefaultBaseURL + const DefaultVersion + const PersonalAgentID + func IsPersonalAgent(agentID string) bool + func IterAgents(ctx context.Context, client *Client, params *AgentListParams) iter.Seq2[AgentData, error] + func IterMessages(ctx context.Context, thread *Thread, params *ThreadMessageListParams) iter.Seq2[ThreadMessageItem, error] + func IterThreads(ctx context.Context, agent *Agent, params *ThreadListParams) iter.Seq2[ThreadListItem, error] + func StripLangTags(text string) string + type Agent struct + ID string + Instruction *string + Name string + func (a *Agent) Chat(ctx context.Context, params ChatParams) (*ChatInvocationResponse, error) + func (a *Agent) ChatStream(ctx context.Context, params ChatStreamParams) (<-chan StreamChunk, <-chan *ThreadInfo, <-chan error) + func (a *Agent) GetThread(ctx context.Context, threadID string) (*ThreadListItem, error) + func (a *Agent) ListThreads(ctx context.Context, params *ThreadListParams) (*ThreadListResponse, error) + func (a *Agent) PollThread(ctx context.Context, threadID string, opts *PollThreadOptions) (*ThreadListItem, error) + func (a *Agent) Stream(ctx context.Context, params ChatStreamParams) (*StreamReader, error) + func (a *Agent) Thread(threadID string) *Thread + type AgentContentPart struct + FollowUps []FollowUp + Input string + Results []ToolResult + Text string + ToolCallID *string + ToolName string + Type string + type AgentData struct + Description *string + ID string + Icon *AgentIcon + Instruction *string + InstructionsPageID *string + Name string + Object string + Version *AgentVersion + func CollectAgents(ctx context.Context, client *Client, params *AgentListParams) ([]AgentData, error) + type AgentIcon struct + CustomAgentAvatar *CustomAgentAvatar + CustomEmoji *CustomEmoji + Emoji *string + External *ExternalURL + File *FileURL + Type string + type AgentListParams struct + Name string + PageSize int + StartCursor string + type AgentListResponse struct + HasMore bool + NextCursor *string + Object string + Results []AgentData + Type string + type AgentNotFoundError struct + AgentID string + func (e *AgentNotFoundError) Error() string + type AgentOperations struct + func (a *AgentOperations) Agent(agentID string) *Agent + func (a *AgentOperations) List(ctx context.Context, params *AgentListParams) (*AgentListResponse, error) + func (a *AgentOperations) Personal() *Agent + type AgentVersion struct + ID string + Number int + PublishedAt string + type ChatAttachmentInput struct + FileUploadID string + Name string + type ChatInvocationResponse struct + AgentID string + Object string + Status string + ThreadID string + type ChatParams struct + Attachments []ChatAttachmentInput + Message string + ThreadID string + type ChatStreamParams struct + Attachments []ChatAttachmentInput + Message string + OnMessage func(message StreamMessage) + ThreadID string + Verbose *bool + type Client struct + Agents *AgentOperations + func NewClient(opts ClientOptions) *Client + type ClientOptions struct + Auth string + BaseURL string + HTTPClient *http.Client + NotionVersion string + type CreatedBy struct + ID string + Type string + type CustomAgentAvatar struct + URL string + type CustomEmoji struct + ID string + Name string + URL string + type ExternalURL struct + URL string + type FileURL struct + ExpiryTime string + URL string + type FollowUp struct + Label string + Message string + type MessageParent struct + ID string + Type string + type NotionAgentsError struct + Code string + Msg string + func (e *NotionAgentsError) Error() string + type PollThreadOptions struct + BaseDelayMs int + InitialDelayMs int + MaxAttempts int + MaxDelayMs int + OnPending func(thread ThreadListItem, attempt int) + OnThreadNotFound func(attempt int) + type PollingTimeoutError struct + Attempts int + func (e *PollingTimeoutError) Error() string + type StreamChunk struct + AgentID string + Attachments []ThreadMessageAttachment + Code string + Content string + ContentParts []AgentContentPart + ID string + Message string + Role string + ThreadID string + Type string + type StreamError struct + Code string + Msg string + func (e *StreamError) Error() string + type StreamMessage struct + Attachments []ThreadMessageAttachment + Content string + ContentParts []AgentContentPart + ID string + Role string + type StreamReader struct + func (r *StreamReader) Close() error + func (r *StreamReader) Next() (StreamChunk, error) + func (r *StreamReader) ThreadInfo() *ThreadInfo + type Thread struct + AgentID string + ThreadID string + func (t *Thread) Get(ctx context.Context) (*ThreadListItem, error) + func (t *Thread) ListMessages(ctx context.Context, params *ThreadMessageListParams) (*ThreadMessageListResponse, error) + func (t *Thread) Poll(ctx context.Context, opts *PollThreadOptions) (*ThreadListItem, error) + type ThreadInfo struct + AgentID string + Messages []StreamMessage + ThreadID string + type ThreadListItem struct + AgentVersion *AgentVersion + CreatedBy CreatedBy + ID string + Object string + Status ThreadStatus + Title string + func CollectThreads(ctx context.Context, agent *Agent, params *ThreadListParams) ([]ThreadListItem, error) + type ThreadListParams struct + CreatedByID string + CreatedByType string + ID string + PageSize int + StartCursor string + Status ThreadStatus + Title string + type ThreadListResponse struct + HasMore bool + NextCursor *string + Object string + Results []ThreadListItem + Type string + type ThreadMessageAttachment struct + ContentType string + ExpiryTime *string + Name string + URL string + type ThreadMessageItem struct + Attachments []ThreadMessageAttachment + Content string + ContentParts []AgentContentPart + ID string + Object string + Parent MessageParent + Role string + func CollectMessages(ctx context.Context, thread *Thread, params *ThreadMessageListParams) ([]ThreadMessageItem, error) + type ThreadMessageListParams struct + PageSize int + Role string + StartCursor string + Verbose *bool + type ThreadMessageListResponse struct + HasMore bool + NextCursor *string + Object string + Results []ThreadMessageItem + Type string + type ThreadNotFoundError struct + ThreadID string + func (e *ThreadNotFoundError) Error() string + type ThreadStatus string + const ThreadStatusCompleted + const ThreadStatusFailed + const ThreadStatusPending + type ToolResult struct + AgentStepID *string + DurationMs *int64 + Error *string + FinishedAt *int64 + ID string + Input interface{} + Output interface{} + StartedAt int64 + State string + ToolCallID *string + ToolName string + ToolType string