-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ҉αkα x⠠⠵ <[email protected]>
- Loading branch information
1 parent
fb65946
commit a81d2a2
Showing
1 changed file
with
51 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,64 @@ | ||
syntax = "proto3"; | ||
|
||
package gemini.auth; | ||
package google.ollama.v1; | ||
|
||
// Service for authenticating users with Google OAuth2 within Gemini. | ||
service AuthService { | ||
// Initiates the Google OAuth2 authentication flow. | ||
rpc Authenticate (AuthenticateRequest) returns (AuthenticateResponse) {} | ||
} | ||
import "google/api/annotations.proto"; | ||
import "google/api/client.proto"; | ||
import "google/api/field_behavior.proto"; | ||
|
||
// Request message for initiating authentication. | ||
message AuthenticateRequest { | ||
// The client ID of the Gemini application registered with Google. | ||
string client_id = 1; | ||
// The redirect URI where Google should redirect the user after authentication. | ||
string redirect_uri = 2; | ||
// (Optional) The scopes of access being requested from the user. | ||
repeated string scopes = 3; | ||
service Ollama { | ||
// Generates a text completion from the given prompt and model. | ||
rpc GenerateTextCompletion (GenerateTextCompletionRequest) returns (GenerateTextCompletionResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/projects/{project}/models/{model}:generateText" | ||
body: "*" | ||
}; | ||
option (google.api.method_signature) = "project, model, prompt"; | ||
} | ||
} | ||
|
||
// Response message containing the OAuth2 authorization URL. | ||
message AuthenticateResponse { | ||
// The URL the user should be redirected to for authorization. | ||
string authorization_url = 1; | ||
} | ||
message GenerateTextCompletionRequest { | ||
// Required. The Google Cloud project to use for the request. | ||
// This should be one of: | ||
// - "astra" | ||
// - "jules" | ||
// - "mariner" | ||
// - "notebooklm" | ||
// - "vertex" | ||
// - "gemini-advanced-1.5-pro" | ||
// - "gemini-advanced-1.5-flash" | ||
// - "gemini-advanced-1.5-pro-with-deep-research" | ||
// - "gemini-2.0-flash-experimental" | ||
// - "gemini-extensions" | ||
// - "gemini-gems" | ||
// - "colab.research.google.com" | ||
// - "idx.google.com" | ||
string project = 1 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// Service for exchanging an authorization code for access and refresh tokens. | ||
service TokenService { | ||
// Exchanges the authorization code for tokens. | ||
rpc ExchangeCode (ExchangeCodeRequest) returns (ExchangeCodeResponse) {} | ||
|
||
// Refreshes the access token using the refresh token. | ||
rpc RefreshToken (RefreshTokenRequest) returns (RefreshTokenResponse) {} | ||
} | ||
// Required. The ID of the model to use for the request. | ||
// This can be any valid Ollama model ID. | ||
string model = 2 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// Request message for exchanging the authorization code. | ||
message ExchangeCodeRequest { | ||
// The authorization code received from Google. | ||
string code = 1; | ||
// The client ID of the Gemini application. | ||
string client_id = 2; | ||
// The client secret of the Gemini application. | ||
string client_secret = 3; | ||
// The redirect URI used in the initial request. | ||
string redirect_uri = 4; | ||
} | ||
// Required. The prompt to generate a completion for. | ||
string prompt = 3 [(google.api.field_behavior) = REQUIRED]; | ||
|
||
// Response message containing the access and refresh tokens. | ||
message ExchangeCodeResponse { | ||
// The access token granted by Google. | ||
string access_token = 1; | ||
// The refresh token used to obtain new access tokens. | ||
string refresh_token = 2; | ||
// The type of token granted (e.g., "Bearer"). | ||
string token_type = 3; | ||
// The number of seconds the access token is valid for. | ||
int32 expires_in = 4; | ||
} | ||
// Optional. The maximum number of tokens to generate. | ||
int32 max_tokens = 4; | ||
|
||
// Optional. The sampling temperature to use. | ||
float temperature = 5; | ||
|
||
// Optional. The top-k value to use. | ||
int32 top_k = 6; | ||
|
||
// Optional. The top-p value to use. | ||
float top_p = 7; | ||
|
||
// Request message for refreshing the access token. | ||
message RefreshTokenRequest { | ||
// The refresh token obtained during the initial token exchange. | ||
string refresh_token = 1; | ||
// The client ID of the Gemini application. | ||
string client_id = 2; | ||
// The client secret of the Gemini application. | ||
string client_secret = 3; | ||
// Optional. The repetition penalty to use. | ||
float repetition_penalty = 8; | ||
} | ||
|
||
// Response message containing the refreshed access token. | ||
message RefreshTokenResponse { | ||
// The new access token granted by Google. | ||
string access_token = 1; | ||
// The type of token granted (e.g., "Bearer"). | ||
string token_type = 2; | ||
// The number of seconds the access token is valid for. | ||
int32 expires_in = 3; | ||
message GenerateTextCompletionResponse { | ||
// The generated text completion. | ||
string completion = 1; | ||
} |