Property | Description | Default | Type | Required |
---|---|---|---|---|
type | Stage class name | - | string | Yes |
enable | Enable stage for execution | true | boolean | No |
name | Name for this specific stage | "vector" | string | No |
save_to_intermediate | If true, the result of the stage will be stored in the intermediate instead of the final section | false | boolean | No |
expand_result | Indicates if the result of this stage should be expanded into the final data dictionary instead of being appended as usual | false | boolean | No |
halt_on_exception | Indicates if the pipeline should be interrupted in case of an exception | true | boolean | No |
model | Indicates the model to be used to calculate or retrieve the vectors. Its restricted by the types allowed by the enum. | EnumSaga.SAGA | Enum | Yes |
open_ai_api_key | This is your Open AI key to use the chat from your service provider | os.environ.get('OPEN_AI_API_KEY', 'default_key') | string | No |
open_ai_api_base_url | Base url of your service provider for Open AI chat. | os.environ.get('OPEN_AI_API_BASE_URL', 'default_url') | string | No |
open_ai_api_type | API type, its restricted by the types allowed by the enum. | EnumOpenAiType.AZURE | Enum | No |
open_ai_api_version | API version of the Open AI chat | os.environ.get('OPEN_AI_API_VERSION', '2023-03-15-preview') | string | No |
azure_deployment_name | Deployment name for the model (AZURE ONLY). | os.environ.get('OPEN_AI_AZURE_DEPLOYMENT_NAME', None) | Union[string, None] | No |
path_to_input | Path to the input in the intermediate that is going to be targeted by this stage to calculate the vector | q | string | No |
The Calculate Vector Stage offers a range of parameters that can be passed via the intermediate input to customize your search request or modify the configuration of the current stage. These parameters provide flexibility and control over the search process.
Parameter | Description |
---|---|
q | A string query for performing a search, this is the target text for the calculate vector. Its path is specified in path_to_input property |
Remember that the intermediate can be fill with either other stages or the original request body that trigger the pipeline, making this essentially REST API parameters
_calculate_vector = CalculateVectorStage( type='CalculateVectorStage', enable=True, name='VectorStage', model=EnumOpenAI.OPENAI_EMBEDDING_ADA, open_ai_api_key='yourapikey', open_ai_api_base_url='baseurl', azure_deployment_name=my_deployment_name, open_ai_api_type=EnumOpenAiType.AZURE, path_to_input='q' )