ExAgent.Services.GeminiService (ExAgent v0.2.0)

Copy Markdown View Source

HTTP service for Google Gemini API.

Handles payload formatting and response parsing for the Gemini generateContent endpoint using Req.

Summary

Functions

Sends a chat completion request to the Gemini API.

Streams a chat completion from the Gemini API as a lazy enumerable of text chunks.

Functions

chat(provider, messages, opts \\ [])

@spec chat(
  ExAgent.Providers.Gemini.t(),
  [ExAgent.Message.t()],
  keyword()
) ::
  {:ok, ExAgent.Message.t()}
  | {:tool_call, String.t(), map()}
  | {:error, term()}

Sends a chat completion request to the Gemini API.

stream(provider, messages, opts \\ [])

Streams a chat completion from the Gemini API as a lazy enumerable of text chunks.