slackline/api/assistant

This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.

Assistant and AI app threads: real-time search, thread status, titles and suggested prompts.

Types

A message sent directly before or after a search result.

pub type ContextMessage {
  ContextMessage(
    text: option.Option(String),
    user_id: option.Option(String),
    user_id_colon: option.Option(String),
    author_name: option.Option(String),
    ts: option.Option(String),
    blocks: option.Option(List(block.Block)),
  )
}

Constructors

  • ContextMessage(
      text: option.Option(String),
      user_id: option.Option(String),
      user_id_colon: option.Option(String),
      author_name: option.Option(String),
      ts: option.Option(String),
      blocks: option.Option(List(block.Block)),
    )

    Arguments

    text

    Text of the message.

    user_id

    Author of the message.

    user_id_colon

    Author of the message.

    author_name

    Display name of the author.

    ts

    Timestamp of the message.

    blocks

    Blocks of the message, when include_message_blocks is set.

A channel found by assistant.search.context.

pub type SearchChannelResult {
  SearchChannelResult(
    team_id: option.Option(String),
    creator_user_id: option.Option(String),
    creator_name: option.Option(String),
    date_created: option.Option(Int),
    date_updated: option.Option(Int),
    name: option.Option(String),
    topic: option.Option(String),
    purpose: option.Option(String),
    permalink: option.Option(String),
  )
}

Constructors

Identifies assistant.search.context in the slackline.Call that search_context returns.

pub type SearchContext

Messages surrounding a search result.

pub type SearchContextMessages {
  SearchContextMessages(
    before: option.Option(List(ContextMessage)),
    after: option.Option(List(ContextMessage)),
  )
}

Constructors

A successful response from assistant.search.context.

pub type SearchContextResponse {
  SearchContextResponse(
    results: option.Option(SearchContextResults),
    response_metadata: option.Option(slackline.ResponseMetadata),
  )
}

Constructors

Results of assistant.search.context, grouped by content type.

pub type SearchContextResults {
  SearchContextResults(
    messages: option.Option(List(SearchMessageResult)),
    files: option.Option(List(SearchFileResult)),
    channels: option.Option(List(SearchChannelResult)),
    users: option.Option(List(SearchUserResult)),
  )
}

Constructors

A file found by assistant.search.context.

pub type SearchFileResult {
  SearchFileResult(
    file_id: option.Option(String),
    uploader_user_id: option.Option(String),
    author_user_id: option.Option(String),
    author_name: option.Option(String),
    team_id: option.Option(String),
    date_created: option.Option(Int),
    date_updated: option.Option(Int),
    title: option.Option(String),
    file_type: option.Option(String),
    permalink: option.Option(String),
    content: option.Option(String),
  )
}

Constructors

Identifies assistant.search.info in the slackline.Call that search_info returns.

pub type SearchInfo

A successful response from assistant.search.info.

pub type SearchInfoResponse {
  SearchInfoResponse(is_ai_search_enabled: option.Option(Bool))
}

Constructors

  • SearchInfoResponse(is_ai_search_enabled: option.Option(Bool))

    Arguments

    is_ai_search_enabled

    Whether AI search is enabled for the workspace.

A message found by assistant.search.context.

pub type SearchMessageResult {
  SearchMessageResult(
    author_name: option.Option(String),
    author_user_id: option.Option(String),
    team_id: option.Option(String),
    channel_id: option.Option(String),
    channel_name: option.Option(String),
    message_ts: option.Option(String),
    thread_ts: option.Option(String),
    content: option.Option(String),
    is_author_bot: option.Option(Bool),
    permalink: option.Option(String),
    blocks: option.Option(List(block.Block)),
    context_messages: option.Option(SearchContextMessages),
  )
}

Constructors

  • SearchMessageResult(
      author_name: option.Option(String),
      author_user_id: option.Option(String),
      team_id: option.Option(String),
      channel_id: option.Option(String),
      channel_name: option.Option(String),
      message_ts: option.Option(String),
      thread_ts: option.Option(String),
      content: option.Option(String),
      is_author_bot: option.Option(Bool),
      permalink: option.Option(String),
      blocks: option.Option(List(block.Block)),
      context_messages: option.Option(SearchContextMessages),
    )

    Arguments

    author_name

    Display name of the author.

    author_user_id

    Author of the message.

    channel_name

    Name of the channel the message is in.

    message_ts

    Timestamp of the message.

    thread_ts

    Timestamp of the thread the message is in, if any.

    content

    Text content of the message.

    is_author_bot

    Whether the author is a bot.

    permalink

    Permalink to the message.

    blocks

    Blocks of the message, when include_message_blocks is set.

    context_messages

    Messages surrounding this one, when include_context_messages is set.

A user found by assistant.search.context.

pub type SearchUserResult {
  SearchUserResult(
    user_id: option.Option(String),
    permalink: option.Option(String),
    full_name: option.Option(String),
    title: option.Option(String),
    timezone: option.Option(String),
    email: option.Option(String),
    profile_pic_permalink: option.Option(String),
  )
}

Constructors

Identifies assistant.threads.setStatus in the slackline.Call that threads_set_status returns.

pub type ThreadsSetStatus

Identifies assistant.threads.setSuggestedPrompts in the slackline.Call that threads_set_suggested_prompts returns.

pub type ThreadsSetSuggestedPrompts

Identifies assistant.threads.setTitle in the slackline.Call that threads_set_title returns.

pub type ThreadsSetTitle

Values

pub fn context_message_decoder() -> decode.Decoder(ContextMessage)

Decodes ContextMessage from json.

pub fn context_message_to_json(it: ContextMessage) -> json.Json

Encodes ContextMessage as json.

pub fn search_channel_result_decoder() -> decode.Decoder(
  SearchChannelResult,
)

Decodes SearchChannelResult from json.

pub fn search_channel_result_to_json(
  it: SearchChannelResult,
) -> json.Json

Encodes SearchChannelResult as json.

pub fn search_context(
  query query: String,
) -> slackline.Call(SearchContext, SearchContextResponse)

assistant.search.context: Searches messages, files, channels and users across your Slack organization.

assistant.SearchContext identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/assistant/search_context.

Bot token scopes: search:read.public, search:read.files, search:read.users. User token scopes: search:read.public, search:read.private, search:read.im, search:read.mpim, search:read.files, search:read.users.

Rate limit tier: t5.

Documented errors: assistant_search_context_disabled, context_channel_not_found, feature_not_enabled, invalid_action_token, invalid_cursor, missing_query, query_too_long, rate_limited, restricted_action.

pub fn search_context_messages_decoder() -> decode.Decoder(
  SearchContextMessages,
)

Decodes SearchContextMessages from json.

pub fn search_context_messages_to_json(
  it: SearchContextMessages,
) -> json.Json

Encodes SearchContextMessages as json.

pub fn search_context_response_decoder() -> decode.Decoder(
  SearchContextResponse,
)

Decodes the response from assistant.search.context.

pub fn search_context_results_decoder() -> decode.Decoder(
  SearchContextResults,
)

Decodes SearchContextResults from json.

pub fn search_context_results_to_json(
  it: SearchContextResults,
) -> json.Json

Encodes SearchContextResults as json.

pub fn search_file_result_decoder() -> decode.Decoder(
  SearchFileResult,
)

Decodes SearchFileResult from json.

pub fn search_file_result_to_json(
  it: SearchFileResult,
) -> json.Json

Encodes SearchFileResult as json.

pub fn search_info() -> slackline.Call(
  SearchInfo,
  SearchInfoResponse,
)

assistant.search.info: Returns search capabilities on a given team.

assistant.SearchInfo identifies this method in slackline.Call.

Bot token scopes: search:read.public. User token scopes: search:read.public.

Rate limit tier: t2.

pub fn search_info_response_decoder() -> decode.Decoder(
  SearchInfoResponse,
)

Decodes the response from assistant.search.info.

pub fn search_message_result_decoder() -> decode.Decoder(
  SearchMessageResult,
)

Decodes SearchMessageResult from json.

pub fn search_message_result_to_json(
  it: SearchMessageResult,
) -> json.Json

Encodes SearchMessageResult as json.

pub fn search_user_result_decoder() -> decode.Decoder(
  SearchUserResult,
)

Decodes SearchUserResult from json.

pub fn search_user_result_to_json(
  it: SearchUserResult,
) -> json.Json

Encodes SearchUserResult as json.

pub fn threads_set_status(
  channel_id channel_id: String,
  thread_ts thread_ts: String,
  status status: String,
) -> slackline.Call(ThreadsSetStatus, Nil)

assistant.threads.setStatus: Set the status for an AI assistant thread.

assistant.ThreadsSetStatus identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/assistant/threads_set_status.

Bot token scopes: chat:write.

Rate limit tier: t5.

Documented errors: channel_not_found, invalid_thread_ts, method_not_supported_for_channel_type, reserved_username.

pub fn threads_set_suggested_prompts(
  channel_id channel_id: String,
  prompts prompts: List(manifest.SuggestedPrompt),
) -> slackline.Call(ThreadsSetSuggestedPrompts, Nil)

assistant.threads.setSuggestedPrompts: Set suggested prompts for the given assistant thread

assistant.ThreadsSetSuggestedPrompts identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/assistant/threads_set_suggested_prompts.

Bot token scopes: assistant:write.

Rate limit tier: t4.

Documented errors: channel_not_found, invalid_thread_ts, message_not_found, missing_thread_ts, not_agent_app, static_prompts_configured.

pub fn threads_set_title(
  channel_id channel_id: String,
  thread_ts thread_ts: String,
  title title: String,
) -> slackline.Call(ThreadsSetTitle, Nil)

assistant.threads.setTitle: Set the title for the given assistant thread

assistant.ThreadsSetTitle identifies this method in slackline.Call.

Bot token scopes: assistant:write.

Rate limit tier: t4.

Documented errors: channel_not_found, invalid_thread_ts.

✨ Search Document