Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [google-ai-generativelanguage] Add system instructions #12533

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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",
)