Skip to content

jgaskins/google

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google

Crystal implementations of various Google API clients.

Currently supported APIs:

  • Auth (limited)
  • Calendar (getting there)
  • Cloud Storage/GCS
  • Drive (limited)
  • GenerativeAI/Gemini
  • Maps (vestigial)
  • People (self-identification only)
  • Tasks

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      google:
        github: jgaskins/google
  2. Run shards install

Usage

require "google"

Load the specific Google API you need to use:

require "google/auth"
require "google/calendar"
require "google/cloud/storage"
require "google/drive"
require "google/gemini"
require "google/maps"
require "google/people"
require "google/tasks"

API docs are forthcoming.

Using the GenerativeAI API (Gemini)

require "google/gemini"

client = Google::GenerativeAI::Client.new(gemini_api_key)

gemini = client.model(
  "models/gemini-2.0-flash-exp",
  system_instruction: [<<-MALAKAI],
    You are a helpful assistant.
    MALAKAI
  temperature: 0.4,
)

puts gemini.generate(<<-PROMPT)
  Write a limerick about the Crystal programming language.
  PROMPT

Contributing

  1. Fork it (https://github.com/jgaskins/google/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

About

Crystal implementation of various Google APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published