Skip to content

Commit

Permalink
feat: [google-ai-generativelanguage] Add system instructions (#12533)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
4 people committed Apr 3, 2024
1 parent dfa5e69 commit c0a0bf6
Show file tree
Hide file tree
Showing 35 changed files with 8,687 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FileService
-----------------------------

.. automodule:: google.ai.generativelanguage_v1beta.services.file_service
:members:
:inherited-members:

.. automodule:: google.ai.generativelanguage_v1beta.services.file_service.pagers
:members:
:inherited-members:
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Services for Google Ai Generativelanguage v1beta API
:maxdepth: 2

discuss_service
file_service
generative_service
model_service
permission_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
from google.ai.generativelanguage_v1beta.services.discuss_service.client import (
DiscussServiceClient,
)
from google.ai.generativelanguage_v1beta.services.file_service.async_client import (
FileServiceAsyncClient,
)
from google.ai.generativelanguage_v1beta.services.file_service.client import (
FileServiceClient,
)
from google.ai.generativelanguage_v1beta.services.generative_service.async_client import (
GenerativeServiceAsyncClient,
)
Expand Down Expand Up @@ -61,14 +67,17 @@
from google.ai.generativelanguage_v1beta.types.content import (
Blob,
Content,
FileData,
FunctionCall,
FunctionCallingConfig,
FunctionDeclaration,
FunctionResponse,
GroundingPassage,
GroundingPassages,
Part,
Schema,
Tool,
ToolConfig,
Type,
)
from google.ai.generativelanguage_v1beta.types.discuss_service import (
Expand All @@ -80,6 +89,15 @@
Message,
MessagePrompt,
)
from google.ai.generativelanguage_v1beta.types.file import File
from google.ai.generativelanguage_v1beta.types.file_service import (
CreateFileRequest,
CreateFileResponse,
DeleteFileRequest,
GetFileRequest,
ListFilesRequest,
ListFilesResponse,
)
from google.ai.generativelanguage_v1beta.types.generative_service import (
AttributionSourceId,
BatchEmbedContentsRequest,
Expand Down Expand Up @@ -197,6 +215,8 @@
__all__ = (
"DiscussServiceClient",
"DiscussServiceAsyncClient",
"FileServiceClient",
"FileServiceAsyncClient",
"GenerativeServiceClient",
"GenerativeServiceAsyncClient",
"ModelServiceClient",
Expand All @@ -211,14 +231,17 @@
"CitationSource",
"Blob",
"Content",
"FileData",
"FunctionCall",
"FunctionCallingConfig",
"FunctionDeclaration",
"FunctionResponse",
"GroundingPassage",
"GroundingPassages",
"Part",
"Schema",
"Tool",
"ToolConfig",
"Type",
"CountMessageTokensRequest",
"CountMessageTokensResponse",
Expand All @@ -227,6 +250,13 @@
"GenerateMessageResponse",
"Message",
"MessagePrompt",
"File",
"CreateFileRequest",
"CreateFileResponse",
"DeleteFileRequest",
"GetFileRequest",
"ListFilesRequest",
"ListFilesResponse",
"AttributionSourceId",
"BatchEmbedContentsRequest",
"BatchEmbedContentsResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


from .services.discuss_service import DiscussServiceAsyncClient, DiscussServiceClient
from .services.file_service import FileServiceAsyncClient, FileServiceClient
from .services.generative_service import (
GenerativeServiceAsyncClient,
GenerativeServiceClient,
Expand All @@ -37,14 +38,17 @@
from .types.content import (
Blob,
Content,
FileData,
FunctionCall,
FunctionCallingConfig,
FunctionDeclaration,
FunctionResponse,
GroundingPassage,
GroundingPassages,
Part,
Schema,
Tool,
ToolConfig,
Type,
)
from .types.discuss_service import (
Expand All @@ -56,6 +60,15 @@
Message,
MessagePrompt,
)
from .types.file import File
from .types.file_service import (
CreateFileRequest,
CreateFileResponse,
DeleteFileRequest,
GetFileRequest,
ListFilesRequest,
ListFilesResponse,
)
from .types.generative_service import (
AttributionSourceId,
BatchEmbedContentsRequest,
Expand Down Expand Up @@ -172,6 +185,7 @@

__all__ = (
"DiscussServiceAsyncClient",
"FileServiceAsyncClient",
"GenerativeServiceAsyncClient",
"ModelServiceAsyncClient",
"PermissionServiceAsyncClient",
Expand Down Expand Up @@ -207,6 +221,8 @@
"CreateChunkRequest",
"CreateCorpusRequest",
"CreateDocumentRequest",
"CreateFileRequest",
"CreateFileResponse",
"CreatePermissionRequest",
"CreateTunedModelMetadata",
"CreateTunedModelRequest",
Expand All @@ -215,6 +231,7 @@
"DeleteChunkRequest",
"DeleteCorpusRequest",
"DeleteDocumentRequest",
"DeleteFileRequest",
"DeletePermissionRequest",
"DeleteTunedModelRequest",
"DiscussServiceClient",
Expand All @@ -225,7 +242,11 @@
"EmbedTextResponse",
"Embedding",
"Example",
"File",
"FileData",
"FileServiceClient",
"FunctionCall",
"FunctionCallingConfig",
"FunctionDeclaration",
"FunctionResponse",
"GenerateAnswerRequest",
Expand All @@ -241,6 +262,7 @@
"GetChunkRequest",
"GetCorpusRequest",
"GetDocumentRequest",
"GetFileRequest",
"GetModelRequest",
"GetPermissionRequest",
"GetTunedModelRequest",
Expand All @@ -255,6 +277,8 @@
"ListCorporaResponse",
"ListDocumentsRequest",
"ListDocumentsResponse",
"ListFilesRequest",
"ListFilesResponse",
"ListModelsRequest",
"ListModelsResponse",
"ListPermissionsRequest",
Expand Down Expand Up @@ -286,6 +310,7 @@
"TextPrompt",
"TextServiceClient",
"Tool",
"ToolConfig",
"TransferOwnershipRequest",
"TransferOwnershipResponse",
"TunedModel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,85 @@
}
}
},
"FileService": {
"clients": {
"grpc": {
"libraryClient": "FileServiceClient",
"rpcs": {
"CreateFile": {
"methods": [
"create_file"
]
},
"DeleteFile": {
"methods": [
"delete_file"
]
},
"GetFile": {
"methods": [
"get_file"
]
},
"ListFiles": {
"methods": [
"list_files"
]
}
}
},
"grpc-async": {
"libraryClient": "FileServiceAsyncClient",
"rpcs": {
"CreateFile": {
"methods": [
"create_file"
]
},
"DeleteFile": {
"methods": [
"delete_file"
]
},
"GetFile": {
"methods": [
"get_file"
]
},
"ListFiles": {
"methods": [
"list_files"
]
}
}
},
"rest": {
"libraryClient": "FileServiceClient",
"rpcs": {
"CreateFile": {
"methods": [
"create_file"
]
},
"DeleteFile": {
"methods": [
"delete_file"
]
},
"GetFile": {
"methods": [
"get_file"
]
},
"ListFiles": {
"methods": [
"list_files"
]
}
}
}
}
},
"GenerativeService": {
"clients": {
"grpc": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2024 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.
#
from .async_client import FileServiceAsyncClient
from .client import FileServiceClient

__all__ = (
"FileServiceClient",
"FileServiceAsyncClient",
)

0 comments on commit c0a0bf6

Please sign in to comment.