Gleanex.Client.Chat (Gleanex v0.1.0)

Copy Markdown View Source

Provides API endpoints related to chat

Summary

Functions

Deletes all saved Chats owned by a user

Delete files uploaded by a user for chat

Deletes saved Chats

Download a chat file

Retrieves a Chat

Gets the metadata for a custom Chat application

Get files uploaded by a user for Chat

Retrieves all saved Chats

Upload files for Chat

Types

t()

@type t() :: %Gleanex.Client.Chat{
  applicationId: String.t() | nil,
  applicationName: String.t() | nil,
  createTime: integer() | nil,
  createdBy: Gleanex.Client.Person.t() | nil,
  icon: Gleanex.Client.IconConfig.t() | nil,
  id: String.t() | nil,
  name: String.t() | nil,
  permissions: Gleanex.Client.ObjectPermissions.t() | nil,
  updateTime: integer() | nil
}

Functions

chat(body, opts \\ [])

@spec chat(body :: Gleanex.Client.ChatRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.ChatResponse.t()} | {:error, Gleanex.Error.t()}

Chat

Have a conversation with Glean AI.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: application/json

Includes chat history for Glean AI to respond to.

deleteallchats(opts \\ [])

@spec deleteallchats(opts :: keyword()) :: :ok | {:error, Gleanex.Error.t()}

Deletes all saved Chats owned by a user

Deletes all saved Chats a user has had and all their contained conversational content.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

deletechatfiles(body, opts \\ [])

@spec deletechatfiles(
  body :: Gleanex.Client.DeleteChatFilesRequest.t(),
  opts :: keyword()
) ::
  :ok | {:error, Gleanex.Error.t()}

Delete files uploaded by a user for chat

Delete files uploaded by a user for Chat.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: application/json

deletechats(body, opts \\ [])

@spec deletechats(body :: Gleanex.Client.DeleteChatsRequest.t(), opts :: keyword()) ::
  :ok | {:error, Gleanex.Error.t()}

Deletes saved Chats

Deletes saved Chats and all their contained conversational content.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: application/json

get_chat_file(fileId, opts \\ [])

@spec get_chat_file(fileId :: String.t(), opts :: keyword()) ::
  {:ok, binary()} | {:error, Gleanex.Error.t()}

Download a chat file

Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type.

Options

  • preview: When true and the file is a PDF, the response is served inline (Content-Disposition: inline) instead of as an attachment.

getchat(body, opts \\ [])

@spec getchat(body :: Gleanex.Client.GetChatRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.GetChatResponse.t()} | {:error, Gleanex.Error.t()}

Retrieves a Chat

Retrieves the chat history between Glean Assistant and the user for a given Chat.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: application/json

getchatapplication(body, opts \\ [])

@spec getchatapplication(
  body :: Gleanex.Client.GetChatApplicationRequest.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Client.GetChatApplicationResponse.t()}
  | {:error, Gleanex.Error.t()}

Gets the metadata for a custom Chat application

Gets the Chat application details for the specified application ID.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: application/json

getchatfiles(body, opts \\ [])

@spec getchatfiles(body :: Gleanex.Client.GetChatFilesRequest.t(), opts :: keyword()) ::
  {:ok, Gleanex.Client.GetChatFilesResponse.t()} | {:error, Gleanex.Error.t()}

Get files uploaded by a user for Chat

Get files uploaded by a user for Chat.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: application/json

listchats(opts \\ [])

@spec listchats(opts :: keyword()) ::
  {:ok, Gleanex.Client.ListChatsResponse.t()} | {:error, Gleanex.Error.t()}

Retrieves all saved Chats

Retrieves all the saved Chats between Glean Assistant and the user. The returned Chats contain only metadata and no conversational content.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

uploadchatfiles(body, opts \\ [])

@spec uploadchatfiles(
  body :: Gleanex.Client.UploadChatFilesRequest.t(),
  opts :: keyword()
) ::
  {:ok, Gleanex.Client.UploadChatFilesResponse.t()}
  | {:error, Gleanex.Error.t()}

Upload files for Chat

Upload files for Chat.

Options

  • locale: The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
  • timezoneOffset: The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Request Body

Content Types: multipart/form-data