Property | Description | Default | Type | Required | QPL Config? |
---|---|---|---|---|---|
enable | Enable stage for execution | true | boolean | No | No |
name | Name for this specific stage | "vector" | string | No | 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 | 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 | No |
halt_on_exception | Indicates if the pipeline should be interrupted in case of an exception | true | boolean | No | No |
model | Indicates the model to be used to calculate or retrieve the vectors. | EnumSaga.SAGA | Enum | Yes | No |
open_ai_api_key | API key to connect to Open AI. | os.environ.get('OPEN_AI_API_KEY', 'default_key') | string | No | No |
open_ai_api_base_url | Base url to connect to Open AI. | os.environ.get('OPEN_AI_API_BASE_URL', 'default_url') | string | No | No |
open_ai_api_type | Type of the Open AI API. | EnumOpenAiType.AZURE | Enum | No | No |
open_ai_api_version | Version of the Open AI API. | os.environ.get('OPEN_AI_API_VERSION', '2023-03-15-preview') | string | No | No |
type | string | Yes | 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. Can be transformed into engine-specific queries using PyQPL (Query Parser Language). |
query | Engine-specific queries for the search. |
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
_vector_stage = CalculateVectorStage( enable=True, save_to_intermediate=True, expand_result=False, halt_on_exception=False, name=VECTOR_STAGE_NAME, model=EnumOpenAI.OPENAI_EMBEDDING_ADA, open_ai_api_key=os.environ.get('OPEN_AI_API_KEY'), open_ai_api_base_url=os.environ.get('OPEN_AI_API_BASE_URL'), open_ai_api_type=EnumOpenAiType.AZURE, open_ai_api_version='2023-03-15-preview', type='CalculateVectorStage' )