Skip to content

Commit 2a33920

Browse files
authored
Create a 0.2.1 release. (#72)
* Update release notes. * Update to `google.ai.generativelanguage` v0.3.3
1 parent 0a962ba commit 2a33920

18 files changed

+35
-22
lines changed

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.2.1
2+
3+
- Bugfix: Add missing enum names to `saftey_types.py`
4+
- Update to `google.ai.generativelanguage` v0.3.3
15

26
## v0.2
37

docs/build_docs.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
import google
3232
from google import generativeai as palm
33-
from google.ai import generativelanguage_v1beta3 as glm
33+
from google.ai import generativelanguage as glm
3434

3535
from tensorflow_docs.api_generator import generate_lib
3636
from tensorflow_docs.api_generator import public_api
@@ -54,7 +54,7 @@
5454
when initializing a client:
5555
5656
```
57-
from google.ai import generativelanguage_v1beta3 as glm
57+
from google.ai import generativelanguage as glm
5858
5959
client = glm.DiscussServiceClient(
6060
client_options={'api_key':'YOUR_API_KEY'})
@@ -147,9 +147,6 @@ def __call__(self, path, parent, children):
147147
if "ServiceClient" in path[-1] or "ServiceAsyncClient" in path[-1]:
148148
children = list(self.drop_staticmethods(parent, children))
149149

150-
if "generativelanguage" in path[-1]:
151-
children.append(('types', glm.types))
152-
153150
return children
154151

155152

@@ -207,8 +204,9 @@ def gen_api_docs():
207204
# Fixup the toc file.
208205
toc_path = out_path / "google/_toc.yaml"
209206
toc = yaml.safe_load(toc_path.read_text())
207+
assert toc["toc"][0]["title"] == "google"
210208
toc["toc"] = toc["toc"][1:]
211-
toc["toc"][0]["title"] = "google.ai.generativelanguage_v1beta3"
209+
toc["toc"][0]["title"] = "google.ai.generativelanguage"
212210
toc["toc"][0]["section"] = toc["toc"][0]["section"][1]["section"]
213211
toc["toc"][0], toc["toc"][1] = toc["toc"][1], toc["toc"][0]
214212
toc_path.write_text(yaml.dump(toc))
@@ -230,6 +228,11 @@ def gen_api_docs():
230228
new_content = re.sub(r"\.\. _oneof:.*?\n", "", new_content)
231229
new_content = re.sub(r"`oneof`_.*?\n", "", new_content)
232230
new_content = re.sub(r"\.\. code-block:: python.*?\n", "", new_content)
231+
232+
new_content = re.sub(
233+
r"generativelanguage_\w+.types", "generativelanguage", new_content
234+
)
235+
233236
if new_content != old_content:
234237
fpath.write_text(new_content)
235238

google/generativeai/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import os
1818
from typing import cast, Optional, Union
1919

20-
import google.ai.generativelanguage_v1beta3 as glm
20+
import google.ai.generativelanguage as glm
2121

2222
from google.auth import credentials as ga_credentials
2323
from google.api_core import client_options as client_options_lib

google/generativeai/discuss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from typing import Iterable, List, Optional, Union
2222

23-
import google.ai.generativelanguage_v1beta3 as glm
23+
import google.ai.generativelanguage as glm
2424

2525
from google.generativeai.client import get_default_discuss_client
2626
from google.generativeai.client import get_default_discuss_async_client

google/generativeai/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import typing
1818
from typing import Any, Literal
1919

20-
import google.ai.generativelanguage_v1beta3 as glm
20+
import google.ai.generativelanguage as glm
2121
from google.generativeai import operations
2222
from google.generativeai.client import get_default_model_client
2323
from google.generativeai.types import model_types

google/generativeai/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import functools
1818
from typing import Iterator
1919

20-
from google.ai import generativelanguage_v1beta3 as glm
20+
from google.ai import generativelanguage as glm
2121
from google.generativeai import client as client_lib
2222
from google.generativeai.types import model_types
2323
from google.api_core import operation as operation_lib

google/generativeai/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from collections.abc import Sequence
1919
from typing import Iterable, overload
2020

21-
import google.ai.generativelanguage_v1beta3 as glm
21+
import google.ai.generativelanguage as glm
2222

2323
from google.generativeai.client import get_default_text_client
2424
from google.generativeai.types import text_types

google/generativeai/types/citation_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from typing import Optional, List
1818

19-
from google.ai import generativelanguage_v1beta3 as glm
19+
from google.ai import generativelanguage as glm
2020
from google.generativeai import docstring_utils
2121
from typing import TypedDict
2222

google/generativeai/types/discuss_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import dataclasses
1919
from typing import Any, Dict, TypedDict, Union, Iterable, Optional, Tuple, List
2020

21-
import google.ai.generativelanguage_v1beta3 as glm
21+
import google.ai.generativelanguage as glm
2222
from google.generativeai.types import safety_types
2323
from google.generativeai.types import citation_types
2424

google/generativeai/types/model_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import re
2121
from typing import Any, Iterable, TypedDict, Union
2222

23-
import google.ai.generativelanguage_v1beta3 as glm
23+
import google.ai.generativelanguage as glm
2424

2525
__all__ = [
2626
"Model",

0 commit comments

Comments
 (0)