Pipeline Registration Guide
A pipeline combines multiple resources (models, prompts, RAGs, helper functions) to create an end-to-end use-case specific workflow. Read more about Pipelines to understand more about what they are and how they work. This guide covers how to register pipelines on the Corridor platform, using an Intent Classification Pipeline as a working example.
Prerequisites
Section titled “Prerequisites”Before registering a pipeline, ensure you have:
-
✅ Registered a Model - Follow the Model Registration Guide to register Gemini 2.0 Flash
-
✅ Registered a Prompt - Follow the Prompt Registration Guide to register the intent classification prompt
Quick Check: Navigate to GenAI Studio → Model Catalog and Prompt Registry to verify your resources are available.
If you haven’t completed these steps, please do so before proceeding.
Registration Steps
Section titled “Registration Steps”Step 1. Navigate to Pipeline Registry
Section titled “Step 1. Navigate to Pipeline Registry”Go to GenAI Studio → Pipeline Registry and click the Create button.
Step 2. Fill in Basic Information
Section titled “Step 2. Fill in Basic Information”
Basic Information fields help organize and identify your pipeline:
- Description: Clear explanation of what the pipeline does and its workflow
- Usecase Type: The primary use case category (e.g., “Question Answering”)
- Task Type: Specific task the pipeline performs (e.g., “Classification”)
- Impact of Generated Output: Scope of the pipeline’s usage (e.g., “Internal Only”)
- Data Usage: Whether the pipeline uses additional data sources beyond user input
- Group: Category for organizing similar pipelines (e.g., “Conversational AI ChatBot Pipeline”)
- Permissible Purpose: Approved use cases and business scenarios for this pipeline
Example for Intent Classification Pipeline:
This is a chat-based pipeline designed for intent recognition & classifies incoming usermessages by assigning them to one of the following predefined intents:
1. ACTIVATE CARD2. APPLY FOR LOAN3. APPLY FOR MORTGAGE4. BLOCK CARD5. CANCEL LOAN
This pipeline operates on a single input and produces a single output for each message,without maintaining conversational context across interactions.Step 3. Configure Code Settings
Section titled “Step 3. Configure Code Settings”
Code Settings define how your pipeline operates and which resources it uses.
Fill in the Basic Information fields as shown in the image above. These includes Alias, Input Type, Pipeline Type, and Context Type.
NOTE: For this case we have chosen to create a chat-based pipeline as in future we can expand the pipeline to recognize the user’s intent over multiple turns, though for now we are keeping it simple and using a single input/output.
Step 4. Add Resources
Section titled “Step 4. Add Resources”Resources are the pre-registered components your pipeline will use.
Click + Create New or search for existing resources to add:
LLMs / Models:
gemini_2_0_flash- The foundation model for generating responses
Prompts:
customer_intent_classification_prompt- The structured instructions for intent classification
Other Resources (Not required for this example):
- RAGs: For retrieving relevant documents
- Agents & Sub-Pipelines: For complex multi-step workflows
- Helper Functions: For data processing utilities, or any other function according to your requirement
Step 5. Write Pipeline Scoring Logic
Section titled “Step 5. Write Pipeline Scoring Logic”
Pipeline Scoring Logic orchestrates how resources work together:
- Combines models, prompts, and other resources
- Processes user inputs and conversation history
- Generates outputs and maintains context across turns
Example - Intent Classification Pipeline:
import json
# Run Gemini with prompt and user inputresponse = gemini_2_0_flash( customer_intent_classification_prompt(user_message=user_message))
# Parse the JSON response to get the classified intentresponse_json = json.loads(response["response"])classified_intent = response_json.get("classified_intent", "UNKNOWN")
# List of valid intentsvalid_intents = [ "ACTIVATE CARD", "BLOCK CARD", "CARD DETAILS", "CHECK CARD ANNUAL FEE", "CHECK CURRENT BALANCE ON CARD",]
# Validate the classified intentif classified_intent not in valid_intents: classified_intent = "UNKNOWN"
# Return output and contextreturn { "output": classified_intent, "context": "Any information that needs to be stored across turns"}What This Does:
- Calls the Gemini model with the classification prompt and user message.
- Parses the JSON response to extract the classified intent.
- Validates the intent against the list of valid intents.
- Returns the classification result as the output and any information that needs to be stored across turns as the context.
Variables Available:
user_message- The current user input (type: String)history- Previous conversation messages (type: list[TypedDict[{‘role’: str, ‘content’: str}]])context- Any information that needs to be stored across turns (type: String)
Step 6. Add Examples (Optional)
Section titled “Step 6. Add Examples (Optional)”
Add test examples to validate pipeline behavior.
Note: Examples help with testing and documenting expected behavior.
Step 7. Save the Pipeline
Section titled “Step 7. Save the Pipeline”Click Create to register the pipeline.
The pipeline is now:
- Available in the Pipeline Registry
- Ready for simulation and testing
- Ready for use in downstream applications
Testing Your Pipeline
Section titled “Testing Your Pipeline”After creating the pipeline, test it to verify behavior:
Quick Test (During Creation/Editing)
Section titled “Quick Test (During Creation/Editing)”- While creating or editing the pipeline, scroll to the Code section
- Click Test Code in the bottom right corner
- Enter test inputs to verify logic without saving
Interactive Test (After Saving)
Section titled “Interactive Test (After Saving)”-
Navigate to your saved pipeline
-
Click Run → Chat Session (top right corner)
NOTE: Chat sessions is only available for chat-based pipelines. For free-flow pipelines, you can test the pipeline by calling the pipeline function with sample inputs using the test code button.
-
Enter sample messages to test the full conversation flow
-
Verify outputs match expected behavior
Using Pipelines
Section titled “Using Pipelines”In Applications
Section titled “In Applications”Reference the pipeline in your application code:
# Call the pipelineresult = customer_intent_classification_pipeline( user_message="I want to block my card", history=[], context="")
# Access the outputclassified_intent = result["output"] # "BLOCK CARD"context = result["context"] # "Any information that needs to be stored across turns"Related Documentation
Section titled “Related Documentation”- Model Registration Guide - Register foundation models
- Prompt Registration Guide - Create reusable prompts
By following this guide, you can create reliable, production-ready pipelines that combine multiple AI resources into cohesive workflows.