GoogleAI
is an Elixir library that provides a community-maintained Google AI API client.
See https://ai.google.dev/tutorials/rest_quickstart for more information of the Google AI REST API.
The package can be installed by adding google_ai
to your list of dependencies in mix.exs
:
def deps do
[
{:google_ai, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/google_ai.
-
generateContent
- Text-only input -
generateContent
- Text-and-image Input -
generateContent
- Multi-turn conversation -
generateContent
- Configuration -
streamGenerateContent
-
countTokens
-
embedContent
-
batchEmbedContents
- Get model
- List models
You can configure google_ai
in your mix config.exs (default $project_root/config/config.exs). If you're using Phoenix add the configuration in your config/dev.exs|test.exs|prod.exs files. An example config is:
import Config
config :google_ai,
# find it at https://makersuite.google.com/app/apikey
api_key: "your-api-key",
MIT