Skip to content

Commit

Permalink
Merge branch 'main' into owl-bot-copy-packages-google-cloud-aiplatform
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl authored Oct 8, 2024
2 parents b5b4dfe + e3ff2cc commit 6c56523
Show file tree
Hide file tree
Showing 117 changed files with 38,942 additions and 3,551 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ body:
e.js"
required: true
- label: "Check our Troubleshooting guide:
https://googlecloudplatform.github.io/google-cloud-node/#/docs/guid\
es/troubleshooting"
https://github.com/googleapis/google-cloud-node/blob/main/docs/trou\
bleshooting.md"
required: true
- label: "Check our FAQ:
https://googlecloudplatform.github.io/google-cloud-node/#/docs/guid\
es/faq"
https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.\
md"
required: true
- label: "Check our libraries HOW-TO:
https://github.com/googleapis/gax-nodejs/blob/main/client-libraries\
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/process_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Process Request
about: Submit a process request to the library. Process requests are any requests related to library infrastructure, including CI/CD, publishing, releasing, etc. This issue template should primarily used by internal members.
about: Submit a process request to the library. Process requests are any requests related to library infrastructure, including CI/CD, publishing, releasing, broken links.

---
---
5 changes: 4 additions & 1 deletion .github/scripts/close-invalid-link.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ module.exports = async ({ github, context }) => {
const isBugTemplate = issue.data.body.includes("Link to the code that reproduces this issue");

if (isBugTemplate) {
console.log(`Issue ${number} is a bug template`)
try {
const link = issue.data.body.split("\n")[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/);
const link = issue.data.body.split("\n")[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/)[0];
console.log(`Issue ${number} contains this link: ${link}`)
const isValidLink = (await fetch(link)).ok;
console.log(`Issue ${number} has a ${isValidLink ? "valid" : "invalid"} link`)
if (!isValidLink) {
await closeIssue(github, owner, repo, number);
}
Expand Down
5 changes: 3 additions & 2 deletions packages/google-ai-generativelanguage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
1. [Select or create a Cloud Platform project][projects].
1. [Enable billing for your project][billing].
1. [Enable the Generative Language API API][enable_api].
1. [Set up authentication with a service account][auth] so you can access the
1. [Set up authentication][auth] so you can access the
API from your local workstation.

### Installing the client library
Expand Down Expand Up @@ -190,6 +190,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Permission_service.list_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.list_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.list_permissions.js,packages/google-ai-generativelanguage/samples/README.md) |
| Permission_service.transfer_ownership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.transfer_ownership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.transfer_ownership.js,packages/google-ai-generativelanguage/samples/README.md) |
| Permission_service.update_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.update_permission.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.update_permission.js,packages/google-ai-generativelanguage/samples/README.md) |
| Prediction_service.predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/prediction_service.predict.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/prediction_service.predict.js,packages/google-ai-generativelanguage/samples/README.md) |
| Retriever_service.batch_create_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_create_chunks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_create_chunks.js,packages/google-ai-generativelanguage/samples/README.md) |
| Retriever_service.batch_delete_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_delete_chunks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_delete_chunks.js,packages/google-ai-generativelanguage/samples/README.md) |
| Retriever_service.batch_update_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_update_chunks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_update_chunks.js,packages/google-ai-generativelanguage/samples/README.md) |
Expand Down Expand Up @@ -308,4 +309,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=generativelanguage.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,49 @@ message GenerationConfig {
// `top_k` attribute indicates that the model doesn't apply top-k sampling
// and doesn't allow setting `top_k` on requests.
optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Presence penalty applied to the next token's logprobs if the
// token has already been seen in the response.
//
// This penalty is binary on/off and not dependant on the number of times the
// token is used (after the first). Use
// [frequency_penalty][google.ai.generativelanguage.v1.GenerationConfig.frequency_penalty]
// for a penalty that increases with each use.
//
// A positive penalty will discourage the use of tokens that have already
// been used in the response, increasing the vocabulary.
//
// A negative penalty will encourage the use of tokens that have already been
// used in the response, decreasing the vocabulary.
optional float presence_penalty = 15 [(google.api.field_behavior) = OPTIONAL];

// Optional. Frequency penalty applied to the next token's logprobs,
// multiplied by the number of times each token has been seen in the respponse
// so far.
//
// A positive penalty will discourage the use of tokens that have already
// been used, proportional to the number of times the token has been used:
// The more a token is used, the more dificult it is for the model to use
// that token again increasing the vocabulary of responses.
//
// Caution: A _negative_ penalty will encourage the model to reuse tokens
// proportional to the number of times the token has been used. Small
// negative values will reduce the vocabulary of a response. Larger negative
// values will cause the model to start repeating a common token until it
// hits the
// [max_output_tokens][google.ai.generativelanguage.v1.GenerationConfig.max_output_tokens]
// limit: "...the the the the the...".
optional float frequency_penalty = 16
[(google.api.field_behavior) = OPTIONAL];

// Optional. If true, export the logprobs results in response.
optional bool response_logprobs = 17 [(google.api.field_behavior) = OPTIONAL];

// Optional. Only valid if
// [response_logprobs=True][google.ai.generativelanguage.v1.GenerationConfig.response_logprobs].
// This sets the number of top logprobs to return at each decoding step in the
// [Candidate.logprobs_result][google.ai.generativelanguage.v1.Candidate.logprobs_result].
optional int32 logprobs = 18 [(google.api.field_behavior) = OPTIONAL];
}

// Response from the model supporting multiple candidate responses.
Expand Down Expand Up @@ -368,6 +411,41 @@ message Candidate {

// Output only. Token count for this candidate.
int32 token_count = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only.
double avg_logprobs = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Log-likelihood scores for the response tokens and top tokens
LogprobsResult logprobs_result = 11
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Logprobs Result
message LogprobsResult {
// Candidate for the logprobs token and score.
message Candidate {
// The candidate’s token string value.
optional string token = 1;

// The candidate’s token id value.
optional int32 token_id = 3;

// The candidate's log probability.
optional float log_probability = 2;
}

// Candidates with top log probabilities at each decoding step.
message TopCandidates {
// Sorted by log probability in descending order.
repeated Candidate candidates = 1;
}

// Length = total number of decoding steps.
repeated TopCandidates top_candidates = 1;

// Length = total number of decoding steps.
// The chosen candidates may or may not be in top_candidates.
repeated Candidate chosen_candidates = 2;
}

// Request containing the `Content` for the model to embed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,41 @@ enum HarmCategory {
// Category is unspecified.
HARM_CATEGORY_UNSPECIFIED = 0;

// Negative or harmful comments targeting identity and/or protected attribute.
// **PaLM** - Negative or harmful comments targeting identity and/or protected
// attribute.
HARM_CATEGORY_DEROGATORY = 1;

// Content that is rude, disrespectful, or profane.
// **PaLM** - Content that is rude, disrespectful, or profane.
HARM_CATEGORY_TOXICITY = 2;

// Describes scenarios depicting violence against an individual or group, or
// general descriptions of gore.
// **PaLM** - Describes scenarios depicting violence against an individual or
// group, or general descriptions of gore.
HARM_CATEGORY_VIOLENCE = 3;

// Contains references to sexual acts or other lewd content.
// **PaLM** - Contains references to sexual acts or other lewd content.
HARM_CATEGORY_SEXUAL = 4;

// Promotes unchecked medical advice.
// **PaLM** - Promotes unchecked medical advice.
HARM_CATEGORY_MEDICAL = 5;

// Dangerous content that promotes, facilitates, or encourages harmful acts.
// **PaLM** - Dangerous content that promotes, facilitates, or encourages
// harmful acts.
HARM_CATEGORY_DANGEROUS = 6;

// Harasment content.
// **Gemini** - Harassment content.
HARM_CATEGORY_HARASSMENT = 7;

// Hate speech and content.
// **Gemini** - Hate speech and content.
HARM_CATEGORY_HATE_SPEECH = 8;

// Sexually explicit content.
// **Gemini** - Sexually explicit content.
HARM_CATEGORY_SEXUALLY_EXPLICIT = 9;

// Dangerous content.
// **Gemini** - Dangerous content.
HARM_CATEGORY_DANGEROUS_CONTENT = 10;

// **Gemini** - Content that may be used to harm civic integrity.
HARM_CATEGORY_CIVIC_INTEGRITY = 11;
}

// Safety rating for a piece of content.
Expand Down Expand Up @@ -123,6 +128,9 @@ message SafetySetting {

// All content will be allowed.
BLOCK_NONE = 4;

// Turn off the safety filter.
OFF = 5;
}

// Required. The category for this setting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,51 @@ message Tool {
// be used for function calling.
//
// The model or system does not execute the function. Instead the defined
// function may be returned as a [FunctionCall][content.part.function_call]
// with arguments to the client side for execution. The model may decide to
// call a subset of these functions by populating
// [FunctionCall][content.part.function_call] in the response. The next
// conversation turn may contain a
// [FunctionResponse][content.part.function_response]
// with the [content.role] "function" generation context for the next model
// turn.
// function may be returned as a
// [FunctionCall][google.ai.generativelanguage.v1beta.Part.function_call] with
// arguments to the client side for execution. The model may decide to call a
// subset of these functions by populating
// [FunctionCall][google.ai.generativelanguage.v1beta.Part.function_call] in
// the response. The next conversation turn may contain a
// [FunctionResponse][google.ai.generativelanguage.v1beta.Part.function_response]
// with the [Content.role][google.ai.generativelanguage.v1beta.Content.role]
// "function" generation context for the next model turn.
repeated FunctionDeclaration function_declarations = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. Retrieval tool that is powered by Google search.
GoogleSearchRetrieval google_search_retrieval = 2
[(google.api.field_behavior) = OPTIONAL];

// Optional. Enables the model to execute code as part of generation.
CodeExecution code_execution = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Tool to retrieve public web data for grounding, powered by Google.
message GoogleSearchRetrieval {
// Specifies the dynamic retrieval configuration for the given source.
DynamicRetrievalConfig dynamic_retrieval_config = 1;
}

// Describes the options to customize dynamic retrieval.
message DynamicRetrievalConfig {
// The mode of the predictor to be used in dynamic retrieval.
enum Mode {
// Always trigger retrieval.
MODE_UNSPECIFIED = 0;

// Run retrieval only when system decides it is necessary.
MODE_DYNAMIC = 1;
}

// The mode of the predictor to be used in dynamic retrieval.
Mode mode = 1;

// The threshold to be used in dynamic retrieval.
// If not set, a system default value is used.
optional float dynamic_threshold = 2;
}

// Tool that executes code generated by the model, and automatically returns
// the result to the model.
//
Expand Down Expand Up @@ -342,6 +372,9 @@ message Schema {
// Optional. Maximum number of the elements for Type.ARRAY.
int64 max_items = 21 [(google.api.field_behavior) = OPTIONAL];

// Optional. Minimum number of the elements for Type.ARRAY.
int64 min_items = 22 [(google.api.field_behavior) = OPTIONAL];

// Optional. Properties of Type.OBJECT.
map<string, Schema> properties = 7 [(google.api.field_behavior) = OPTIONAL];

Expand Down
Loading

0 comments on commit 6c56523

Please sign in to comment.