Skip to content

Commit c0a0bf6

Browse files
gcf-owl-bot[bot]partheaohmayr
authored
feat: [google-ai-generativelanguage] Add system instructions (#12533)
BEGIN_COMMIT_OVERRIDE feat: Add system instructions feat: Add tool_config feat: Add file upload service feat: Add file_data to part options docs: A comment for field `candidate_count` in message `.[google.ai](https://www.google.com/url?sa=D&q=http%3A%2F%2Fgoogle.ai).generativelanguage.v1beta.GenerationConfig` is changed END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. feat: Add tool_config feat: Add file upload service feat: Add file_data to part options docs: A comment for field `candidate_count` in message `.google.ai.generativelanguage.v1beta.GenerationConfig` is changed PiperOrigin-RevId: 620400522 Source-Link: googleapis/googleapis@81cd9fe Source-Link: googleapis/googleapis-gen@28d5e4b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFpLWdlbmVyYXRpdmVsYW5ndWFnZS8uT3dsQm90LnlhbWwiLCJoIjoiMjhkNWU0YjRjNjk1NzVhODVhNTc1MzdjOGZhMjIzNDMzMzEyYjBlNyJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent dfa5e69 commit c0a0bf6

35 files changed

Lines changed: 8687 additions & 38 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FileService
2+
-----------------------------
3+
4+
.. automodule:: google.ai.generativelanguage_v1beta.services.file_service
5+
:members:
6+
:inherited-members:
7+
8+
.. automodule:: google.ai.generativelanguage_v1beta.services.file_service.pagers
9+
:members:
10+
:inherited-members:

packages/google-ai-generativelanguage/docs/generativelanguage_v1beta/services_.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Services for Google Ai Generativelanguage v1beta API
44
:maxdepth: 2
55

66
discuss_service
7+
file_service
78
generative_service
89
model_service
910
permission_service

packages/google-ai-generativelanguage/google/ai/generativelanguage/__init__.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
from google.ai.generativelanguage_v1beta.services.discuss_service.client import (
2525
DiscussServiceClient,
2626
)
27+
from google.ai.generativelanguage_v1beta.services.file_service.async_client import (
28+
FileServiceAsyncClient,
29+
)
30+
from google.ai.generativelanguage_v1beta.services.file_service.client import (
31+
FileServiceClient,
32+
)
2733
from google.ai.generativelanguage_v1beta.services.generative_service.async_client import (
2834
GenerativeServiceAsyncClient,
2935
)
@@ -61,14 +67,17 @@
6167
from google.ai.generativelanguage_v1beta.types.content import (
6268
Blob,
6369
Content,
70+
FileData,
6471
FunctionCall,
72+
FunctionCallingConfig,
6573
FunctionDeclaration,
6674
FunctionResponse,
6775
GroundingPassage,
6876
GroundingPassages,
6977
Part,
7078
Schema,
7179
Tool,
80+
ToolConfig,
7281
Type,
7382
)
7483
from google.ai.generativelanguage_v1beta.types.discuss_service import (
@@ -80,6 +89,15 @@
8089
Message,
8190
MessagePrompt,
8291
)
92+
from google.ai.generativelanguage_v1beta.types.file import File
93+
from google.ai.generativelanguage_v1beta.types.file_service import (
94+
CreateFileRequest,
95+
CreateFileResponse,
96+
DeleteFileRequest,
97+
GetFileRequest,
98+
ListFilesRequest,
99+
ListFilesResponse,
100+
)
83101
from google.ai.generativelanguage_v1beta.types.generative_service import (
84102
AttributionSourceId,
85103
BatchEmbedContentsRequest,
@@ -197,6 +215,8 @@
197215
__all__ = (
198216
"DiscussServiceClient",
199217
"DiscussServiceAsyncClient",
218+
"FileServiceClient",
219+
"FileServiceAsyncClient",
200220
"GenerativeServiceClient",
201221
"GenerativeServiceAsyncClient",
202222
"ModelServiceClient",
@@ -211,14 +231,17 @@
211231
"CitationSource",
212232
"Blob",
213233
"Content",
234+
"FileData",
214235
"FunctionCall",
236+
"FunctionCallingConfig",
215237
"FunctionDeclaration",
216238
"FunctionResponse",
217239
"GroundingPassage",
218240
"GroundingPassages",
219241
"Part",
220242
"Schema",
221243
"Tool",
244+
"ToolConfig",
222245
"Type",
223246
"CountMessageTokensRequest",
224247
"CountMessageTokensResponse",
@@ -227,6 +250,13 @@
227250
"GenerateMessageResponse",
228251
"Message",
229252
"MessagePrompt",
253+
"File",
254+
"CreateFileRequest",
255+
"CreateFileResponse",
256+
"DeleteFileRequest",
257+
"GetFileRequest",
258+
"ListFilesRequest",
259+
"ListFilesResponse",
230260
"AttributionSourceId",
231261
"BatchEmbedContentsRequest",
232262
"BatchEmbedContentsResponse",

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/__init__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
from .services.discuss_service import DiscussServiceAsyncClient, DiscussServiceClient
22+
from .services.file_service import FileServiceAsyncClient, FileServiceClient
2223
from .services.generative_service import (
2324
GenerativeServiceAsyncClient,
2425
GenerativeServiceClient,
@@ -37,14 +38,17 @@
3738
from .types.content import (
3839
Blob,
3940
Content,
41+
FileData,
4042
FunctionCall,
43+
FunctionCallingConfig,
4144
FunctionDeclaration,
4245
FunctionResponse,
4346
GroundingPassage,
4447
GroundingPassages,
4548
Part,
4649
Schema,
4750
Tool,
51+
ToolConfig,
4852
Type,
4953
)
5054
from .types.discuss_service import (
@@ -56,6 +60,15 @@
5660
Message,
5761
MessagePrompt,
5862
)
63+
from .types.file import File
64+
from .types.file_service import (
65+
CreateFileRequest,
66+
CreateFileResponse,
67+
DeleteFileRequest,
68+
GetFileRequest,
69+
ListFilesRequest,
70+
ListFilesResponse,
71+
)
5972
from .types.generative_service import (
6073
AttributionSourceId,
6174
BatchEmbedContentsRequest,
@@ -172,6 +185,7 @@
172185

173186
__all__ = (
174187
"DiscussServiceAsyncClient",
188+
"FileServiceAsyncClient",
175189
"GenerativeServiceAsyncClient",
176190
"ModelServiceAsyncClient",
177191
"PermissionServiceAsyncClient",
@@ -207,6 +221,8 @@
207221
"CreateChunkRequest",
208222
"CreateCorpusRequest",
209223
"CreateDocumentRequest",
224+
"CreateFileRequest",
225+
"CreateFileResponse",
210226
"CreatePermissionRequest",
211227
"CreateTunedModelMetadata",
212228
"CreateTunedModelRequest",
@@ -215,6 +231,7 @@
215231
"DeleteChunkRequest",
216232
"DeleteCorpusRequest",
217233
"DeleteDocumentRequest",
234+
"DeleteFileRequest",
218235
"DeletePermissionRequest",
219236
"DeleteTunedModelRequest",
220237
"DiscussServiceClient",
@@ -225,7 +242,11 @@
225242
"EmbedTextResponse",
226243
"Embedding",
227244
"Example",
245+
"File",
246+
"FileData",
247+
"FileServiceClient",
228248
"FunctionCall",
249+
"FunctionCallingConfig",
229250
"FunctionDeclaration",
230251
"FunctionResponse",
231252
"GenerateAnswerRequest",
@@ -241,6 +262,7 @@
241262
"GetChunkRequest",
242263
"GetCorpusRequest",
243264
"GetDocumentRequest",
265+
"GetFileRequest",
244266
"GetModelRequest",
245267
"GetPermissionRequest",
246268
"GetTunedModelRequest",
@@ -255,6 +277,8 @@
255277
"ListCorporaResponse",
256278
"ListDocumentsRequest",
257279
"ListDocumentsResponse",
280+
"ListFilesRequest",
281+
"ListFilesResponse",
258282
"ListModelsRequest",
259283
"ListModelsResponse",
260284
"ListPermissionsRequest",
@@ -286,6 +310,7 @@
286310
"TextPrompt",
287311
"TextServiceClient",
288312
"Tool",
313+
"ToolConfig",
289314
"TransferOwnershipRequest",
290315
"TransferOwnershipResponse",
291316
"TunedModel",

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta/gapic_metadata.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,85 @@
5454
}
5555
}
5656
},
57+
"FileService": {
58+
"clients": {
59+
"grpc": {
60+
"libraryClient": "FileServiceClient",
61+
"rpcs": {
62+
"CreateFile": {
63+
"methods": [
64+
"create_file"
65+
]
66+
},
67+
"DeleteFile": {
68+
"methods": [
69+
"delete_file"
70+
]
71+
},
72+
"GetFile": {
73+
"methods": [
74+
"get_file"
75+
]
76+
},
77+
"ListFiles": {
78+
"methods": [
79+
"list_files"
80+
]
81+
}
82+
}
83+
},
84+
"grpc-async": {
85+
"libraryClient": "FileServiceAsyncClient",
86+
"rpcs": {
87+
"CreateFile": {
88+
"methods": [
89+
"create_file"
90+
]
91+
},
92+
"DeleteFile": {
93+
"methods": [
94+
"delete_file"
95+
]
96+
},
97+
"GetFile": {
98+
"methods": [
99+
"get_file"
100+
]
101+
},
102+
"ListFiles": {
103+
"methods": [
104+
"list_files"
105+
]
106+
}
107+
}
108+
},
109+
"rest": {
110+
"libraryClient": "FileServiceClient",
111+
"rpcs": {
112+
"CreateFile": {
113+
"methods": [
114+
"create_file"
115+
]
116+
},
117+
"DeleteFile": {
118+
"methods": [
119+
"delete_file"
120+
]
121+
},
122+
"GetFile": {
123+
"methods": [
124+
"get_file"
125+
]
126+
},
127+
"ListFiles": {
128+
"methods": [
129+
"list_files"
130+
]
131+
}
132+
}
133+
}
134+
}
135+
},
57136
"GenerativeService": {
58137
"clients": {
59138
"grpc": {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2024 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from .async_client import FileServiceAsyncClient
17+
from .client import FileServiceClient
18+
19+
__all__ = (
20+
"FileServiceClient",
21+
"FileServiceAsyncClient",
22+
)

0 commit comments

Comments
 (0)