pixano.app.routers.inference.conditional_generation
call_text_image_conditional_generation(dataset_id, conversation, messages, model, settings, max_new_tokens=DEFAULT_MAX_NEW_TOKENS, temperature=DEFAULT_TEMPERATURE, image_regex=DEFAULT_IMAGE_REGEX, role_system=DEFAULT_ROLE_SYSTEM, role_user=DEFAULT_ROLE_USER, role_assistant=DEFAULT_ROLE_ASSISTANT)
async
Call a text image conditional generation model for a conversation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_id
|
Annotated[str, Body(embed=True)]
|
The ID of the dataset to use. |
required |
conversation
|
Annotated[EntityModel, Body(embed=True)]
|
The conversation to use. |
required |
messages
|
Annotated[list[AnnotationModel], Body(embed=True)]
|
The messages to use. |
required |
model
|
Annotated[str, Body(embed=True)]
|
The name of the model to use. |
required |
settings
|
Annotated[Settings, Depends(get_settings)]
|
App settings. |
required |
max_new_tokens
|
Annotated[int, Body(embed=True)]
|
The maximum number of tokens to generate. |
DEFAULT_MAX_NEW_TOKENS
|
temperature
|
Annotated[float, Body(embed=True)]
|
The temperature to use. |
DEFAULT_TEMPERATURE
|
image_regex
|
Annotated[str, Body(embed=True)]
|
The regular expression to use to extract images from the text. |
DEFAULT_IMAGE_REGEX
|
role_system
|
Annotated[str, Body(embed=True)]
|
The role of the system. |
DEFAULT_ROLE_SYSTEM
|
role_user
|
Annotated[str, Body(embed=True)]
|
The role of the user. |
DEFAULT_ROLE_USER
|
role_assistant
|
Annotated[str, Body(embed=True)]
|
The role of the assistant. |
DEFAULT_ROLE_ASSISTANT
|
Returns: The generated message model.