This repository was archived by the owner on Dec 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 502
Expand file tree
/
Copy path__init__.py
More file actions
105 lines (78 loc) · 2.95 KB
/
__init__.py
File metadata and controls
105 lines (78 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Google AI Python SDK
## Setup
```posix-terminal
pip install google-generativeai
```
## GenerativeModel
Use `genai.GenerativeModel` to access the API:
```
import google.generativeai as genai
import os
genai.configure(api_key=os.environ['API_KEY'])
model = genai.GenerativeModel(model_name='gemini-1.5-flash')
response = model.generate_content('Teach me about how an LLM works')
print(response.text)
```
See the [python quickstart](https://ai.google.dev/tutorials/python_quickstart) for more details.
"""
from __future__ import annotations
import warnings
import textwrap
from google.generativeai import version
from google.generativeai import caching
from google.generativeai import protos
from google.generativeai import types
from google.generativeai.client import configure
from google.generativeai.embedding import embed_content
from google.generativeai.embedding import embed_content_async
from google.generativeai.files import upload_file
from google.generativeai.files import get_file
from google.generativeai.files import list_files
from google.generativeai.files import delete_file
from google.generativeai.generative_models import GenerativeModel
from google.generativeai.generative_models import ChatSession
from google.generativeai.models import list_models
from google.generativeai.models import list_tuned_models
from google.generativeai.models import get_model
from google.generativeai.models import get_base_model
from google.generativeai.models import get_tuned_model
from google.generativeai.models import create_tuned_model
from google.generativeai.models import update_tuned_model
from google.generativeai.models import delete_tuned_model
from google.generativeai.operations import list_operations
from google.generativeai.operations import get_operation
from google.generativeai.types import GenerationConfig
__version__ = version.__version__
warnings.warn(
textwrap.dedent(
"""
All support for the `google.generativeai` package has ended. It will no longer be receiving
updates or bug fixes. Please switch to the `google.genai` package as soon as possible.
See README for more details:
https://github.com/google-gemini/deprecated-generative-ai-python/blob/main/README.md
"""
),
FutureWarning,
stacklevel=2,
)
del embedding
del files
del generative_models
del models
del client
del operations
del version