View Source ExNylas.SmartCompose (ExNylas v0.9.0)

Interface for Nylas smart compose.

Nylas docs

Summary

Functions

Create a smart compose.

Create a smart compose.

Smart compose a message reply.

Smart compose a message reply.

Smart compose a reply to a message with a streaming response.

Smart compose a message with a streaming response.

Functions

@spec create(ExNylas.Connection.t(), String.t()) ::
  {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}

Create a smart compose.

Examples

iex> {:ok, res} = ExNylas.SmartCompose.create(conn, prompt)

Create a smart compose.

Examples

iex> res = ExNylas.SmartCompose.create!(conn, prompt)
Link to this function

create_reply(conn, message_id, prompt)

View Source
@spec create_reply(ExNylas.Connection.t(), String.t(), String.t()) ::
  {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}

Smart compose a message reply.

Examples

iex> {:ok, res} = ExNylas.SmartCompose.create_reply(conn, message_id, prompt)
Link to this function

create_reply!(conn, message_id, prompt)

View Source
@spec create_reply!(ExNylas.Connection.t(), String.t(), String.t()) ::
  ExNylas.Response.t()

Smart compose a message reply.

Examples

iex> res = ExNylas.SmartCompose.create_reply!(conn, message_id, prompt)
Link to this function

create_reply_stream(conn, message_id, prompt, stream_to)

View Source
@spec create_reply_stream(ExNylas.Connection.t(), String.t(), String.t(), function()) ::
  {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}

Smart compose a reply to a message with a streaming response.

Note - ExNylas will call the provided function with each transformed chunk of the suggestion as it is received.

Examples

iex> ExNylas.SmartCompose.create_reply_stream(conn, message_id, prompt, &IO.write/1)
iex> Dear [Recipient], ...
iex> {:ok, ""}
Link to this function

create_stream(conn, prompt, stream_to)

View Source
@spec create_stream(ExNylas.Connection.t(), String.t(), function()) ::
  {:ok, ExNylas.Response.t()} | {:error, ExNylas.Response.t()}

Smart compose a message with a streaming response.

Note - ExNylas will call the provided function with each transformed chunk of the suggestion as it is received.

Examples

iex> ExNylas.SmartCompose.create_stream(conn, prompt, &IO.write/1)
iex> Dear [Recipient], ...
iex> {:ok, ""}