View Source GoogleAI (google_ai v0.1.1)

GoogleAI is an Elixir library that provides a community-maintained client for the Google AI API.

Summary

Functions

Create a new GoogleAI client with the given opts.

Functions

@spec client(opts :: Keyword.t()) :: GoogleAI.Client.t()

Create a new GoogleAI client with the given opts.

Options

  • :api_key (String.t/0) - Required. The API key for the Google AI APIs.

  • :api_version - The version of the API to use. Certain features are only available in later version. The default value is "v1beta".

  • :base_url (String.t/0) - The base URL for the Google AI APIs. The default value is "https://generativelanguage.googleapis.com".

Examples

iex> GoogleAI.client(api_key: "asdfasdf") %GoogleAI.Client{

req: Req.new(
  base_url: "https://generativelanguage.googleapis.com", 
  params: [key: "asdfasdf"], 
  path_params: [version: "v1beta"]
)

}

iex> GoogleAI.client(api_key: "asdfasdf", base_url: "https://example.com", api_version: "v1") %GoogleAI.Client{

req: Req.new(
  base_url: "https://example.com", 
  params: [key: "asdfasdf"], 
  path_params: [version: "v1"]
)

}