Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDeveloperKnowledgeServer(s grpc.ServiceRegistrar, srv DeveloperKnowledgeServer)
- type Answer
- func (*Answer) Descriptor() ([]byte, []int)deprecated
- func (x *Answer) GetAnswerText() string
- func (x *Answer) GetCitations() []*Answer_AnswerCitation
- func (x *Answer) GetReferences() []*Answer_AnswerReference
- func (*Answer) ProtoMessage()
- func (x *Answer) ProtoReflect() protoreflect.Message
- func (x *Answer) Reset()
- func (x *Answer) String() string
- type AnswerQueryRequest
- func (*AnswerQueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnswerQueryRequest) GetQuery() string
- func (*AnswerQueryRequest) ProtoMessage()
- func (x *AnswerQueryRequest) ProtoReflect() protoreflect.Message
- func (x *AnswerQueryRequest) Reset()
- func (x *AnswerQueryRequest) String() string
- type AnswerQueryResponse
- func (*AnswerQueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AnswerQueryResponse) GetAnswer() *Answer
- func (*AnswerQueryResponse) ProtoMessage()
- func (x *AnswerQueryResponse) ProtoReflect() protoreflect.Message
- func (x *AnswerQueryResponse) Reset()
- func (x *AnswerQueryResponse) String() string
- type Answer_AnswerCitation
- func (*Answer_AnswerCitation) Descriptor() ([]byte, []int)deprecated
- func (x *Answer_AnswerCitation) GetEndIndex() int32
- func (x *Answer_AnswerCitation) GetSources() []*Answer_CitationSource
- func (x *Answer_AnswerCitation) GetStartIndex() int32
- func (*Answer_AnswerCitation) ProtoMessage()
- func (x *Answer_AnswerCitation) ProtoReflect() protoreflect.Message
- func (x *Answer_AnswerCitation) Reset()
- func (x *Answer_AnswerCitation) String() string
- type Answer_AnswerReference
- func (*Answer_AnswerReference) Descriptor() ([]byte, []int)deprecated
- func (x *Answer_AnswerReference) GetContent() isAnswer_AnswerReference_Content
- func (x *Answer_AnswerReference) GetDocumentReference() *Answer_DocumentReference
- func (*Answer_AnswerReference) ProtoMessage()
- func (x *Answer_AnswerReference) ProtoReflect() protoreflect.Message
- func (x *Answer_AnswerReference) Reset()
- func (x *Answer_AnswerReference) String() string
- type Answer_AnswerReference_DocumentReference
- type Answer_CitationSource
- func (*Answer_CitationSource) Descriptor() ([]byte, []int)deprecated
- func (x *Answer_CitationSource) GetReferenceIndex() int32
- func (*Answer_CitationSource) ProtoMessage()
- func (x *Answer_CitationSource) ProtoReflect() protoreflect.Message
- func (x *Answer_CitationSource) Reset()
- func (x *Answer_CitationSource) String() string
- type Answer_DocumentReference
- func (*Answer_DocumentReference) Descriptor() ([]byte, []int)deprecated
- func (x *Answer_DocumentReference) GetDocumentChunk() *DocumentChunk
- func (*Answer_DocumentReference) ProtoMessage()
- func (x *Answer_DocumentReference) ProtoReflect() protoreflect.Message
- func (x *Answer_DocumentReference) Reset()
- func (x *Answer_DocumentReference) String() string
- type BatchGetDocumentsRequest
- func (*BatchGetDocumentsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BatchGetDocumentsRequest) GetNames() []string
- func (x *BatchGetDocumentsRequest) GetView() DocumentView
- func (*BatchGetDocumentsRequest) ProtoMessage()
- func (x *BatchGetDocumentsRequest) ProtoReflect() protoreflect.Message
- func (x *BatchGetDocumentsRequest) Reset()
- func (x *BatchGetDocumentsRequest) String() string
- type BatchGetDocumentsResponse
- func (*BatchGetDocumentsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BatchGetDocumentsResponse) GetDocuments() []*Document
- func (*BatchGetDocumentsResponse) ProtoMessage()
- func (x *BatchGetDocumentsResponse) ProtoReflect() protoreflect.Message
- func (x *BatchGetDocumentsResponse) Reset()
- func (x *BatchGetDocumentsResponse) String() string
- type DeveloperKnowledgeClient
- type DeveloperKnowledgeServer
- type Document
- func (*Document) Descriptor() ([]byte, []int)deprecated
- func (x *Document) GetContent() string
- func (x *Document) GetContentLengthBytes() int32
- func (x *Document) GetDataSource() string
- func (x *Document) GetDescription() string
- func (x *Document) GetName() string
- func (x *Document) GetTitle() string
- func (x *Document) GetUpdateTime() *timestamppb.Timestamp
- func (x *Document) GetUri() string
- func (x *Document) GetView() DocumentView
- func (*Document) ProtoMessage()
- func (x *Document) ProtoReflect() protoreflect.Message
- func (x *Document) Reset()
- func (x *Document) String() string
- type DocumentChunk
- func (*DocumentChunk) Descriptor() ([]byte, []int)deprecated
- func (x *DocumentChunk) GetContent() string
- func (x *DocumentChunk) GetDocument() *Document
- func (x *DocumentChunk) GetId() string
- func (x *DocumentChunk) GetParent() string
- func (*DocumentChunk) ProtoMessage()
- func (x *DocumentChunk) ProtoReflect() protoreflect.Message
- func (x *DocumentChunk) Reset()
- func (x *DocumentChunk) String() string
- type DocumentView
- func (DocumentView) Descriptor() protoreflect.EnumDescriptor
- func (x DocumentView) Enum() *DocumentView
- func (DocumentView) EnumDescriptor() ([]byte, []int)deprecated
- func (x DocumentView) Number() protoreflect.EnumNumber
- func (x DocumentView) String() string
- func (DocumentView) Type() protoreflect.EnumType
- type GetDocumentRequest
- func (*GetDocumentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetDocumentRequest) GetName() string
- func (x *GetDocumentRequest) GetView() DocumentView
- func (*GetDocumentRequest) ProtoMessage()
- func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message
- func (x *GetDocumentRequest) Reset()
- func (x *GetDocumentRequest) String() string
- type SearchDocumentChunksRequest
- func (*SearchDocumentChunksRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchDocumentChunksRequest) GetFilter() string
- func (x *SearchDocumentChunksRequest) GetPageSize() int32
- func (x *SearchDocumentChunksRequest) GetPageToken() string
- func (x *SearchDocumentChunksRequest) GetQuery() string
- func (*SearchDocumentChunksRequest) ProtoMessage()
- func (x *SearchDocumentChunksRequest) ProtoReflect() protoreflect.Message
- func (x *SearchDocumentChunksRequest) Reset()
- func (x *SearchDocumentChunksRequest) String() string
- type SearchDocumentChunksResponse
- func (*SearchDocumentChunksResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SearchDocumentChunksResponse) GetNextPageToken() string
- func (x *SearchDocumentChunksResponse) GetResults() []*DocumentChunk
- func (*SearchDocumentChunksResponse) ProtoMessage()
- func (x *SearchDocumentChunksResponse) ProtoReflect() protoreflect.Message
- func (x *SearchDocumentChunksResponse) Reset()
- func (x *SearchDocumentChunksResponse) String() string
- type UnimplementedDeveloperKnowledgeServer
- func (UnimplementedDeveloperKnowledgeServer) AnswerQuery(context.Context, *AnswerQueryRequest) (*AnswerQueryResponse, error)
- func (UnimplementedDeveloperKnowledgeServer) BatchGetDocuments(context.Context, *BatchGetDocumentsRequest) (*BatchGetDocumentsResponse, error)
- func (UnimplementedDeveloperKnowledgeServer) GetDocument(context.Context, *GetDocumentRequest) (*Document, error)
- func (UnimplementedDeveloperKnowledgeServer) SearchDocumentChunks(context.Context, *SearchDocumentChunksRequest) (*SearchDocumentChunksResponse, error)
- type UnsafeDeveloperKnowledgeServer
Constants ¶
const ( DeveloperKnowledge_SearchDocumentChunks_FullMethodName = "/google.developers.knowledge.v1.DeveloperKnowledge/SearchDocumentChunks" DeveloperKnowledge_GetDocument_FullMethodName = "/google.developers.knowledge.v1.DeveloperKnowledge/GetDocument" DeveloperKnowledge_BatchGetDocuments_FullMethodName = "/google.developers.knowledge.v1.DeveloperKnowledge/BatchGetDocuments" DeveloperKnowledge_AnswerQuery_FullMethodName = "/google.developers.knowledge.v1.DeveloperKnowledge/AnswerQuery" )
Variables ¶
var ( DocumentView_name = map[int32]string{ 0: "DOCUMENT_VIEW_UNSPECIFIED", 1: "DOCUMENT_VIEW_BASIC", 2: "DOCUMENT_VIEW_FULL", 3: "DOCUMENT_VIEW_CONTENT", } DocumentView_value = map[string]int32{ "DOCUMENT_VIEW_UNSPECIFIED": 0, "DOCUMENT_VIEW_BASIC": 1, "DOCUMENT_VIEW_FULL": 2, "DOCUMENT_VIEW_CONTENT": 3, } )
Enum value maps for DocumentView.
var DeveloperKnowledge_ServiceDesc = grpc.ServiceDesc{ ServiceName: "google.developers.knowledge.v1.DeveloperKnowledge", HandlerType: (*DeveloperKnowledgeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SearchDocumentChunks", Handler: _DeveloperKnowledge_SearchDocumentChunks_Handler, }, { MethodName: "GetDocument", Handler: _DeveloperKnowledge_GetDocument_Handler, }, { MethodName: "BatchGetDocuments", Handler: _DeveloperKnowledge_BatchGetDocuments_Handler, }, { MethodName: "AnswerQuery", Handler: _DeveloperKnowledge_AnswerQuery_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "google/developers/knowledge/v1/developerknowledge.proto", }
DeveloperKnowledge_ServiceDesc is the grpc.ServiceDesc for DeveloperKnowledge service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_google_developers_knowledge_v1_developerknowledge_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDeveloperKnowledgeServer ¶
func RegisterDeveloperKnowledgeServer(s grpc.ServiceRegistrar, srv DeveloperKnowledgeServer)
Types ¶
type Answer ¶
type Answer struct {
// Contains the text of the answer.
AnswerText string `protobuf:"bytes,1,opt,name=answer_text,json=answerText,proto3" json:"answer_text,omitempty"`
// Output only. Contains citations for the answer.
Citations []*Answer_AnswerCitation `protobuf:"bytes,2,rep,name=citations,proto3" json:"citations,omitempty"`
// Output only. Contains references for the answer.
References []*Answer_AnswerReference `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty"`
// contains filtered or unexported fields
}
An answer to a query.
func (*Answer) Descriptor
deprecated
func (*Answer) GetAnswerText ¶
func (*Answer) GetCitations ¶
func (x *Answer) GetCitations() []*Answer_AnswerCitation
func (*Answer) GetReferences ¶
func (x *Answer) GetReferences() []*Answer_AnswerReference
func (*Answer) ProtoMessage ¶
func (*Answer) ProtoMessage()
func (*Answer) ProtoReflect ¶
func (x *Answer) ProtoReflect() protoreflect.Message
type AnswerQueryRequest ¶
type AnswerQueryRequest struct {
// Required. The query to answer.
Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
// contains filtered or unexported fields
}
Request message for [DeveloperKnowledge.AnswerQuery][google.developers.knowledge.v1.DeveloperKnowledge.AnswerQuery].
func (*AnswerQueryRequest) Descriptor
deprecated
func (*AnswerQueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnswerQueryRequest.ProtoReflect.Descriptor instead.
func (*AnswerQueryRequest) GetQuery ¶
func (x *AnswerQueryRequest) GetQuery() string
func (*AnswerQueryRequest) ProtoMessage ¶
func (*AnswerQueryRequest) ProtoMessage()
func (*AnswerQueryRequest) ProtoReflect ¶
func (x *AnswerQueryRequest) ProtoReflect() protoreflect.Message
func (*AnswerQueryRequest) Reset ¶
func (x *AnswerQueryRequest) Reset()
func (*AnswerQueryRequest) String ¶
func (x *AnswerQueryRequest) String() string
type AnswerQueryResponse ¶
type AnswerQueryResponse struct {
// The answer to the query.
Answer *Answer `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"`
// contains filtered or unexported fields
}
Response message for [DeveloperKnowledge.AnswerQuery][google.developers.knowledge.v1.DeveloperKnowledge.AnswerQuery].
func (*AnswerQueryResponse) Descriptor
deprecated
func (*AnswerQueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnswerQueryResponse.ProtoReflect.Descriptor instead.
func (*AnswerQueryResponse) GetAnswer ¶
func (x *AnswerQueryResponse) GetAnswer() *Answer
func (*AnswerQueryResponse) ProtoMessage ¶
func (*AnswerQueryResponse) ProtoMessage()
func (*AnswerQueryResponse) ProtoReflect ¶
func (x *AnswerQueryResponse) ProtoReflect() protoreflect.Message
func (*AnswerQueryResponse) Reset ¶
func (x *AnswerQueryResponse) Reset()
func (*AnswerQueryResponse) String ¶
func (x *AnswerQueryResponse) String() string
type Answer_AnswerCitation ¶
type Answer_AnswerCitation struct {
// Output only. Indicates the start of the segment, measured in bytes (UTF-8
// unicode), inclusive. If there are multi-byte characters, such as
// non-ASCII characters, the index measurement is longer than the string
// length.
StartIndex int32 `protobuf:"varint,1,opt,name=start_index,json=startIndex,proto3" json:"start_index,omitempty"`
// Output only. Indicates the end of the segment, measured in bytes (UTF-8
// unicode), exclusive. If there are multi-byte characters, such as
// non-ASCII characters, the index measurement is longer than the string
// length.
EndIndex int32 `protobuf:"varint,2,opt,name=end_index,json=endIndex,proto3" json:"end_index,omitempty"`
// Output only. Contains citation sources for the attributed segment.
Sources []*Answer_CitationSource `protobuf:"bytes,3,rep,name=sources,proto3" json:"sources,omitempty"`
// contains filtered or unexported fields
}
Citation info for a segment.
func (*Answer_AnswerCitation) Descriptor
deprecated
func (*Answer_AnswerCitation) Descriptor() ([]byte, []int)
Deprecated: Use Answer_AnswerCitation.ProtoReflect.Descriptor instead.
func (*Answer_AnswerCitation) GetEndIndex ¶
func (x *Answer_AnswerCitation) GetEndIndex() int32
func (*Answer_AnswerCitation) GetSources ¶
func (x *Answer_AnswerCitation) GetSources() []*Answer_CitationSource
func (*Answer_AnswerCitation) GetStartIndex ¶
func (x *Answer_AnswerCitation) GetStartIndex() int32
func (*Answer_AnswerCitation) ProtoMessage ¶
func (*Answer_AnswerCitation) ProtoMessage()
func (*Answer_AnswerCitation) ProtoReflect ¶
func (x *Answer_AnswerCitation) ProtoReflect() protoreflect.Message
func (*Answer_AnswerCitation) Reset ¶
func (x *Answer_AnswerCitation) Reset()
func (*Answer_AnswerCitation) String ¶
func (x *Answer_AnswerCitation) String() string
type Answer_AnswerReference ¶
type Answer_AnswerReference struct {
// Contains the content of the reference.
//
// Types that are valid to be assigned to Content:
//
// *Answer_AnswerReference_DocumentReference
Content isAnswer_AnswerReference_Content `protobuf_oneof:"content"`
// contains filtered or unexported fields
}
Represents a reference to a source.
func (*Answer_AnswerReference) Descriptor
deprecated
func (*Answer_AnswerReference) Descriptor() ([]byte, []int)
Deprecated: Use Answer_AnswerReference.ProtoReflect.Descriptor instead.
func (*Answer_AnswerReference) GetContent ¶
func (x *Answer_AnswerReference) GetContent() isAnswer_AnswerReference_Content
func (*Answer_AnswerReference) GetDocumentReference ¶
func (x *Answer_AnswerReference) GetDocumentReference() *Answer_DocumentReference
func (*Answer_AnswerReference) ProtoMessage ¶
func (*Answer_AnswerReference) ProtoMessage()
func (*Answer_AnswerReference) ProtoReflect ¶
func (x *Answer_AnswerReference) ProtoReflect() protoreflect.Message
func (*Answer_AnswerReference) Reset ¶
func (x *Answer_AnswerReference) Reset()
func (*Answer_AnswerReference) String ¶
func (x *Answer_AnswerReference) String() string
type Answer_AnswerReference_DocumentReference ¶
type Answer_AnswerReference_DocumentReference struct {
// Output only. The reference document.
DocumentReference *Answer_DocumentReference `protobuf:"bytes,1,opt,name=document_reference,json=documentReference,proto3,oneof"`
}
type Answer_CitationSource ¶
type Answer_CitationSource struct {
// Output only. Contains the index of the
// [Answer.AnswerReference][google.developers.knowledge.v1.Answer.AnswerReference]
// in the `references` repeated field.
ReferenceIndex int32 `protobuf:"varint,1,opt,name=reference_index,json=referenceIndex,proto3" json:"reference_index,omitempty"`
// contains filtered or unexported fields
}
Citation source.
func (*Answer_CitationSource) Descriptor
deprecated
func (*Answer_CitationSource) Descriptor() ([]byte, []int)
Deprecated: Use Answer_CitationSource.ProtoReflect.Descriptor instead.
func (*Answer_CitationSource) GetReferenceIndex ¶
func (x *Answer_CitationSource) GetReferenceIndex() int32
func (*Answer_CitationSource) ProtoMessage ¶
func (*Answer_CitationSource) ProtoMessage()
func (*Answer_CitationSource) ProtoReflect ¶
func (x *Answer_CitationSource) ProtoReflect() protoreflect.Message
func (*Answer_CitationSource) Reset ¶
func (x *Answer_CitationSource) Reset()
func (*Answer_CitationSource) String ¶
func (x *Answer_CitationSource) String() string
type Answer_DocumentReference ¶
type Answer_DocumentReference struct {
// Output only. Contains the document chunk. The `document_chunk.id` field
// is not set and will be empty.
DocumentChunk *DocumentChunk `protobuf:"bytes,1,opt,name=document_chunk,json=documentChunk,proto3" json:"document_chunk,omitempty"`
// contains filtered or unexported fields
}
Represents a reference to a document.
func (*Answer_DocumentReference) Descriptor
deprecated
func (*Answer_DocumentReference) Descriptor() ([]byte, []int)
Deprecated: Use Answer_DocumentReference.ProtoReflect.Descriptor instead.
func (*Answer_DocumentReference) GetDocumentChunk ¶
func (x *Answer_DocumentReference) GetDocumentChunk() *DocumentChunk
func (*Answer_DocumentReference) ProtoMessage ¶
func (*Answer_DocumentReference) ProtoMessage()
func (*Answer_DocumentReference) ProtoReflect ¶
func (x *Answer_DocumentReference) ProtoReflect() protoreflect.Message
func (*Answer_DocumentReference) Reset ¶
func (x *Answer_DocumentReference) Reset()
func (*Answer_DocumentReference) String ¶
func (x *Answer_DocumentReference) String() string
type BatchGetDocumentsRequest ¶
type BatchGetDocumentsRequest struct {
// Required. Specifies the names of the documents to retrieve. A maximum of 20
// documents can be retrieved in a batch. The documents are returned in the
// same order as the `names` in the request.
//
// Format: `documents/{uri_without_scheme}`
// Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
// Optional. Specifies the
// [DocumentView][google.developers.knowledge.v1.DocumentView] of the
// document. If unspecified,
// [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
// defaults to `DOCUMENT_VIEW_CONTENT`.
View DocumentView `protobuf:"varint,2,opt,name=view,proto3,enum=google.developers.knowledge.v1.DocumentView" json:"view,omitempty"`
// contains filtered or unexported fields
}
Request message for [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments].
func (*BatchGetDocumentsRequest) Descriptor
deprecated
func (*BatchGetDocumentsRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchGetDocumentsRequest.ProtoReflect.Descriptor instead.
func (*BatchGetDocumentsRequest) GetNames ¶
func (x *BatchGetDocumentsRequest) GetNames() []string
func (*BatchGetDocumentsRequest) GetView ¶
func (x *BatchGetDocumentsRequest) GetView() DocumentView
func (*BatchGetDocumentsRequest) ProtoMessage ¶
func (*BatchGetDocumentsRequest) ProtoMessage()
func (*BatchGetDocumentsRequest) ProtoReflect ¶
func (x *BatchGetDocumentsRequest) ProtoReflect() protoreflect.Message
func (*BatchGetDocumentsRequest) Reset ¶
func (x *BatchGetDocumentsRequest) Reset()
func (*BatchGetDocumentsRequest) String ¶
func (x *BatchGetDocumentsRequest) String() string
type BatchGetDocumentsResponse ¶
type BatchGetDocumentsResponse struct {
// Contains the documents requested.
Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"`
// contains filtered or unexported fields
}
Response message for [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments].
func (*BatchGetDocumentsResponse) Descriptor
deprecated
func (*BatchGetDocumentsResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchGetDocumentsResponse.ProtoReflect.Descriptor instead.
func (*BatchGetDocumentsResponse) GetDocuments ¶
func (x *BatchGetDocumentsResponse) GetDocuments() []*Document
func (*BatchGetDocumentsResponse) ProtoMessage ¶
func (*BatchGetDocumentsResponse) ProtoMessage()
func (*BatchGetDocumentsResponse) ProtoReflect ¶
func (x *BatchGetDocumentsResponse) ProtoReflect() protoreflect.Message
func (*BatchGetDocumentsResponse) Reset ¶
func (x *BatchGetDocumentsResponse) Reset()
func (*BatchGetDocumentsResponse) String ¶
func (x *BatchGetDocumentsResponse) String() string
type DeveloperKnowledgeClient ¶
type DeveloperKnowledgeClient interface {
// Searches for developer knowledge across Google's developer documentation.
// Returns [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s
// based on the user's query. There may be many chunks from the same
// [Document][google.developers.knowledge.v1.Document]. To retrieve full
// documents, use
// [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
// or
// [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
// with the
// [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent]
// returned in the
// [SearchDocumentChunksResponse.results][google.developers.knowledge.v1.SearchDocumentChunksResponse.results].
SearchDocumentChunks(ctx context.Context, in *SearchDocumentChunksRequest, opts ...grpc.CallOption) (*SearchDocumentChunksResponse, error)
// Retrieves a single document with its full Markdown content.
GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error)
// Retrieves multiple documents, each with its full Markdown content.
BatchGetDocuments(ctx context.Context, in *BatchGetDocumentsRequest, opts ...grpc.CallOption) (*BatchGetDocumentsResponse, error)
// Answers a query using grounded generation.
AnswerQuery(ctx context.Context, in *AnswerQueryRequest, opts ...grpc.CallOption) (*AnswerQueryResponse, error)
}
DeveloperKnowledgeClient is the client API for DeveloperKnowledge service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewDeveloperKnowledgeClient ¶
func NewDeveloperKnowledgeClient(cc grpc.ClientConnInterface) DeveloperKnowledgeClient
type DeveloperKnowledgeServer ¶
type DeveloperKnowledgeServer interface {
// Searches for developer knowledge across Google's developer documentation.
// Returns [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s
// based on the user's query. There may be many chunks from the same
// [Document][google.developers.knowledge.v1.Document]. To retrieve full
// documents, use
// [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
// or
// [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
// with the
// [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent]
// returned in the
// [SearchDocumentChunksResponse.results][google.developers.knowledge.v1.SearchDocumentChunksResponse.results].
SearchDocumentChunks(context.Context, *SearchDocumentChunksRequest) (*SearchDocumentChunksResponse, error)
// Retrieves a single document with its full Markdown content.
GetDocument(context.Context, *GetDocumentRequest) (*Document, error)
// Retrieves multiple documents, each with its full Markdown content.
BatchGetDocuments(context.Context, *BatchGetDocumentsRequest) (*BatchGetDocumentsResponse, error)
// Answers a query using grounded generation.
AnswerQuery(context.Context, *AnswerQueryRequest) (*AnswerQueryResponse, error)
}
DeveloperKnowledgeServer is the server API for DeveloperKnowledge service. All implementations should embed UnimplementedDeveloperKnowledgeServer for forward compatibility
type Document ¶
type Document struct {
// Identifier. Contains the resource name of the document.
// Format: `documents/{uri_without_scheme}`
// Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Output only. Provides the URI of the content, such as
// `docs.cloud.google.com/storage/docs/creating-buckets`.
Uri string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty"`
// Output only. Contains the full content of the document in Markdown format.
Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
// Output only. Provides a description of the document.
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
// Output only. Specifies the data source of the document.
// Example data source: `firebase.google.com`
DataSource string `protobuf:"bytes,5,opt,name=data_source,json=dataSource,proto3" json:"data_source,omitempty"`
// Output only. Provides the title of the document.
Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"`
// Output only. Represents the timestamp when the content or metadata of the
// document was last updated.
UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
// Output only. Specifies the
// [DocumentView][google.developers.knowledge.v1.DocumentView] of the
// document.
View DocumentView `protobuf:"varint,8,opt,name=view,proto3,enum=google.developers.knowledge.v1.DocumentView" json:"view,omitempty"`
// Output only. The length of the `content` field in bytes.
ContentLengthBytes int32 `protobuf:"varint,9,opt,name=content_length_bytes,json=contentLengthBytes,proto3" json:"content_length_bytes,omitempty"`
// contains filtered or unexported fields
}
A Document represents a piece of content from the Developer Knowledge corpus.
func (*Document) Descriptor
deprecated
func (*Document) GetContent ¶
func (*Document) GetContentLengthBytes ¶
func (*Document) GetDataSource ¶
func (*Document) GetDescription ¶
func (*Document) GetUpdateTime ¶
func (x *Document) GetUpdateTime() *timestamppb.Timestamp
func (*Document) GetView ¶
func (x *Document) GetView() DocumentView
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
func (*Document) ProtoReflect ¶
func (x *Document) ProtoReflect() protoreflect.Message
type DocumentChunk ¶
type DocumentChunk struct {
// Output only. Contains the resource name of the document this chunk is from.
// Format: `documents/{uri_without_scheme}`
// Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// Output only. Specifies the ID of this chunk within the document. The chunk
// ID is unique within a document, but not globally unique across documents.
// The chunk ID is not stable and may change over time.
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// Output only. Contains the content of the document chunk.
Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
// Output only. Represents metadata about the
// [Document][google.developers.knowledge.v1.Document] this chunk is from. The
// [DocumentView][google.developers.knowledge.v1.DocumentView] of this
// [Document][google.developers.knowledge.v1.Document] message will be set to
// `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients
// do not need to call
// [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
// or
// [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
// if they only need the metadata fields. Otherwise, clients should use
// [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
// or
// [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
// to fetch the full document content.
Document *Document `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"`
// contains filtered or unexported fields
}
A DocumentChunk represents a piece of content from a Document[google.developers.knowledge.v1.Document] in the DeveloperKnowledge corpus. To fetch the entire document content, pass the `parent` to [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] or [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments].
func (*DocumentChunk) Descriptor
deprecated
func (*DocumentChunk) Descriptor() ([]byte, []int)
Deprecated: Use DocumentChunk.ProtoReflect.Descriptor instead.
func (*DocumentChunk) GetContent ¶
func (x *DocumentChunk) GetContent() string
func (*DocumentChunk) GetDocument ¶
func (x *DocumentChunk) GetDocument() *Document
func (*DocumentChunk) GetId ¶
func (x *DocumentChunk) GetId() string
func (*DocumentChunk) GetParent ¶
func (x *DocumentChunk) GetParent() string
func (*DocumentChunk) ProtoMessage ¶
func (*DocumentChunk) ProtoMessage()
func (*DocumentChunk) ProtoReflect ¶
func (x *DocumentChunk) ProtoReflect() protoreflect.Message
func (*DocumentChunk) Reset ¶
func (x *DocumentChunk) Reset()
func (*DocumentChunk) String ¶
func (x *DocumentChunk) String() string
type DocumentView ¶
type DocumentView int32
Specifies which fields of the Document[google.developers.knowledge.v1.Document] are included.
const ( // The default / unset value. See each API method for its default value if // [DocumentView][google.developers.knowledge.v1.DocumentView] is not // specified. DocumentView_DOCUMENT_VIEW_UNSPECIFIED DocumentView = 0 // Includes only the basic metadata fields: // // - `name` // - `uri` // - `data_source` // - `title` // - `description` // - `update_time` // - `view` // - `content_length_bytes` // // This is the default of view for // [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks]. DocumentView_DOCUMENT_VIEW_BASIC DocumentView = 1 // Includes all [Document][google.developers.knowledge.v1.Document] fields. DocumentView_DOCUMENT_VIEW_FULL DocumentView = 2 // Includes the `DOCUMENT_VIEW_BASIC` fields and the `content` field. // // This is the default of view for // [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument] // and // [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]. DocumentView_DOCUMENT_VIEW_CONTENT DocumentView = 3 )
func (DocumentView) Descriptor ¶
func (DocumentView) Descriptor() protoreflect.EnumDescriptor
func (DocumentView) Enum ¶
func (x DocumentView) Enum() *DocumentView
func (DocumentView) EnumDescriptor
deprecated
func (DocumentView) EnumDescriptor() ([]byte, []int)
Deprecated: Use DocumentView.Descriptor instead.
func (DocumentView) Number ¶
func (x DocumentView) Number() protoreflect.EnumNumber
func (DocumentView) String ¶
func (x DocumentView) String() string
func (DocumentView) Type ¶
func (DocumentView) Type() protoreflect.EnumType
type GetDocumentRequest ¶
type GetDocumentRequest struct {
// Required. Specifies the name of the document to retrieve.
// Format: `documents/{uri_without_scheme}`
// Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Optional. Specifies the
// [DocumentView][google.developers.knowledge.v1.DocumentView] of the
// document. If unspecified,
// [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
// defaults to `DOCUMENT_VIEW_CONTENT`.
View DocumentView `protobuf:"varint,2,opt,name=view,proto3,enum=google.developers.knowledge.v1.DocumentView" json:"view,omitempty"`
// contains filtered or unexported fields
}
Request message for [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument].
func (*GetDocumentRequest) Descriptor
deprecated
func (*GetDocumentRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetDocumentRequest.ProtoReflect.Descriptor instead.
func (*GetDocumentRequest) GetName ¶
func (x *GetDocumentRequest) GetName() string
func (*GetDocumentRequest) GetView ¶
func (x *GetDocumentRequest) GetView() DocumentView
func (*GetDocumentRequest) ProtoMessage ¶
func (*GetDocumentRequest) ProtoMessage()
func (*GetDocumentRequest) ProtoReflect ¶
func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message
func (*GetDocumentRequest) Reset ¶
func (x *GetDocumentRequest) Reset()
func (*GetDocumentRequest) String ¶
func (x *GetDocumentRequest) String() string
type SearchDocumentChunksRequest ¶
type SearchDocumentChunksRequest struct {
// Required. Provides the raw query string provided by the user, such as "How
// to create a Cloud Storage bucket?".
Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
// Optional. Specifies the maximum number of results to return. The service
// may return fewer than this value.
//
// If unspecified, at most 5 results will be returned.
//
// The maximum value is 100; values above 100 will be coerced to 100.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Optional. Contains a page token, received from a previous
// `SearchDocumentChunks` call. Provide this to retrieve the subsequent page.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Optional. Applies a strict filter to the search results. The expression
// supports a subset of the syntax described at https://google.aip.dev/160.
//
// While `SearchDocumentChunks` returns
// [DocumentChunk][google.developers.knowledge.v1.DocumentChunk]s, the filter
// is applied to `DocumentChunk.document` fields.
//
// Supported fields for filtering:
//
// - `data_source` (STRING): The source of the document, e.g.
// `docs.cloud.google.com`. See
// https://developers.google.com/knowledge/reference/corpus-reference for
// the complete list of data sources in the corpus.
// - `update_time` (TIMESTAMP): The timestamp of when the document was last
// meaningfully updated. A meaningful update is one that changes document's
// markdown content or metadata.
// - `uri` (STRING): The document URI, e.g.
// `https://docs.cloud.google.com/bigquery/docs/tables`.
//
// STRING fields support `=` (equals) and `!=` (not equals) operators for
// **exact match** on the whole string. Partial match, prefix match, and
// regexp match are not supported.
//
// TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators.
// Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`.
//
// Note: Field names must be in `snake_case` (e.g., `data_source`). Values on
// the right-hand side of filtering expressions must be string literals
// enclosed in double quotes (e.g., `"docs.cloud.google.com"`).
//
// You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical
// operators. `OR` has higher precedence than `AND`. Use parentheses for
// explicit precedence grouping.
//
// Examples:
//
// - `data_source = "docs.cloud.google.com" OR data_source =
// "firebase.google.com"`
// - `data_source != "firebase.google.com"`
// - `update_time < "2024-01-01T00:00:00Z"`
// - `update_time >= "2025-01-22T00:00:00Z" AND (data_source =
// "developer.chrome.com" OR data_source = "web.dev")`
// - `uri = "https://docs.cloud.google.com/release-notes"`
//
// The `filter` string must not exceed 500 characters; values longer than 500
// characters will result in an `INVALID_ARGUMENT` error.
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
// contains filtered or unexported fields
}
Request message for [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks].
func (*SearchDocumentChunksRequest) Descriptor
deprecated
func (*SearchDocumentChunksRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchDocumentChunksRequest.ProtoReflect.Descriptor instead.
func (*SearchDocumentChunksRequest) GetFilter ¶
func (x *SearchDocumentChunksRequest) GetFilter() string
func (*SearchDocumentChunksRequest) GetPageSize ¶
func (x *SearchDocumentChunksRequest) GetPageSize() int32
func (*SearchDocumentChunksRequest) GetPageToken ¶
func (x *SearchDocumentChunksRequest) GetPageToken() string
func (*SearchDocumentChunksRequest) GetQuery ¶
func (x *SearchDocumentChunksRequest) GetQuery() string
func (*SearchDocumentChunksRequest) ProtoMessage ¶
func (*SearchDocumentChunksRequest) ProtoMessage()
func (*SearchDocumentChunksRequest) ProtoReflect ¶
func (x *SearchDocumentChunksRequest) ProtoReflect() protoreflect.Message
func (*SearchDocumentChunksRequest) Reset ¶
func (x *SearchDocumentChunksRequest) Reset()
func (*SearchDocumentChunksRequest) String ¶
func (x *SearchDocumentChunksRequest) String() string
type SearchDocumentChunksResponse ¶
type SearchDocumentChunksResponse struct {
// Contains the search results for the given query. Each
// [DocumentChunk][google.developers.knowledge.v1.DocumentChunk] in this list
// contains a snippet of content relevant to the search query. Use the
// [DocumentChunk.parent][google.developers.knowledge.v1.DocumentChunk.parent]
// field of each result with
// [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1.DeveloperKnowledge.GetDocument]
// or
// [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1.DeveloperKnowledge.BatchGetDocuments]
// to retrieve the full document content.
Results []*DocumentChunk `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
// Optional. Provides a token that can be sent as `page_token` to retrieve the
// next page. If this field is omitted, there are no subsequent pages.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// contains filtered or unexported fields
}
Response message for [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1.DeveloperKnowledge.SearchDocumentChunks].
func (*SearchDocumentChunksResponse) Descriptor
deprecated
func (*SearchDocumentChunksResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchDocumentChunksResponse.ProtoReflect.Descriptor instead.
func (*SearchDocumentChunksResponse) GetNextPageToken ¶
func (x *SearchDocumentChunksResponse) GetNextPageToken() string
func (*SearchDocumentChunksResponse) GetResults ¶
func (x *SearchDocumentChunksResponse) GetResults() []*DocumentChunk
func (*SearchDocumentChunksResponse) ProtoMessage ¶
func (*SearchDocumentChunksResponse) ProtoMessage()
func (*SearchDocumentChunksResponse) ProtoReflect ¶
func (x *SearchDocumentChunksResponse) ProtoReflect() protoreflect.Message
func (*SearchDocumentChunksResponse) Reset ¶
func (x *SearchDocumentChunksResponse) Reset()
func (*SearchDocumentChunksResponse) String ¶
func (x *SearchDocumentChunksResponse) String() string
type UnimplementedDeveloperKnowledgeServer ¶
type UnimplementedDeveloperKnowledgeServer struct {
}
UnimplementedDeveloperKnowledgeServer should be embedded to have forward compatible implementations.
func (UnimplementedDeveloperKnowledgeServer) AnswerQuery ¶
func (UnimplementedDeveloperKnowledgeServer) AnswerQuery(context.Context, *AnswerQueryRequest) (*AnswerQueryResponse, error)
func (UnimplementedDeveloperKnowledgeServer) BatchGetDocuments ¶
func (UnimplementedDeveloperKnowledgeServer) BatchGetDocuments(context.Context, *BatchGetDocumentsRequest) (*BatchGetDocumentsResponse, error)
func (UnimplementedDeveloperKnowledgeServer) GetDocument ¶
func (UnimplementedDeveloperKnowledgeServer) GetDocument(context.Context, *GetDocumentRequest) (*Document, error)
func (UnimplementedDeveloperKnowledgeServer) SearchDocumentChunks ¶
func (UnimplementedDeveloperKnowledgeServer) SearchDocumentChunks(context.Context, *SearchDocumentChunksRequest) (*SearchDocumentChunksResponse, error)
type UnsafeDeveloperKnowledgeServer ¶
type UnsafeDeveloperKnowledgeServer interface {
// contains filtered or unexported methods
}
UnsafeDeveloperKnowledgeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DeveloperKnowledgeServer will result in compilation errors.