Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for the v2 API (#11566)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
- Loading branch information
1 parent
a971664
commit e0e5ce2
Showing
40 changed files
with
10,315 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/google-cloud-language/docs/language_v2/language_service.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
LanguageService | ||
--------------------------------- | ||
|
||
.. automodule:: google.cloud.language_v2.services.language_service | ||
:members: | ||
:inherited-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Services for Google Cloud Language v2 API | ||
========================================= | ||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
language_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Types for Google Cloud Language v2 API | ||
====================================== | ||
|
||
.. automodule:: google.cloud.language_v2.types | ||
:members: | ||
:show-inheritance: |
64 changes: 64 additions & 0 deletions
64
packages/google-cloud-language/google/cloud/language_v2/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# -*- 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. | ||
# | ||
from google.cloud.language_v2 import gapic_version as package_version | ||
|
||
__version__ = package_version.__version__ | ||
|
||
|
||
from .services.language_service import LanguageServiceAsyncClient, LanguageServiceClient | ||
from .types.language_service import ( | ||
AnalyzeEntitiesRequest, | ||
AnalyzeEntitiesResponse, | ||
AnalyzeSentimentRequest, | ||
AnalyzeSentimentResponse, | ||
AnnotateTextRequest, | ||
AnnotateTextResponse, | ||
ClassificationCategory, | ||
ClassifyTextRequest, | ||
ClassifyTextResponse, | ||
Document, | ||
EncodingType, | ||
Entity, | ||
EntityMention, | ||
ModerateTextRequest, | ||
ModerateTextResponse, | ||
Sentence, | ||
Sentiment, | ||
TextSpan, | ||
) | ||
|
||
__all__ = ( | ||
"LanguageServiceAsyncClient", | ||
"AnalyzeEntitiesRequest", | ||
"AnalyzeEntitiesResponse", | ||
"AnalyzeSentimentRequest", | ||
"AnalyzeSentimentResponse", | ||
"AnnotateTextRequest", | ||
"AnnotateTextResponse", | ||
"ClassificationCategory", | ||
"ClassifyTextRequest", | ||
"ClassifyTextResponse", | ||
"Document", | ||
"EncodingType", | ||
"Entity", | ||
"EntityMention", | ||
"LanguageServiceClient", | ||
"ModerateTextRequest", | ||
"ModerateTextResponse", | ||
"Sentence", | ||
"Sentiment", | ||
"TextSpan", | ||
) |
103 changes: 103 additions & 0 deletions
103
packages/google-cloud-language/google/cloud/language_v2/gapic_metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods", | ||
"language": "python", | ||
"libraryPackage": "google.cloud.language_v2", | ||
"protoPackage": "google.cloud.language.v2", | ||
"schema": "1.0", | ||
"services": { | ||
"LanguageService": { | ||
"clients": { | ||
"grpc": { | ||
"libraryClient": "LanguageServiceClient", | ||
"rpcs": { | ||
"AnalyzeEntities": { | ||
"methods": [ | ||
"analyze_entities" | ||
] | ||
}, | ||
"AnalyzeSentiment": { | ||
"methods": [ | ||
"analyze_sentiment" | ||
] | ||
}, | ||
"AnnotateText": { | ||
"methods": [ | ||
"annotate_text" | ||
] | ||
}, | ||
"ClassifyText": { | ||
"methods": [ | ||
"classify_text" | ||
] | ||
}, | ||
"ModerateText": { | ||
"methods": [ | ||
"moderate_text" | ||
] | ||
} | ||
} | ||
}, | ||
"grpc-async": { | ||
"libraryClient": "LanguageServiceAsyncClient", | ||
"rpcs": { | ||
"AnalyzeEntities": { | ||
"methods": [ | ||
"analyze_entities" | ||
] | ||
}, | ||
"AnalyzeSentiment": { | ||
"methods": [ | ||
"analyze_sentiment" | ||
] | ||
}, | ||
"AnnotateText": { | ||
"methods": [ | ||
"annotate_text" | ||
] | ||
}, | ||
"ClassifyText": { | ||
"methods": [ | ||
"classify_text" | ||
] | ||
}, | ||
"ModerateText": { | ||
"methods": [ | ||
"moderate_text" | ||
] | ||
} | ||
} | ||
}, | ||
"rest": { | ||
"libraryClient": "LanguageServiceClient", | ||
"rpcs": { | ||
"AnalyzeEntities": { | ||
"methods": [ | ||
"analyze_entities" | ||
] | ||
}, | ||
"AnalyzeSentiment": { | ||
"methods": [ | ||
"analyze_sentiment" | ||
] | ||
}, | ||
"AnnotateText": { | ||
"methods": [ | ||
"annotate_text" | ||
] | ||
}, | ||
"ClassifyText": { | ||
"methods": [ | ||
"classify_text" | ||
] | ||
}, | ||
"ModerateText": { | ||
"methods": [ | ||
"moderate_text" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/google-cloud-language/google/cloud/language_v2/gapic_version.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- 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. | ||
# | ||
__version__ = "0.0.0" # {x-release-please-version} |
2 changes: 2 additions & 0 deletions
2
packages/google-cloud-language/google/cloud/language_v2/py.typed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Marker file for PEP 561. | ||
# The google-cloud-language package uses inline types. |
15 changes: 15 additions & 0 deletions
15
packages/google-cloud-language/google/cloud/language_v2/services/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# -*- 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. | ||
# |
22 changes: 22 additions & 0 deletions
22
...ages/google-cloud-language/google/cloud/language_v2/services/language_service/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- 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. | ||
# | ||
from .async_client import LanguageServiceAsyncClient | ||
from .client import LanguageServiceClient | ||
|
||
__all__ = ( | ||
"LanguageServiceClient", | ||
"LanguageServiceAsyncClient", | ||
) |
Oops, something went wrong.