Skip to content

Commit

Permalink
feat: support conversational / multi-turn search (#11530)
Browse files Browse the repository at this point in the history
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Jul 28, 2023
1 parent c5f05af commit 2058c1f
Show file tree
Hide file tree
Showing 60 changed files with 13,757 additions and 181 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-discoveryengine/.flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# 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.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-discoveryengine/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ We support:

Supported versions can be found in our ``noxfile.py`` `config`_.

.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-discoveryengine/noxfile.py


**********
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-discoveryengine/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# 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.
Expand Down
27 changes: 14 additions & 13 deletions packages/google-cloud-discoveryengine/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps:
Installation
~~~~~~~~~~~~

Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
create isolated Python environments. The basic problem it addresses is one of
dependencies and versions, and indirectly permissions.
Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
creates isolated Python environments. These isolated environments can have separate
versions of Python packages, which allows you to isolate one project's dependencies
from the dependencies of other projects.

With `virtualenv`_, it's possible to install this library without needing system
With `venv`_, it's possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.

.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
.. _`venv`: https://docs.python.org/3/library/venv.html


Code samples and snippets
~~~~~~~~~~~~~~~~~~~~~~~~~

Code samples and snippets live in the `samples/` folder.
Code samples and snippets live in the `samples/`_ folder.

.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-discoveryengine/samples


Supported Python Versions
Expand All @@ -77,21 +80,19 @@ Mac/Linux

.. code-block:: console
pip install virtualenv
virtualenv <your-env>
python3 -m venv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-discoveryengine
pip install google-cloud-discoveryengine
Windows
^^^^^^^

.. code-block:: console
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-discoveryengine
py -m venv <your-env>
.\<your-env>\Scripts\activate
pip install google-cloud-discoveryengine
Next Steps
~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-discoveryengine/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
# 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ConversationalSearchService
---------------------------------------------

.. automodule:: google.cloud.discoveryengine_v1beta.services.conversational_search_service
:members:
:inherited-members:

.. automodule:: google.cloud.discoveryengine_v1beta.services.conversational_search_service.pagers
:members:
:inherited-members:
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Services for Google Cloud Discoveryengine v1beta API
:maxdepth: 2

completion_service
conversational_search_service
document_service
recommendation_service
schema_service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
from google.cloud.discoveryengine_v1beta.services.completion_service.client import (
CompletionServiceClient,
)
from google.cloud.discoveryengine_v1beta.services.conversational_search_service.async_client import (
ConversationalSearchServiceAsyncClient,
)
from google.cloud.discoveryengine_v1beta.services.conversational_search_service.client import (
ConversationalSearchServiceClient,
)
from google.cloud.discoveryengine_v1beta.services.document_service.async_client import (
DocumentServiceAsyncClient,
)
Expand Down Expand Up @@ -63,6 +69,23 @@
CompleteQueryRequest,
CompleteQueryResponse,
)
from google.cloud.discoveryengine_v1beta.types.conversation import (
Conversation,
ConversationContext,
ConversationMessage,
Reply,
TextInput,
)
from google.cloud.discoveryengine_v1beta.types.conversational_search_service import (
ConverseConversationRequest,
ConverseConversationResponse,
CreateConversationRequest,
DeleteConversationRequest,
GetConversationRequest,
ListConversationsRequest,
ListConversationsResponse,
UpdateConversationRequest,
)
from google.cloud.discoveryengine_v1beta.types.document import Document
from google.cloud.discoveryengine_v1beta.types.document_service import (
CreateDocumentRequest,
Expand Down Expand Up @@ -126,6 +149,8 @@
__all__ = (
"CompletionServiceClient",
"CompletionServiceAsyncClient",
"ConversationalSearchServiceClient",
"ConversationalSearchServiceAsyncClient",
"DocumentServiceClient",
"DocumentServiceAsyncClient",
"RecommendationServiceClient",
Expand All @@ -141,6 +166,19 @@
"UserInfo",
"CompleteQueryRequest",
"CompleteQueryResponse",
"Conversation",
"ConversationContext",
"ConversationMessage",
"Reply",
"TextInput",
"ConverseConversationRequest",
"ConverseConversationResponse",
"CreateConversationRequest",
"DeleteConversationRequest",
"GetConversationRequest",
"ListConversationsRequest",
"ListConversationsResponse",
"UpdateConversationRequest",
"Document",
"CreateDocumentRequest",
"DeleteDocumentRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
CompletionServiceAsyncClient,
CompletionServiceClient,
)
from .services.conversational_search_service import (
ConversationalSearchServiceAsyncClient,
ConversationalSearchServiceClient,
)
from .services.document_service import DocumentServiceAsyncClient, DocumentServiceClient
from .services.recommendation_service import (
RecommendationServiceAsyncClient,
Expand All @@ -35,6 +39,23 @@
)
from .types.common import CustomAttribute, Interval, UserInfo
from .types.completion_service import CompleteQueryRequest, CompleteQueryResponse
from .types.conversation import (
Conversation,
ConversationContext,
ConversationMessage,
Reply,
TextInput,
)
from .types.conversational_search_service import (
ConverseConversationRequest,
ConverseConversationResponse,
CreateConversationRequest,
DeleteConversationRequest,
GetConversationRequest,
ListConversationsRequest,
ListConversationsResponse,
UpdateConversationRequest,
)
from .types.document import Document
from .types.document_service import (
CreateDocumentRequest,
Expand Down Expand Up @@ -88,6 +109,7 @@

__all__ = (
"CompletionServiceAsyncClient",
"ConversationalSearchServiceAsyncClient",
"DocumentServiceAsyncClient",
"RecommendationServiceAsyncClient",
"SchemaServiceAsyncClient",
Expand All @@ -99,17 +121,26 @@
"CompleteQueryResponse",
"CompletionInfo",
"CompletionServiceClient",
"Conversation",
"ConversationContext",
"ConversationMessage",
"ConversationalSearchServiceClient",
"ConverseConversationRequest",
"ConverseConversationResponse",
"CreateConversationRequest",
"CreateDocumentRequest",
"CreateSchemaMetadata",
"CreateSchemaRequest",
"CustomAttribute",
"DeleteConversationRequest",
"DeleteDocumentRequest",
"DeleteSchemaMetadata",
"DeleteSchemaRequest",
"Document",
"DocumentInfo",
"DocumentServiceClient",
"GcsSource",
"GetConversationRequest",
"GetDocumentRequest",
"GetSchemaRequest",
"ImportDocumentsMetadata",
Expand All @@ -120,6 +151,8 @@
"ImportUserEventsRequest",
"ImportUserEventsResponse",
"Interval",
"ListConversationsRequest",
"ListConversationsResponse",
"ListDocumentsRequest",
"ListDocumentsResponse",
"ListSchemasRequest",
Expand All @@ -133,13 +166,16 @@
"RecommendRequest",
"RecommendResponse",
"RecommendationServiceClient",
"Reply",
"Schema",
"SchemaServiceClient",
"SearchInfo",
"SearchRequest",
"SearchResponse",
"SearchServiceClient",
"TextInput",
"TransactionInfo",
"UpdateConversationRequest",
"UpdateDocumentRequest",
"UpdateSchemaMetadata",
"UpdateSchemaRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,115 @@
}
}
},
"ConversationalSearchService": {
"clients": {
"grpc": {
"libraryClient": "ConversationalSearchServiceClient",
"rpcs": {
"ConverseConversation": {
"methods": [
"converse_conversation"
]
},
"CreateConversation": {
"methods": [
"create_conversation"
]
},
"DeleteConversation": {
"methods": [
"delete_conversation"
]
},
"GetConversation": {
"methods": [
"get_conversation"
]
},
"ListConversations": {
"methods": [
"list_conversations"
]
},
"UpdateConversation": {
"methods": [
"update_conversation"
]
}
}
},
"grpc-async": {
"libraryClient": "ConversationalSearchServiceAsyncClient",
"rpcs": {
"ConverseConversation": {
"methods": [
"converse_conversation"
]
},
"CreateConversation": {
"methods": [
"create_conversation"
]
},
"DeleteConversation": {
"methods": [
"delete_conversation"
]
},
"GetConversation": {
"methods": [
"get_conversation"
]
},
"ListConversations": {
"methods": [
"list_conversations"
]
},
"UpdateConversation": {
"methods": [
"update_conversation"
]
}
}
},
"rest": {
"libraryClient": "ConversationalSearchServiceClient",
"rpcs": {
"ConverseConversation": {
"methods": [
"converse_conversation"
]
},
"CreateConversation": {
"methods": [
"create_conversation"
]
},
"DeleteConversation": {
"methods": [
"delete_conversation"
]
},
"GetConversation": {
"methods": [
"get_conversation"
]
},
"ListConversations": {
"methods": [
"list_conversations"
]
},
"UpdateConversation": {
"methods": [
"update_conversation"
]
}
}
}
}
},
"DocumentService": {
"clients": {
"grpc": {
Expand Down
Loading

0 comments on commit 2058c1f

Please sign in to comment.