TLDR (tl_dr v0.1.0)
Documentation for TLDR
.
Link to this section Summary
Functions
It sumarizes the content witing the given options.
Link to this section Functions
Link to this function
summarize(content, options \\ [context: OpenAI.Context.build()])
It sumarizes the content witing the given options.
examples
Examples
iex> TLDR.summarize("Hello, world! is a basic computer program commonly used as a first step into programming")
{:ok, "Hello, world! is a basic computer program"}
it also could recieve a list of text to summarize:
iex> texts = ["Hello, world! is a basic computer program commonly used as a first step into programming", "Hello, world! is a basic computer program commonly used as a first step into programming"]
iex> TLDR.summarize(texts)
{:ok, ["Hello, world! is a basic computer program", "Hello, world! is a basic computer program"]}
By default it generates a context for the OpenAI using the ENV variable OPENAI_ACCESS_TOKEN and the engine text-babbage-001. But you can override this behavior by passing your own context.
iex> context = TLDR.OpenAI.Context.build("my_access_token", "my_engine")
iex> TLDR.summarize("Hello, world! is a basic computer program commonly used as a first step into programming", context: context)
{:ok, "Hello, world! is a basic computer program"}