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

Search grounding #271

Merged
merged 4 commits into from
Oct 2, 2024
Merged

Search grounding #271

merged 4 commits into from
Oct 2, 2024

Conversation

junyanxu
Copy link
Collaborator

@junyanxu junyanxu commented Oct 2, 2024

Add search grouding function feature for both stream/unary.

shilpakancharla
shilpakancharla previously approved these changes Oct 2, 2024
hsubox76
hsubox76 previously approved these changes Oct 2, 2024
*/
export declare interface GoogleSearchRetrievalTool {
/**
* Google search retrival tool config.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "retrival" => "retrieval"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/**
* Google search retrival tool config.
*/
googleSearchRetrieval?: GoogleSearchRetrieval;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any of the properties in this document required? Just double checking because they're all currently marked as optional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see FunctionDeclarationsTool has functionDeclarations optional? So i guess that's ok. By default all proto auto generated field should be optional

common/api-review/generative-ai.api.md Outdated Show resolved Hide resolved
*/
segment?: string;
/**
* A list of indices (into 'grounding_chunk') specifying the citations associated with the claim. For instance [1,3,4] means that grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the retrieved content attributed to the claim.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: break long comment lines to fit the 80-char line width limit, e.g.

 /**
  * A list of indices (into 'grounding_chunk') specifying the citations
  * associated with the claim. For instance [1,3,4] means that
  * grounding_chunk[1], grounding_chunk[3], grounding_chunk[4] are the
  * retrieved content attributed to the claim.
  */

Here and in other parts of this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

/**
* Retrieval tool that is powered by Google search.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark all public interfaces with @public (don't need to worry about tagging the properties, they will automatically be included)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

const makeRequestStub = stub(request, "makeModelRequest").resolves(
mockResponse as Response,
);
const expectedGourdingMetadata = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -163,6 +164,8 @@ export interface GenerateContentCandidate {
avgLogprobs?: number;
/** Log-likelihood scores for the response tokens and top tokens. */
logprobsResult?: LogprobsResult;
/** Search gounding metadata. */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: gounding => grounding

@hsubox76 hsubox76 dismissed their stale review October 2, 2024 19:50

Wrong button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants