Skip to content

Commit

Permalink
feat: add function_calling_config to ToolConfig
Browse files Browse the repository at this point in the history
feat: add tool_config to GenerateContentRequest

PiperOrigin-RevId: 617966568
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 21, 2024
1 parent 5b48bcb commit 02cf73b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions google/cloud/aiplatform/v1beta1/prediction_service.proto
Expand Up @@ -669,6 +669,9 @@ message GenerateContentRequest {
// knowledge and scope of the model.
repeated Tool tools = 6 [(google.api.field_behavior) = OPTIONAL];

// Tool config. This config is shared for all tools provided in the request.
ToolConfig tool_config = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Per request settings for blocking unsafe content.
// Enforced on GenerateContentResponse.candidates.
repeated SafetySetting safety_settings = 3
Expand Down
35 changes: 35 additions & 0 deletions google/cloud/aiplatform/v1beta1/tool.proto
Expand Up @@ -145,3 +145,38 @@ message GoogleSearchRetrieval {
// generation.
bool disable_attribution = 1 [(google.api.field_behavior) = OPTIONAL];
}

// Tool config. This config is shared for all tools provided in the request.
message ToolConfig {
// Function calling config.
FunctionCallingConfig function_calling_config = 1
[(google.api.field_behavior) = OPTIONAL];
}

// Function calling config.
message FunctionCallingConfig {
// Function calling mode.
enum Mode {
// Unspecified function calling mode. This value should not be used.
MODE_UNSPECIFIED = 0;
// Default model behavior, model decides to predict either a function call
// or a natural language repspose.
AUTO = 1;
// Model is constrained to always predicting a function call only.
// If "allowed_function_names" are set, the predicted function call will be
// limited to any one of "allowed_function_names", else the predicted
// function call will be any one of the provided "function_declarations".
ANY = 2;
// Model will not predict any function call. Model behavior is same as when
// not passing any function declarations.
NONE = 3;
}
// Function calling mode.
Mode mode = 1 [(google.api.field_behavior) = OPTIONAL];

// Function names to call. Only set when the Mode is ANY. Function names
// should match [FunctionDeclaration.name]. With mode set to ANY, model will
// predict a function call from the set of function names provided.
repeated string allowed_function_names = 2
[(google.api.field_behavior) = OPTIONAL];
}

0 comments on commit 02cf73b

Please sign in to comment.