pipeline_execution
Bases: BasePipelineExecution
Source code in airia/client/pipeline_execution/async_pipeline_execution.py
execute_pipeline(pipeline_id, user_input, debug=False, user_id=None, conversation_id=None, async_output=False, include_tools_response=False, images=None, files=None, data_source_folders=None, data_source_files=None, in_memory_messages=None, current_date_time=None, save_history=True, additional_info=None, prompt_variables=None, voice_enabled=False, output_schema=None, correlation_id=None)
async
execute_pipeline(
pipeline_id: str,
user_input: str,
debug: bool = False,
user_id: Optional[str] = None,
conversation_id: Optional[str] = None,
async_output: Literal[False] = False,
include_tools_response: bool = False,
images: Optional[List[str]] = None,
files: Optional[List[str]] = None,
data_source_folders: Optional[Dict[str, Any]] = None,
data_source_files: Optional[Dict[str, Any]] = None,
in_memory_messages: Optional[
List[Dict[str, Any]]
] = None,
current_date_time: Optional[str] = None,
save_history: bool = True,
additional_info: Optional[List[Any]] = None,
prompt_variables: Optional[Dict[str, Any]] = None,
voice_enabled: bool = False,
output_schema: Optional[Type[BaseModel]] = None,
correlation_id: Optional[str] = None,
) -> PipelineExecutionResponse
execute_pipeline(
pipeline_id: str,
user_input: str,
debug: bool = False,
user_id: Optional[str] = None,
conversation_id: Optional[str] = None,
async_output: Literal[True] = True,
include_tools_response: bool = False,
images: Optional[List[str]] = None,
files: Optional[List[str]] = None,
data_source_folders: Optional[Dict[str, Any]] = None,
data_source_files: Optional[Dict[str, Any]] = None,
in_memory_messages: Optional[
List[Dict[str, Any]]
] = None,
current_date_time: Optional[str] = None,
save_history: bool = True,
additional_info: Optional[List[Any]] = None,
prompt_variables: Optional[Dict[str, Any]] = None,
voice_enabled: bool = False,
output_schema: Optional[Type[BaseModel]] = None,
correlation_id: Optional[str] = None,
) -> PipelineExecutionAsyncStreamedResponse
Execute a pipeline with the provided input asynchronously.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_id
|
str
|
The ID of the pipeline to execute. |
required |
user_input
|
str
|
input text to process. |
required |
debug
|
bool
|
Whether debug mode execution is enabled. Default is False. |
False
|
user_id
|
Optional[str]
|
Optional ID of the user making the request (guid). |
None
|
conversation_id
|
Optional[str]
|
Optional conversation ID (guid). |
None
|
async_output
|
bool
|
Whether to stream the response. Default is False. |
False
|
include_tools_response
|
bool
|
Whether to return the initial LLM tool result. Default is False. |
False
|
images
|
Optional[List[str]]
|
Optional list of image file paths or URLs. |
None
|
files
|
Optional[List[str]]
|
Optional list of file paths or URLs. |
None
|
data_source_folders
|
Optional[Dict[str, Any]]
|
Optional data source folders information. |
None
|
data_source_files
|
Optional[Dict[str, Any]]
|
Optional data source files information. |
None
|
in_memory_messages
|
Optional[List[Dict[str, Any]]]
|
Optional list of in-memory messages, each with a role and message. |
None
|
current_date_time
|
Optional[str]
|
Optional current date and time in ISO format. |
None
|
save_history
|
bool
|
Whether to save the userInput and output to conversation history. Default is True. |
True
|
additional_info
|
Optional[List[Any]]
|
Optional additional information. |
None
|
prompt_variables
|
Optional[Dict[str, Any]]
|
Optional variables to be used in the prompt. |
None
|
voice_enabled
|
bool
|
Whether the request came through the airia-voice-proxy. Default is False. |
False
|
output_schema
|
Optional[Type[BaseModel]]
|
Optional Pydantic model class for structured output. |
None
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing. If not provided, one will be generated automatically. |
None
|
Returns:
| Type | Description |
|---|---|
Union[PipelineExecutionResponse, PipelineExecutionAsyncStreamedResponse]
|
Response containing the result of the execution. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails with details about the error. |
ClientError
|
For other request-related errors. |
Examples:
Basic usage:
client = AiriaAsyncClient(api_key="your_api_key")
response = await client.pipeline_execution.execute_pipeline(
pipeline_id="pipeline_123",
user_input="Tell me about quantum computing"
)
print(response.result)
With structured output:
from pydantic import BaseModel
class PersonInfo(BaseModel):
name: str
age: int
response = await client.pipeline_execution.execute_pipeline(
pipeline_id="pipeline_123",
user_input="Extract person info",
output_schema=PersonInfo
)
Source code in airia/client/pipeline_execution/async_pipeline_execution.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
execute_temporary_assistant(model_parameters, user_input, assistant_name='', prompt_parameters={'prompt': ''}, async_output=False, include_tools_response=False, save_history=True, voice_enabled=False, debug=False, additional_info=None, conversation_id=None, current_date_time=None, data_source_files=None, data_source_folders=None, data_store_parameters=None, external_user_id=None, files=None, images=None, in_memory_messages=None, output_configuration=None, output_schema=None, prompt_variables=None, user_id=None, user_input_id=None, variables=None, correlation_id=None)
async
execute_temporary_assistant(
model_parameters: Dict[str, Any],
user_input: str,
assistant_name: str = "",
prompt_parameters: Dict[str, Any] = {"prompt": ""},
async_output: Literal[False] = False,
include_tools_response: bool = False,
save_history: bool = True,
voice_enabled: bool = False,
debug: bool = False,
additional_info: Optional[List[Any]] = None,
conversation_id: Optional[str] = None,
current_date_time: Optional[str] = None,
data_source_files: Optional[
Dict[str, List[str]]
] = None,
data_source_folders: Optional[
Dict[str, List[str]]
] = None,
data_store_parameters: Optional[Dict[str, Any]] = None,
external_user_id: Optional[str] = None,
files: Optional[List[str]] = None,
images: Optional[List[str]] = None,
in_memory_messages: Optional[
List[Dict[str, Any]]
] = None,
output_configuration: Optional[Dict[str, Any]] = None,
output_schema: Optional[Type[BaseModel]] = None,
prompt_variables: Optional[Dict[str, Any]] = None,
user_id: Optional[str] = None,
user_input_id: Optional[str] = None,
variables: Optional[Dict[str, Any]] = None,
correlation_id: Optional[str] = None,
) -> TemporaryAssistantResponse
execute_temporary_assistant(
model_parameters: Dict[str, Any],
user_input: str,
assistant_name: str = "",
prompt_parameters: Dict[str, Any] = {"prompt": ""},
async_output: Literal[True] = True,
include_tools_response: bool = False,
save_history: bool = True,
voice_enabled: bool = False,
debug: bool = False,
additional_info: Optional[List[Any]] = None,
conversation_id: Optional[str] = None,
current_date_time: Optional[str] = None,
data_source_files: Optional[
Dict[str, List[str]]
] = None,
data_source_folders: Optional[
Dict[str, List[str]]
] = None,
data_store_parameters: Optional[Dict[str, Any]] = None,
external_user_id: Optional[str] = None,
files: Optional[List[str]] = None,
images: Optional[List[str]] = None,
in_memory_messages: Optional[
List[Dict[str, Any]]
] = None,
output_configuration: Optional[Dict[str, Any]] = None,
output_schema: Optional[Type[BaseModel]] = None,
prompt_variables: Optional[Dict[str, Any]] = None,
user_id: Optional[str] = None,
user_input_id: Optional[str] = None,
variables: Optional[Dict[str, Any]] = None,
correlation_id: Optional[str] = None,
) -> TemporaryAssistantAsyncStreamedResponse
Execute a temporary assistant with the provided parameters asynchronously.
This method creates and executes a temporary AI assistant with custom configuration, allowing for flexible assistant behavior without creating a persistent pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_parameters
|
Dict[str, Any]
|
Model parameters (required). Must include libraryModelId, projectModelId, modelIdentifierType, and modelIsAvailableinProject |
required |
user_input
|
str
|
User input text (required) |
required |
assistant_name
|
str
|
Name of the temporary assistant. Default is "" |
''
|
prompt_parameters
|
Dict[str, Any]
|
Parameters for prompt configuration. Default is {"prompt": ""} |
{'prompt': ''}
|
async_output
|
bool
|
Whether to stream the response. Default is False |
False
|
include_tools_response
|
bool
|
Whether to return initial LLM tool result. Default is False |
False
|
save_history
|
bool
|
Whether to save input and output to conversation history. Default is True |
True
|
voice_enabled
|
bool
|
Whether voice output is enabled. Default is False |
False
|
debug
|
bool
|
Whether debug mode execution is enabled. Default is False |
False
|
additional_info
|
Optional[List[Any]]
|
Optional additional information array |
None
|
conversation_id
|
Optional[str]
|
Optional conversation identifier |
None
|
current_date_time
|
Optional[str]
|
Optional current date and time in ISO format |
None
|
data_source_files
|
Optional[Dict[str, List[str]]]
|
Optional dictionary mapping data source GUIDs to file GUID arrays |
None
|
data_source_folders
|
Optional[Dict[str, List[str]]]
|
Optional dictionary mapping data source GUIDs to folder GUID arrays |
None
|
data_store_parameters
|
Optional[Dict[str, Any]]
|
Optional DataStore parameters |
None
|
external_user_id
|
Optional[str]
|
Optional external user identifier |
None
|
files
|
Optional[List[str]]
|
Optional list of file identifiers |
None
|
images
|
Optional[List[str]]
|
Optional list of image identifiers |
None
|
in_memory_messages
|
Optional[List[Dict[str, Any]]]
|
Optional list of in-memory messages |
None
|
output_configuration
|
Optional[Dict[str, Any]]
|
Optional output configuration (raw dict format) |
None
|
output_schema
|
Optional[Type[BaseModel]]
|
Optional Pydantic model class for structured output. If provided, takes precedence over output_configuration. |
None
|
prompt_variables
|
Optional[Dict[str, Any]]
|
Optional prompt variables dictionary |
None
|
user_id
|
Optional[str]
|
Optional user identifier |
None
|
user_input_id
|
Optional[str]
|
Optional unique identifier for user input |
None
|
variables
|
Optional[Dict[str, Any]]
|
Optional variables dictionary |
None
|
correlation_id
|
Optional[str]
|
Optional correlation ID for request tracing. If not provided, one will be generated automatically. |
None
|
Returns:
| Type | Description |
|---|---|
Union[TemporaryAssistantResponse, TemporaryAssistantAsyncStreamedResponse]
|
Response containing the result of the temporary assistant execution. |
Union[TemporaryAssistantResponse, TemporaryAssistantAsyncStreamedResponse]
|
Returns different response types based on the result type discriminator. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails with details about the error. |
ClientError
|
For other request-related errors. |
ValueError
|
If required parameters are missing or invalid. |
Examples:
Basic usage:
client = AiriaAsyncClient(api_key="your_api_key")
response = await client.pipeline_execution.execute_temporary_assistant(
model_parameters={
"libraryModelId": "library-model-id",
"projectModelId": None,
"modelIdentifierType": "Library",
"modelIsAvailableinProject": True,
},
user_input="say double bubble bath ten times fast",
)
print(response.result)
With structured output:
from pydantic import BaseModel
class WeatherInfo(BaseModel):
temperature: float
conditions: str
response = await client.pipeline_execution.execute_temporary_assistant(
model_parameters={...},
user_input="What's the weather?",
output_schema=WeatherInfo
)
Source code in airia/client/pipeline_execution/async_pipeline_execution.py
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | |