Package google.developers.knowledge.v1alpha

インデックス

DeveloperKnowledge

Developer Knowledge API を使用すると、Google の公開デベロッパー ドキュメントにプログラムでアクセスできます。これにより、このナレッジベースを独自のアプリケーションやワークフローに統合できます。

この API は、Google のデベロッパー ドキュメントへの機械可読アクセス用の正規ソースとなるように設計されています。

一般的なユースケースは、まず DeveloperKnowledge.SearchDocumentChunks を使用してクエリに基づいて関連するページ URI を見つけ、次に DeveloperKnowledge.GetDocument または DeveloperKnowledge.BatchGetDocuments を使用して上位の結果のコンテンツ全体を取得することです。

ドキュメントのコンテンツはすべて Markdown 形式で提供されます。

BatchGetDocuments

rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (BatchGetDocumentsResponse)

複数のドキュメントを取得します。各ドキュメントには完全な Markdown コンテンツが含まれます。

認可スコープ

次の OAuth スコープが必要です。

  • https://www.googleapis.com/auth/devprofiles.full_control

詳細については、OAuth 2.0 Overview をご覧ください。

GetDocument

rpc GetDocument(GetDocumentRequest) returns (Document)

完全な Markdown コンテンツを含む単一のドキュメントを取得します。

認可スコープ

次の OAuth スコープが必要です。

  • https://www.googleapis.com/auth/devprofiles.full_control

詳細については、OAuth 2.0 Overview をご覧ください。

SearchDocumentChunks

rpc SearchDocumentChunks(SearchDocumentChunksRequest) returns (SearchDocumentChunksResponse)

Google のデベロッパー向けドキュメント全体でデベロッパーの知識を検索します。このメソッドは、ユーザーのクエリに基づいてドキュメント チャンクを返します。同じドキュメントのチャンクが多数存在する可能性があります。ドキュメント全体を取得するには、SearchDocumentChunksResponse.results で返された DocumentChunk.parent を使用して DeveloperKnowledge.GetDocument または DeveloperKnowledge.BatchGetDocuments を使用します。

認可スコープ

次の OAuth スコープが必要です。

  • https://www.googleapis.com/auth/devprofiles.full_control

詳細については、OAuth 2.0 Overview をご覧ください。

BatchGetDocumentsRequest

DeveloperKnowledge.BatchGetDocuments のリクエスト メッセージです。

フィールド
names[]

string

必須。取得するドキュメントの名前。バッチで取得できるドキュメントの最大数は 20 です。ドキュメントは、リクエストの names と同じ順序で返されます。

形式: documents/{uri_without_scheme} 例: documents/docs.cloud.google.com/storage/docs/creating-buckets

BatchGetDocumentsResponse

DeveloperKnowledge.BatchGetDocuments に対するレスポンス メッセージです。

フィールド
documents[]

Document

書類がリクエストされました。

ドキュメント

ドキュメントは、デベロッパー ナレッジ コーパスのコンテンツの一部を表します。

フィールド
name

string

ID。ドキュメントのリソース名。形式: documents/{uri_without_scheme} 例: documents/docs.cloud.google.com/storage/docs/creating-buckets

uri

string

出力専用。コンテンツの URI(docs.cloud.google.com/storage/docs/creating-buckets など)。

content

string

出力専用。ドキュメントのコンテンツ全体(Markdown 形式)。

description

string

出力専用。ドキュメントの説明。

DocumentChunk

DocumentChunk は、DeveloperKnowledge コーパス内の Document のコンテンツの一部を表します。ドキュメントの内容全体を取得するには、parentDeveloperKnowledge.GetDocument または DeveloperKnowledge.BatchGetDocuments に渡します。

フィールド
parent

string

出力専用。このチャンクの元となるドキュメントのリソース名。形式: documents/{uri_without_scheme} 例: documents/docs.cloud.google.com/storage/docs/creating-buckets

id

string

出力専用。ドキュメント内のこのチャンクの ID。チャンク ID はドキュメント内では一意ですが、ドキュメント間でグローバルに一意ではありません。チャンク ID は安定しておらず、時間の経過とともに変化する可能性があります。

content

string

出力専用。ドキュメント チャンクの内容。

GetDocumentRequest

DeveloperKnowledge.GetDocument のリクエスト メッセージです。

フィールド
name

string

必須。取得するドキュメントの名前。形式: documents/{uri_without_scheme} 例: documents/docs.cloud.google.com/storage/docs/creating-buckets

SearchDocumentChunksRequest

DeveloperKnowledge.SearchDocumentChunks のリクエスト メッセージです。

フィールド
query

string

必須。ユーザーが指定した未加工のクエリ文字列(「Cloud Storage バケットを作成するにはどうすればよいですか?」など)。

page_size

int32

省略可。返される結果の最大件数です。サービスから返される数は、この値より少ない場合があります。

指定されていない場合、最大で 5 件の結果が返されます。

最大値は 20 です。20 を超える値は INVALID_ARGUMENT エラーになります。

page_token

string

省略可。前回の SearchDocumentChunks 呼び出しから受け取ったページトークン。後続のページを取得するにはこれを指定します。

SearchDocumentChunksResponse

DeveloperKnowledge.SearchDocumentChunks に対するレスポンス メッセージです。

フィールド
results[]

DocumentChunk

指定されたクエリの検索結果。このリストの各 DocumentChunk には、検索クエリに関連するコンテンツのスニペットが含まれています。各結果の DocumentChunk.parent フィールドを DeveloperKnowledge.GetDocument または DeveloperKnowledge.BatchGetDocuments とともに使用して、ドキュメントのコンテンツ全体を取得します。

next_page_token

string

省略可。次のページを取得するために page_token として送信できるトークン。このフィールドを省略すると、後続のページはなくなります。