generative-ai-python

The official Python library for the Google Gemini API

APACHE-2.0 License

Stars
1.3K

Bot releases are hidden (Show)

generative-ai-python - v0.7.2 - Bugfix Latest Release

Published by MarkDaoust 3 months ago

What's Changed

Bugfixes

Docs and Samples

New Contributors

Full Changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.7.1...v0.7.2

generative-ai-python - v0.7.1

Published by MarkDaoust 4 months ago

generative-ai-python - v0.7.0 - Context caching

Published by markmcd 4 months ago

What's Changed

For a detailed introduction, check out the context caching guide on the site.

Features

Bugfixes and small changes

Docs

New Contributors

Full Changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.6.0...v0.7.0

generative-ai-python - v0.6.0

Published by MarkDaoust 5 months ago

What's Changed

Features

Bugfixes

Docs

New Contributors

Full Changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.5.4...v0.6.0

generative-ai-python - v0.5.4 - Bugfix: Update client library version to clear timeouts.

Published by MarkDaoust 5 months ago

What's Changed

generative-ai-python - v0.5.3

Published by MarkDaoust 5 months ago

What's Changed

Features

Bugfixes

Docs

New Contributors

Full Changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.5.2...v0.5.3

generative-ai-python - v0.5.2 - File upload bugfix

Published by MarkDaoust 6 months ago

Bug Fix

New Features

Full Changelog: https://github.com/google-gemini/generative-ai-python/compare/v0.5.1...v0.5.2

generative-ai-python - v0.5.1 - Add json mode

Published by MarkDaoust 6 months ago

New features

Docs and small fixes

New Contributors

Full Changelog: https://github.com/google/generative-ai-python/compare/v0.5.0...v0.5.1

generative-ai-python - v0.5.0 - Files

Published by MarkDaoust 6 months ago

What's Changed

New features

  • Files API

    You can now upload files to the api. Then instead of resending an image with each request, just pass a file reference in your prompt:

    f = genai.upload_file(path="image.png")
    m = genai.GenerativeModel(model_name=...)
    response = m.generate_content(["Please describe this file:", f])
    
  • Semantic retriever

    Using answer.generate_answer, you can now either pass "inline_passages" to include the reference material in the request:

    from google.generativeai import answer
    answer.generate_answer(
        content=question,
        inline_passages=splitter.split(document)
    )
    

    Or pass a reference to a retriever Document or Corpus:

    from google.generativeai import answer
    from google.generativeai import retriever
    my_corpus = retriever.get_corpus('my_corpus')
    genai.generate_answer(
        content=question,
        semantic_retreiver=my_corpus
    )
    
  • System instructions

    When creating a model you can pass a string (or Content) as system_instructions: genai.GenerativeModel(system_instructions="Be good!")

  • Function Calling - Tool Config

    The list of tools available for function calling during a chat session is typically constant. The new tool_config argument lets you switch the function calling mode between None (No function calls), Auto (The model chooses to return text or a FunctionCall), and Any (the model must call a function).

    model = genai.GenerativeModel(tools=[my_functions])
    chat = model.start_chat()
    chat.send_message(tool_config={"function_calling_config": "ANY"})
    

    In Any mode the model will return a function call. You may also pass allowed_function_names to restrict the calls to a subset of the available functions: `chat.send_message(tool_config={"function_calling_config": "ANY", "allowed_function_names": [...]})

    In Any mode the model can use constrained decoding to more strictly follow the argument specifications in the function declarations.

Docs, bug fixes, and minor updates.

New Contributors

Full Changelog: https://github.com/google/generative-ai-python/compare/v0.4.1...v0.5.0

generative-ai-python - v0.4.1 - Bugfix

Published by MarkDaoust 7 months ago

Bugfix

Docs

New Contributors

Full Changelog: https://github.com/google/generative-ai-python/compare/v0.4.0...v0.4.1

generative-ai-python - v0.4.0

Published by MarkDaoust 8 months ago

What's new

Features

More updates

New Contributors

Full Changelog: https://github.com/google/generative-ai-python/compare/v0.3.2...v0.4.0

generative-ai-python - v0.3.2

Published by MarkDaoust 10 months ago

What's Changed

Fix GenerativeModel.count_tokens.
Add basic function call support.
Fix async streaming with python 3.9.
Use typing_extensions for TypedDict.
Fix docs and error messages.

New Contributors

Full Changelog: https://github.com/google/generative-ai-python/compare/v0.3.1...v0.3.2

generative-ai-python - v0.3.1 - Doc and Bug fixes.

Published by MarkDaoust 10 months ago

Doc and Bug fixes.

generative-ai-python - v0.3.0 - Generate Content

Published by MarkDaoust 10 months ago

Adds the Content family of methods to support Gemini models.

generative-ai-python - v0.2.2

Published by MarkDaoust 12 months ago

  • Handle maximum batch size for embed_text.
  • Restore types.ModelNameOptions.
  • Update tuning to handle more dataset types (json, pandas, urls, google-sheets).
  • Expose count_text_tokens
  • Expose operations management.
  • Allow users to pass custom metadata (HTML headers).
  • Add dataclass prettyprinting.
generative-ai-python -

Published by MarkDaoust about 1 year ago

  • Bugfix: Add missing enum names to saftey_types.py
  • Update to google.ai.generativelanguage v0.3.3
    • replace generativelanguage_v1beta3 with generativelanguage
      since that's the default in v0.3.3.
generative-ai-python - v0.2.0

Published by MarkDaoust about 1 year ago

  • Add support for tuning:
    • Add get_tuned_model.
    • Add list_tuned_models.
    • Add create_tuned_model.
  • More flexible safety settings:
    • Accept strings and ints for enums.
  • Accept a {category:threshold} dict in addition to the list of dicts format ([{"category": category, "threshold": threshold}, ...]).
  • Add support for batched embeddings.
generative-ai-python -

Published by MarkDaoust over 1 year ago

generative-ai-python - First release, rc2.

Published by MarkDaoust over 1 year ago

generative-ai-python - First release.

Published by MarkDaoust over 1 year ago