Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 98d8ab5

Browse filesBrowse files
feat(generative-ai): code clean up & add requirement files to feature folders (GoogleCloudPlatform#12709)
Multiple changes * Move text-bison, code-bison samples to text_models folder * Add requirement files to feature folders * code cleanup and fix lint issues
1 parent ccd7ee2 commit 98d8ab5
Copy full SHA for 98d8ab5

File tree

Expand file treeCollapse file tree

101 files changed

+644
-137
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

101 files changed

+644
-137
lines changed

‎generative_ai/audio/__init__.py

Copy file name to clipboardExpand all lines: generative_ai/audio/__init__.py
Whitespace-only changes.

‎generative_ai/batch_predict/test_batch_predict.py renamed to ‎generative_ai/batch_predict/test_batch_predict_examples.py

Copy file name to clipboardExpand all lines: generative_ai/batch_predict/test_batch_predict_examples.py
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@
1313
# limitations under the License.
1414
from typing import Callable
1515

16-
17-
import batch_code_predict
18-
import batch_text_predict
19-
import gemini_batch_predict
20-
21-
2216
from google.cloud import storage
2317
from google.cloud.aiplatform import BatchPredictionJob
2418
from google.cloud.aiplatform_v1 import JobState
2519

2620
import pytest
2721

22+
import batch_code_predict
23+
import batch_text_predict
24+
import gemini_batch_predict
25+
26+
2827
INPUT_BUCKET = "cloud-samples-data"
2928
OUTPUT_BUCKET = "python-docs-samples-tests"
3029
OUTPUT_PATH = "batch/batch_text_predict_output"
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0

‎generative_ai/context_caching/test_context_caching.py

Copy file name to clipboardExpand all lines: generative_ai/context_caching/test_context_caching.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
from typing import Generator
1717

18+
import pytest
1819

1920
import create_context_cache
2021
import delete_context_cache
2122
import get_context_cache
2223
import list_context_caches
23-
import pytest
2424
import update_context_cache
2525
import use_context_cache
2626

+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0

‎generative_ai/embeddings/test_embeddings.py renamed to ‎generative_ai/embeddings/test_embeddings_examples.py

Copy file name to clipboardExpand all lines: generative_ai/embeddings/test_embeddings_examples.py
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,24 @@
1515

1616
import backoff
1717

18-
import batch_example
19-
import code_retrieval_example
20-
import document_retrieval_example
21-
import generate_embeddings_with_lower_dimension
22-
2318
from google.api_core.exceptions import FailedPrecondition, ResourceExhausted
2419

2520
import google.auth
2621

2722
from google.cloud import aiplatform
2823
from google.cloud.aiplatform import initializer as aiplatform_init
2924

25+
import pytest
26+
27+
import batch_example
28+
import code_retrieval_example
29+
import document_retrieval_example
30+
import generate_embeddings_with_lower_dimension
3031
import model_tuning_example
3132
import multimodal_example
3233
import multimodal_image_example
3334
import multimodal_video_example
3435

35-
import pytest
36-
3736

3837
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
3938
@pytest.fixture(scope="session")
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0

‎generative_ai/extensions/extensions_test.py renamed to ‎generative_ai/extensions/test_exextensions_examples.py

Copy file name to clipboardExpand all lines: generative_ai/extensions/test_exextensions_examples.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515

1616
from typing import Generator
1717

18+
import pytest
19+
1820
import create_example
1921
import delete_example
2022
import execute_example
2123
import get_example
2224
import list_example
2325

24-
import pytest
25-
2626
PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
2727

2828

+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0

‎generative_ai/function_calling/test_function_calling.py

Copy file name to clipboardExpand all lines: generative_ai/function_calling/test_function_calling.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import advanced_example
1514

1615
import backoff
1716

17+
from google.api_core.exceptions import ResourceExhausted
18+
19+
import advanced_example
1820
import basic_example
1921
import chat_example
2022
import chat_function_calling_basic
2123
import chat_function_calling_config
22-
23-
from google.api_core.exceptions import ResourceExhausted
24-
2524
import parallel_function_calling_example
2625

2726

+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
backoff==2.2.1
2+
google-api-core==2.19.0
3+
pytest==8.2.0
4+
pytest-asyncio==0.23.6

‎generative_ai/image/requirements.txt

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pandas==1.3.5; python_version == '3.7'
2+
pandas==2.0.3; python_version == '3.8'
3+
pandas==2.1.4; python_version > '3.8'
4+
pillow==10.3.0; python_version < '3.8'
5+
pillow==10.3.0; python_version >= '3.8'
6+
google-cloud-aiplatform[all]==1.69.0
7+
sentencepiece==0.2.0
8+
google-auth==2.29.0
9+
anthropic[vertex]==0.28.0
10+
langchain-core==0.2.11
11+
langchain-google-vertexai==1.0.6
12+
numpy<2
13+
openai==1.30.5
14+
immutabledict==4.2.0

‎generative_ai/image_generation/edit_image_inpainting_insert_mask_mode_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_inpainting_insert_mask_mode_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_inpainting_insert_mask_mode
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_inpainting_insert_mask_mode
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "woman.png")

‎generative_ai/image_generation/edit_image_inpainting_insert_mask_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_inpainting_insert_mask_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
import backoff
1717

18-
import edit_image_inpainting_insert_mask
19-
2018
from google.api_core.exceptions import ResourceExhausted
2119

20+
import edit_image_inpainting_insert_mask
21+
2222

2323
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2424
_INPUT_FILE = os.path.join(_RESOURCES, "woman.png")

‎generative_ai/image_generation/edit_image_inpainting_remove_mask_mode_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_inpainting_remove_mask_mode_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_inpainting_remove_mask_mode
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_inpainting_remove_mask_mode
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "woman.png")

‎generative_ai/image_generation/edit_image_inpainting_remove_mask_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_inpainting_remove_mask_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_inpainting_remove_mask
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_inpainting_remove_mask
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "volleyball_game.png")

‎generative_ai/image_generation/edit_image_mask_free_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_mask_free_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_mask_free
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_mask_free
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "cat.png")

‎generative_ai/image_generation/edit_image_mask_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_mask_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_mask
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_mask
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "dog_newspaper.png")

‎generative_ai/image_generation/edit_image_outpainting_mask_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_outpainting_mask_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_outpainting_mask
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_outpainting_mask
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "roller_skaters.png")

‎generative_ai/image_generation/edit_image_product_image_test.py

Copy file name to clipboardExpand all lines: generative_ai/image_generation/edit_image_product_image_test.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import backoff
1818

19-
import edit_image_product_image
20-
2119
from google.api_core.exceptions import ResourceExhausted
2220

21+
import edit_image_product_image
22+
2323

2424
_RESOURCES = os.path.join(os.path.dirname(__file__), "test_resources")
2525
_INPUT_FILE = os.path.join(_RESOURCES, "pillow.png")

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.