Skip to content

Releases: google-gemini/generative-ai-python

v0.6.0

03 Jun 16:46
7b9758f
Compare
Choose a tag to compare

What's Changed

Features

Bugfixes

Docs

New Contributors

Full Changelog: v0.5.4...v0.6.0

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

17 May 01:23
55cca2f
Compare
Choose a tag to compare

What's Changed

  • Update version of generativelanguage to fix timeout errors. by @MarkDaoust in #345

v0.5.3

13 May 20:50
efead6b
Compare
Choose a tag to compare

What's Changed

Features

Bugfixes

Docs

New Contributors

Full Changelog: v0.5.2...v0.5.3

v0.5.2 - File upload bugfix

18 Apr 20:53
668695e
Compare
Choose a tag to compare

Bug Fix

New Features

Full Changelog: v0.5.1...v0.5.2

v0.5.1 - Add json mode

16 Apr 18:26
1b8fe35
Compare
Choose a tag to compare

New features

Docs and small fixes

New Contributors

Full Changelog: v0.5.0...v0.5.1

v0.5.0 - Files

08 Apr 18:18
d64610c
Compare
Choose a tag to compare

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])
    
    • Add initial prototype supporting the files API by @MarkDaoust in #249
    • Files API: improve error messages, add delete_file, add .uri property by @TYMichaelChen in #260
  • 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: v0.4.1...v0.5.0

v0.4.1 - Bugfix

13 Mar 16:03
3704fa8
Compare
Choose a tag to compare

Bugfix

  • The send_message_async method should call the asynchronous method generate_content_async by @xnny in #229

Docs

New Contributors

Full Changelog: v0.4.0...v0.4.1

v0.4.0 - Function calling, Semantic retriever, AQA, and more

04 Mar 17:12
69cb0ea
Compare
Choose a tag to compare

What's new

Features

  • Update notebook magics to work with Gemini by @markmcd in #109
  • Semantic retriever by @shilpakancharla in #168
  • Attributed question answering (genai.generate_answer) by @shilpakancharla in #169
  • Automatic function calling. by @MarkDaoust in #201
     model = genai.GenerativeModel(..., tools=[my_function])
     chat = model.start_chat(enable_automatic_function_calling=True)
    
  • Request options (timeouts, retry, ...) by @aidoskanapyanov in #204
    Model.generate_content(..., 
        request_options={'timeout': 100, 'retry': google.api_core.retry.Retry()})
    
  • Permissions module by @mayureshagashe2105 in #205

More updates

New Contributors

Full Changelog: v0.3.2...v0.4.0

v0.3.2

20 Dec 05:43
9264c68
Compare
Choose a tag to compare

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: v0.3.1...v0.3.2

v0.3.1 - Doc and Bug fixes.

13 Dec 15:47
07fb91c
Compare
Choose a tag to compare

Doc and Bug fixes.