Ollixir.Web (Ollixir v0.1.1)

Copy Markdown View Source

Web search and fetch functionality for Ollama cloud API.

These functions require an Ollama API key when calling the hosted API. Set the OLLAMA_API_KEY environment variable or pass authorization headers when initializing the client.

Summary

Functions

Fetch and extract content from a URL.

Fetch content, raising on error.

Search the web using Ollama's cloud search API.

Search the web, raising on error.

Types

fetch_opts()

@type fetch_opts() :: [url: String.t(), base_url: String.t()]

search_opts()

@type search_opts() :: [
  query: String.t(),
  max_results: pos_integer(),
  base_url: String.t()
]

Functions

fetch(client, opts)

@spec fetch(Ollixir.client(), fetch_opts()) ::
  {:ok, Ollixir.Web.FetchResponse.t()} | {:error, term()}

Fetch and extract content from a URL.

fetch!(client, opts)

Fetch content, raising on error.

search(client, opts)

@spec search(Ollixir.client(), search_opts()) ::
  {:ok, Ollixir.Web.SearchResponse.t()} | {:error, term()}

Search the web using Ollama's cloud search API.

search!(client, opts)

Search the web, raising on error.