Skip to content

Commit

Permalink
Create a 0.2.1 release. (#72)
Browse files Browse the repository at this point in the history
* Update release notes.

* Update to `google.ai.generativelanguage` v0.3.3
  • Loading branch information
MarkDaoust authored Oct 3, 2023
1 parent 0a962ba commit 2a33920
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 22 deletions.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.2.1

- Bugfix: Add missing enum names to `saftey_types.py`
- Update to `google.ai.generativelanguage` v0.3.3

## v0.2

Expand Down
15 changes: 9 additions & 6 deletions docs/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import google
from google import generativeai as palm
from google.ai import generativelanguage_v1beta3 as glm
from google.ai import generativelanguage as glm

from tensorflow_docs.api_generator import generate_lib
from tensorflow_docs.api_generator import public_api
Expand All @@ -54,7 +54,7 @@
when initializing a client:
```
from google.ai import generativelanguage_v1beta3 as glm
from google.ai import generativelanguage as glm
client = glm.DiscussServiceClient(
client_options={'api_key':'YOUR_API_KEY'})
Expand Down Expand Up @@ -147,9 +147,6 @@ def __call__(self, path, parent, children):
if "ServiceClient" in path[-1] or "ServiceAsyncClient" in path[-1]:
children = list(self.drop_staticmethods(parent, children))

if "generativelanguage" in path[-1]:
children.append(('types', glm.types))

return children


Expand Down Expand Up @@ -207,8 +204,9 @@ def gen_api_docs():
# Fixup the toc file.
toc_path = out_path / "google/_toc.yaml"
toc = yaml.safe_load(toc_path.read_text())
assert toc["toc"][0]["title"] == "google"
toc["toc"] = toc["toc"][1:]
toc["toc"][0]["title"] = "google.ai.generativelanguage_v1beta3"
toc["toc"][0]["title"] = "google.ai.generativelanguage"
toc["toc"][0]["section"] = toc["toc"][0]["section"][1]["section"]
toc["toc"][0], toc["toc"][1] = toc["toc"][1], toc["toc"][0]
toc_path.write_text(yaml.dump(toc))
Expand All @@ -230,6 +228,11 @@ def gen_api_docs():
new_content = re.sub(r"\.\. _oneof:.*?\n", "", new_content)
new_content = re.sub(r"`oneof`_.*?\n", "", new_content)
new_content = re.sub(r"\.\. code-block:: python.*?\n", "", new_content)

new_content = re.sub(
r"generativelanguage_\w+.types", "generativelanguage", new_content
)

if new_content != old_content:
fpath.write_text(new_content)

Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os
from typing import cast, Optional, Union

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

from google.auth import credentials as ga_credentials
from google.api_core import client_options as client_options_lib
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/discuss.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from typing import Iterable, List, Optional, Union

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

from google.generativeai.client import get_default_discuss_client
from google.generativeai.client import get_default_discuss_async_client
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import typing
from typing import Any, Literal

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm
from google.generativeai import operations
from google.generativeai.client import get_default_model_client
from google.generativeai.types import model_types
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import functools
from typing import Iterator

from google.ai import generativelanguage_v1beta3 as glm
from google.ai import generativelanguage as glm
from google.generativeai import client as client_lib
from google.generativeai.types import model_types
from google.api_core import operation as operation_lib
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from collections.abc import Sequence
from typing import Iterable, overload

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

from google.generativeai.client import get_default_text_client
from google.generativeai.types import text_types
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/types/citation_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from typing import Optional, List

from google.ai import generativelanguage_v1beta3 as glm
from google.ai import generativelanguage as glm
from google.generativeai import docstring_utils
from typing import TypedDict

Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/types/discuss_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import dataclasses
from typing import Any, Dict, TypedDict, Union, Iterable, Optional, Tuple, List

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm
from google.generativeai.types import safety_types
from google.generativeai.types import citation_types

Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/types/model_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import re
from typing import Any, Iterable, TypedDict, Union

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

__all__ = [
"Model",
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/types/safety_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from collections.abc import Mapping

from google.ai import generativelanguage_v1beta3 as glm
from google.ai import generativelanguage as glm
from google.generativeai import docstring_utils
import typing
from typing import Iterable, Dict, Iterable, List, TypedDict, Union
Expand Down
2 changes: 1 addition & 1 deletion google/generativeai/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.
from __future__ import annotations

__version__ = "0.2.0"
__version__ = "0.2.1"
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ def get_version():
else:
release_status = "Development Status :: 5 - Production/Stable"

dependencies = ["google-ai-generativelanguage==0.3.2", "tqdm"]
dependencies = [
"google-ai-generativelanguage==0.3.3",
"google-auth",
"google-api-core",
"protobuf",
"tqdm",
]

extras_require = {
"dev": [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_discuss.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import unittest.mock

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

from google.generativeai import discuss
from google.generativeai import client
Expand Down
2 changes: 1 addition & 1 deletion tests/test_discuss_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
import unittest

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

from google.generativeai import discuss
from absl.testing import absltest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from absl.testing import absltest
from absl.testing import parameterized

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm
from google.api_core import operation

from google.generativeai import models
Expand Down
2 changes: 1 addition & 1 deletion tests/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from contextlib import redirect_stderr
import io

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm
import google.protobuf.any_pb2

import google.generativeai.operations as genai_operation
Expand Down
2 changes: 1 addition & 1 deletion tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import unittest
import unittest.mock as mock

import google.ai.generativelanguage_v1beta3 as glm
import google.ai.generativelanguage as glm

from google.generativeai import text as text_service
from google.generativeai import client
Expand Down

0 comments on commit 2a33920

Please sign in to comment.