-
Notifications
You must be signed in to change notification settings - Fork 0
Added registration guide for model #13
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
Open
rajneesh407
wants to merge
1
commit into
main
Choose a base branch
from
tanishq_docs_v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| # Model Registration: Gemini 2.0 Flash | ||
|
|
||
| This guide covers registering the Gemini 2.0 Flash model on the platform. | ||
|
|
||
| **Gemini 2.0 Flash** is Google's language model for classification and structured output tasks. | ||
|
|
||
| --- | ||
|
|
||
| ## Registration Steps | ||
|
|
||
| ### Step 1. Navigate to Model Catalog | ||
|
|
||
| Go to **GenAI Studio → Model Catalog** and click the **Create** button. | ||
|
|
||
| ### Step 2. Fill in Basic Information | ||
|
|
||
|  | ||
|
|
||
| **Basic Information** fields help organize and identify your model: | ||
|
|
||
| - **Name:** Human-readable identifier for the model (e.g., "Gemini 2.0 Flash") | ||
| - **Description:** Brief explanation of the model's purpose and capabilities | ||
| - **Group:** Category for organizing similar models together (e.g., "Foundation LLMs") | ||
| - **Permissible Purpose:** Approved use cases and business scenarios for this model | ||
| - **Ownership Type:** License type - Proprietary, Open Source, or Internal | ||
| - **Model Type:** Classification of the model (e.g., "LLM" for language models) | ||
|
|
||
| ### Step 3. Configure Inferencing Logic | ||
|
|
||
| #### Choose Input Type | ||
|
|
||
| **Input Type:** You have two options: | ||
|
|
||
| - **API Based** - Use this when working with models through API providers (OpenAI, Anthropic, Google Vertex AI, etc.) | ||
|
|
||
| - **Python Function** - Use this for custom Python implementations or local models | ||
|
|
||
| For this guide, we'll use **API Based**. | ||
|
|
||
| #### Select Model Provider | ||
|
|
||
| **Model Provider:** Select `Google Vertex AI` from the dropdown | ||
|
|
||
| Once you select a provider, additional fields will appear to configure how the model is called: | ||
|
|
||
|  | ||
|
|
||
| - **Alias:** Variable name to reference this model in pipeline code (e.g., `gemini_2_0_flash`) | ||
| - **Output Type:** Data type returned by the model (e.g., `dict[str, str]`) | ||
| - **Input Type:** Choose between API-based (for external providers) or Python Function (for custom code) | ||
| - **Model Provider:** Select the API provider hosting the model (Google Vertex AI) | ||
| - **Model:** Specific model version from the provider's catalog (Gemini 2.0 Flash) | ||
|
|
||
| #### Define Arguments | ||
|
|
||
| The inputs to the model - messages, system instruction, temperature, etc. | ||
|
|
||
| Click **+ Add Argument** to add each argument: | ||
|
|
||
| | Alias | Type | Is Optional | Default Value | | ||
| |-------|------|-------------|---------------| | ||
| | `text` | String | ☐ | - | | ||
| | `temperature` | Numerical | ☑ | 0 | | ||
| | `system_instruction` | String | ☑ | None | | ||
|
|
||
| **Argument Descriptions:** | ||
|
|
||
| - `text`: The input prompt to send to the model | ||
|
|
||
| - `temperature`: Controls randomness (0 = deterministic, 1 = creative) | ||
|
|
||
| - `system_instruction`: Optional system-level instructions for the model | ||
|
|
||
| You can add additional arguments based on your model's requirements. | ||
|
|
||
| #### Write Scoring Logic | ||
|
|
||
|  | ||
|
|
||
| Provide logic to initialize and score the model: | ||
|
|
||
| ```python | ||
| import os | ||
| from google import genai | ||
| from google.genai import types | ||
|
|
||
| client = genai.Client(api_key=os.getenv("GOOGLE_API_TOKEN")) | ||
|
|
||
| config = types.GenerateContentConfig( | ||
| temperature=temperature, | ||
| seed=2025, | ||
| system_instruction=system_instruction | ||
| ) | ||
|
|
||
| response = client.models.generate_content( | ||
| model="gemini-2.0-flash", | ||
| contents=text, | ||
| config=config | ||
| ) | ||
|
|
||
| return { | ||
| "response": response.text, | ||
| } | ||
| ``` | ||
|
|
||
| **What This Code Does:** | ||
|
|
||
| - Authenticates using the `GOOGLE_API_TOKEN` environment variable (configured in Platform Integrations) | ||
| - Sets up generation config with temperature and system instruction | ||
| - Calls the Gemini 2.0 Flash model with the input text | ||
| - Returns the generated response | ||
|
|
||
| ### Step 4. Save the Model | ||
|
|
||
| Add any notes or additional information in the **Additional Information** section, then click **Create** to complete registration. | ||
|
|
||
|
|
||
| ### Step 5. Quick Example Run | ||
|
|
||
| Click **Test Code** to run a sample query. | ||
|
|
||
|  | ||
|
|
||
| Use the platform's test interface to verify: | ||
|
|
||
| - Verify API authentication is working | ||
| - Test with sample inputs before using in production | ||
| - Debug any configuration issues | ||
| - Validate the output format matches expectations | ||
|
|
||
| ## Usage in Pipelines | ||
|
|
||
| Once registered, the model appears in your Resources library and can be selected for any downstream usages. | ||
|
|
||
| **Reference in pipeline code:** | ||
| ```python | ||
| # Call the registered model | ||
| response = gemini_2_0_flash( | ||
| text=user_prompt, | ||
| temperature=0.7, | ||
| system_instruction="You are a helpful assistant." | ||
| ) | ||
|
|
||
| # Access the response | ||
| output_text = response["response"] | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Prompt Registration Guide](../prompt/) - Create reusable prompts | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add while doing other commits when Prompt etc.. is available .. Currently this link would throw error |
||
| - [Google Gemini API Docs](https://ai.google.dev/gemini-api/docs) - Official Google documentation | ||
|
|
||
| --- | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A brief explanation of Basic Information ? What it is ?