From a81d2a2bae9cb1e3102ec78b52419b78c635d621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D2=89=CE=B1k=CE=B1=20x=E2=A0=A0=E2=A0=B5?= <32862241+4k4xs4pH1r3@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:32:20 -0500 Subject: [PATCH] Update x.proto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ҉αkα x⠠⠵ <32862241+4k4xs4pH1r3@users.noreply.github.com> --- ai/x/x.proto | 116 ++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/ai/x/x.proto b/ai/x/x.proto index 452c90a..39a0350 100644 --- a/ai/x/x.proto +++ b/ai/x/x.proto @@ -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; }